From f889c5852a86e0ba17cffa49ef102bc231037509 Mon Sep 17 00:00:00 2001 From: Mauro Cassani Date: Fri, 8 Nov 2024 12:15:08 +0100 Subject: [PATCH 1/3] Fixed assign a job to a translator --- lib/Utils/Email/SendToTranslatorAbstract.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/lib/Utils/Email/SendToTranslatorAbstract.php b/lib/Utils/Email/SendToTranslatorAbstract.php index 334fbfdb1b..995c4247ea 100644 --- a/lib/Utils/Email/SendToTranslatorAbstract.php +++ b/lib/Utils/Email/SendToTranslatorAbstract.php @@ -65,15 +65,14 @@ protected function _getTemplateVariables(): array { 'user' => $userRecipient, 'email' => $this->translator->email, 'delivery_date' => $this->translator->delivery_date, - 'project_url' => call_user_func( $this->_RoutesMethod, [ - 'invited_by_uid' => $this->user->uid, - 'email' => $this->translator->email, - 'project_name' => $this->projectName, - 'id_job' => $this->translator->id_job, - 'password' => $this->translator->job_password, - 'source' => $this->translator->source, - 'target' => $this->translator->target - ] ) + 'project_url' => call_user_func( + $this->_RoutesMethod, + $this->projectName, + $this->translator->id_job, + $this->translator->job_password, + $this->translator->source, + $this->translator->target + ) ]; } From 9a77865a407bf02cede6597f5c707eabaa0f6933 Mon Sep 17 00:00:00 2001 From: domenico Date: Fri, 8 Nov 2024 12:36:27 +0100 Subject: [PATCH 2/3] Fix: The logout should not log out all browsers but only the one of the requester. --- lib/Controller/API/App/Authentication/LoginController.php | 4 ++-- .../API/Commons/Authentication/AuthenticationTrait.php | 6 +++++- lib/Routes/utils_routes.php | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/Controller/API/App/Authentication/LoginController.php b/lib/Controller/API/App/Authentication/LoginController.php index 94e734712c..658a6ef0b2 100644 --- a/lib/Controller/API/App/Authentication/LoginController.php +++ b/lib/Controller/API/App/Authentication/LoginController.php @@ -25,8 +25,8 @@ class LoginController extends AbstractStatefulKleinController { use RateLimiterTrait; - public function logout() { - $this->broadcastLogout(); + public function directLogout() { + $this->logout(); $this->response->code( 200 ); } diff --git a/lib/Controller/API/Commons/Authentication/AuthenticationTrait.php b/lib/Controller/API/Commons/Authentication/AuthenticationTrait.php index 28f0091e8d..13151e39ae 100644 --- a/lib/Controller/API/Commons/Authentication/AuthenticationTrait.php +++ b/lib/Controller/API/Commons/Authentication/AuthenticationTrait.php @@ -63,7 +63,7 @@ public function getUser(): ?Users_UserStruct { } public function broadcastLogout() { - AuthenticationHelper::destroyAuthentication( $_SESSION ); + $this->logout(); $queueHandler = new AMQHandler(); $message = json_encode( [ '_type' => 'logout', @@ -77,4 +77,8 @@ public function broadcastLogout() { $queueHandler->publishToTopic( INIT::$SSE_NOTIFICATIONS_QUEUE_NAME, new Message( $message ) ); } + public function logout(){ + AuthenticationHelper::destroyAuthentication( $_SESSION ); + } + } \ No newline at end of file diff --git a/lib/Routes/utils_routes.php b/lib/Routes/utils_routes.php index 562214c94e..1cb6cbb70f 100644 --- a/lib/Routes/utils_routes.php +++ b/lib/Routes/utils_routes.php @@ -18,7 +18,7 @@ route( '/password/change', 'POST', [ 'API\App\Authentication\UserController', 'changePasswordAsLoggedUser' ] ); route( '/login', 'POST', [ 'API\App\Authentication\LoginController', 'login' ] ); - route( '/logout', 'POST', [ 'API\App\Authentication\LoginController', 'logout' ] ); + route( '/logout', 'POST', [ 'API\App\Authentication\LoginController', 'directLogout' ] ); route( '/login/token', 'GET', [ 'API\App\Authentication\LoginController', 'token' ] ); route( '/metadata', 'POST', [ 'API\App\UserMetadataController', 'update' ] ); From 42ee26bfb0acf093b2b08706e7689bbaf24286bd Mon Sep 17 00:00:00 2001 From: domenico Date: Fri, 8 Nov 2024 13:37:57 +0100 Subject: [PATCH 3/3] Updated database schema sql - Optimized imports --- INSTALL/matecat.sql | 48 +-- lib/Controller/API/V1/StatsController.php | 2 +- .../API/V2/ActivityLogController.php | 4 +- lib/Controller/API/V2/BaseChunkController.php | 2 +- .../API/V2/ChangePasswordController.php | 2 +- lib/Controller/API/V2/ChunkController.php | 4 +- .../V2/ChunkTranslationVersionController.php | 2 +- lib/Controller/API/V2/CommentsController.php | 2 +- lib/Controller/API/V2/JobMergeController.php | 2 +- lib/Controller/API/V2/JobSplitController.php | 2 +- .../API/V2/ProjectCompletionStatus.php | 1 - lib/Controller/API/V2/ProjectsController.php | 2 +- .../V2/ReviseTranslationIssuesController.php | 2 +- lib/Controller/API/V2/SegmentVersion.php | 2 +- .../API/V2/TeamMembersController.php | 2 - lib/Controller/API/V2/TeamsController.php | 2 - .../API/V2/TeamsProjectsController.php | 2 - lib/Controller/API/V2/UrlsController.php | 2 +- lib/Controller/API/V3/ChunkController.php | 2 +- lib/Controller/API/V3/CountWordController.php | 2 +- lib/Controller/API/V3/FileInfoController.php | 2 +- .../API/V3/PayableRateController.php | 1 - .../API/V3/SegmentAnalysisController.php | 4 - lib/Controller/API/V3/StatusController.php | 3 - lib/Model/Comments/CommentDao.php | 1 - lib/Model/Files/FilesJobDao.php | 2 +- lib/Model/FilesStorage/IFilesStorage.php | 1 - lib/Model/LQA/ChunkReviewDao.php | 2 +- lib/Model/LQA/EntryDao.php | 2 +- lib/Model/Projects/ProjectModel.php | 1 - lib/Model/Search/SearchModel.php | 1 - lib/Model/Segments/SegmentDao.php | 1 - lib/Model/Translations/WarningDao.php | 2 +- lib/Model/matecat.sql | 293 +++++++++++------- lib/Plugins/Features/Mmt.php | 1 - .../Controller/CompletionEventController.php | 2 +- .../ProjectCompletion/Model/EventModel.php | 2 +- .../Model/ProjectCompletionStatusModel.php | 2 +- .../ReviewExtended/BatchReviewProcessor.php | 2 +- .../ReviewExtended/ChunkReviewModel.php | 2 +- .../Controller/API/Json/ProjectUrls.php | 2 +- .../API/QualityReportController.php | 2 +- .../Model/QualityReportModel.php | 2 +- .../Features/ReviewExtended/ReviewUtils.php | 2 +- .../ReviewExtended/ReviewedWordCountModel.php | 2 +- .../ReviewExtended/TranslationIssueModel.php | 2 +- .../Controller/API/FilterController.php | 2 +- .../SegmentFilter/Model/SegmentFilterDao.php | 2 +- .../Model/SegmentFilterModel.php | 2 +- .../Model/TranslationEvent.php | 3 +- .../TranslationEventsHandler.php | 4 +- lib/Plugins/Features/TranslationVersions.php | 2 +- .../Handlers/TranslationVersionsHandler.php | 2 +- .../Model/TranslationVersionDao.php | 2 +- lib/Utils/ActivityLog/Activity.php | 1 - .../Workers/BulkSegmentStatusChangeWorker.php | 2 +- .../Microsoft/MicrosoftProvider.php | 1 - .../ContributionRequestStruct.php | 2 +- lib/Utils/Email/AbstractEmail.php | 1 - lib/Utils/Engines/Traits/HotSwap.php | 1 - lib/Utils/LQA/QA.php | 8 +- lib/Utils/ManageUtils.php | 4 +- lib/Utils/PostProcess.php | 4 +- lib/Utils/ProjectQueue/Queue.php | 1 - lib/Utils/RecursiveArrayObject.php | 2 - lib/Utils/TMS/TMSService.php | 2 +- .../TaskRunner/Commons/AbstractWorker.php | 1 - .../Validator/Contracts/AbstractValidator.php | 1 - lib/View/API/V2/Json/SegmentVersion.php | 2 +- lib/View/API/V3/Json/QualitySummary.php | 4 +- ...025143100_alter_project_templates_lang.php | 14 + 71 files changed, 269 insertions(+), 229 deletions(-) create mode 100644 migrations/20241025143100_alter_project_templates_lang.php diff --git a/INSTALL/matecat.sql b/INSTALL/matecat.sql index 644ca4f846..506421adf5 100644 --- a/INSTALL/matecat.sql +++ b/INSTALL/matecat.sql @@ -786,36 +786,36 @@ CREATE TABLE `projects` /*!40101 SET character_set_client = @saved_cs_client */; -- --- Table structure for table `qa_archived_reports` +-- Table structure for table `project_templates` -- DROP TABLE IF EXISTS `project_templates`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8mb4 */; CREATE TABLE `project_templates` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(255) NOT NULL, - `is_default` tinyint(1) NOT NULL DEFAULT '0', - `uid` bigint(20) NOT NULL, - `id_team` int(11) NOT NULL, - `speech2text` tinyint(1) NOT NULL DEFAULT '0', - `lexica` tinyint(1) NOT NULL DEFAULT '0', - `tag_projection` tinyint(1) NOT NULL DEFAULT '0', - `pretranslate_100` tinyint(1) NOT NULL DEFAULT '0', - `pretranslate_101` tinyint(1) NOT NULL DEFAULT '1', - `get_public_matches` tinyint(1) NOT NULL DEFAULT '0', - `segmentation_rule` varchar(255) DEFAULT NULL, - `cross_language_matches` text, - `tm` text, - `mt` text, - `payable_rate_template_id` int(11) DEFAULT NULL, - `qa_model_template_id` int(11) DEFAULT NULL, - `filters_xliff_config_template_id` int(11) DEFAULT NULL, - `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, - `modified_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (`id`), - UNIQUE KEY `uid_name_idx` (`uid`,`name`), - KEY `uid_idx` (`uid`) + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `is_default` tinyint(1) NOT NULL DEFAULT '0', + `uid` bigint(20) NOT NULL, + `id_team` int(11) NOT NULL, + `pretranslate_100` tinyint(1) NOT NULL DEFAULT '0', + `pretranslate_101` tinyint(1) NOT NULL DEFAULT '1', + `get_public_matches` tinyint(1) NOT NULL DEFAULT '0', + `segmentation_rule` varchar(255) DEFAULT NULL, + `tm` text, + `mt` text, + `payable_rate_template_id` int(11) DEFAULT NULL, + `qa_model_template_id` int(11) DEFAULT NULL, + `filters_template_id` int(11) DEFAULT NULL, + `xliff_config_template_id` int(11) DEFAULT NULL, + `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `modified_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `subject` varchar(255) DEFAULT NULL, + `source_language` varchar(45) DEFAULT NULL, + `target_language` varchar(2048) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `uid_name_idx` (`uid`,`name`), + KEY `uid_idx` (`uid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; diff --git a/lib/Controller/API/V1/StatsController.php b/lib/Controller/API/V1/StatsController.php index 57460acfd4..c488695711 100644 --- a/lib/Controller/API/V1/StatsController.php +++ b/lib/Controller/API/V1/StatsController.php @@ -5,8 +5,8 @@ use API\Commons\KleinController; use API\Commons\Validators\ChunkPasswordValidator; -use CatUtils; use API\V2\Validators\LoginValidator; +use CatUtils; use Jobs_JobStruct; use WordCount\WordCountStruct; diff --git a/lib/Controller/API/V2/ActivityLogController.php b/lib/Controller/API/V2/ActivityLogController.php index edf5dd73fa..6d363d8bbc 100644 --- a/lib/Controller/API/V2/ActivityLogController.php +++ b/lib/Controller/API/V2/ActivityLogController.php @@ -12,11 +12,11 @@ use ActivityLog\ActivityLogDao; use ActivityLog\ActivityLogStruct; use API\Commons\KleinController; +use API\Commons\Validators\ChunkPasswordValidator; +use API\Commons\Validators\ProjectPasswordValidator; use API\V2\Json\Activity; use Exception; use ReflectionException; -use API\Commons\Validators\ChunkPasswordValidator; -use API\Commons\Validators\ProjectPasswordValidator; class ActivityLogController extends KleinController { diff --git a/lib/Controller/API/V2/BaseChunkController.php b/lib/Controller/API/V2/BaseChunkController.php index baccc0589b..2738e1a4a6 100644 --- a/lib/Controller/API/V2/BaseChunkController.php +++ b/lib/Controller/API/V2/BaseChunkController.php @@ -3,8 +3,8 @@ namespace API\V2; use API\Commons\KleinController; -use Jobs_JobStruct; use Jobs_JobDao; +use Jobs_JobStruct; use LQA\ChunkReviewDao; use ReflectionException; diff --git a/lib/Controller/API/V2/ChangePasswordController.php b/lib/Controller/API/V2/ChangePasswordController.php index 6404ff3dd8..de7e8ce3c2 100644 --- a/lib/Controller/API/V2/ChangePasswordController.php +++ b/lib/Controller/API/V2/ChangePasswordController.php @@ -4,11 +4,11 @@ use API\Commons\Validators\LoginValidator; use CatUtils; -use Jobs_JobStruct; use Database; use Exception; use Features\ReviewExtended\ReviewUtils; use Jobs_JobDao; +use Jobs_JobStruct; use LQA\ChunkReviewDao; use Projects_ProjectDao; use Projects_ProjectStruct; diff --git a/lib/Controller/API/V2/ChunkController.php b/lib/Controller/API/V2/ChunkController.php index de65173838..00c7cdc209 100644 --- a/lib/Controller/API/V2/ChunkController.php +++ b/lib/Controller/API/V2/ChunkController.php @@ -9,14 +9,14 @@ namespace API\V2; use API\Commons\Validators\ChunkPasswordValidator; -use API\Commons\Validators\ProjectAccessValidator; use API\Commons\Validators\LoginValidator; +use API\Commons\Validators\ProjectAccessValidator; use API\V2\Json\Chunk; -use Jobs_JobStruct; use Constants_JobStatus; use Exception; use Exceptions\NotFoundException; use Jobs_JobDao; +use Jobs_JobStruct; use Projects_ProjectStruct; use Translations_SegmentTranslationDao; use Utils; diff --git a/lib/Controller/API/V2/ChunkTranslationVersionController.php b/lib/Controller/API/V2/ChunkTranslationVersionController.php index 986544c95e..b6e5d4452d 100644 --- a/lib/Controller/API/V2/ChunkTranslationVersionController.php +++ b/lib/Controller/API/V2/ChunkTranslationVersionController.php @@ -11,8 +11,8 @@ use API\Commons\Validators\ChunkPasswordValidator; use API\Commons\Validators\LoginValidator; use API\V2\Json\SegmentVersion as JsonFormatter; -use Jobs_JobStruct; use Features\TranslationVersions\Model\TranslationVersionDao; +use Jobs_JobStruct; class ChunkTranslationVersionController extends BaseChunkController { diff --git a/lib/Controller/API/V2/CommentsController.php b/lib/Controller/API/V2/CommentsController.php index 5c27424ff3..0dfdd9b451 100644 --- a/lib/Controller/API/V2/CommentsController.php +++ b/lib/Controller/API/V2/CommentsController.php @@ -11,9 +11,9 @@ use API\Commons\Validators\ChunkPasswordValidator; use API\Commons\Validators\LoginValidator; -use Jobs_JobStruct; use Comments_CommentDao; use Exception; +use Jobs_JobStruct; class CommentsController extends BaseChunkController { diff --git a/lib/Controller/API/V2/JobMergeController.php b/lib/Controller/API/V2/JobMergeController.php index 9334d41edd..2348ddf827 100644 --- a/lib/Controller/API/V2/JobMergeController.php +++ b/lib/Controller/API/V2/JobMergeController.php @@ -9,8 +9,8 @@ namespace API\V2; use API\Commons\Exceptions\NotFoundException; use API\Commons\KleinController; -use API\Commons\Validators\ProjectPasswordValidator; use API\Commons\Validators\LoginValidator; +use API\Commons\Validators\ProjectPasswordValidator; use Jobs_JobStruct; use ProjectManager; diff --git a/lib/Controller/API/V2/JobSplitController.php b/lib/Controller/API/V2/JobSplitController.php index c8877d7fbb..f84d428bc0 100644 --- a/lib/Controller/API/V2/JobSplitController.php +++ b/lib/Controller/API/V2/JobSplitController.php @@ -11,8 +11,8 @@ use API\Commons\Exceptions\NotFoundException; use API\Commons\Exceptions\UnprocessableException; use API\Commons\KleinController; -use API\Commons\Validators\ProjectPasswordValidator; use API\Commons\Validators\LoginValidator; +use API\Commons\Validators\ProjectPasswordValidator; use Exception; use Jobs_JobStruct; use ProjectManager; diff --git a/lib/Controller/API/V2/ProjectCompletionStatus.php b/lib/Controller/API/V2/ProjectCompletionStatus.php index fe4943f6a7..4a6df82849 100644 --- a/lib/Controller/API/V2/ProjectCompletionStatus.php +++ b/lib/Controller/API/V2/ProjectCompletionStatus.php @@ -5,7 +5,6 @@ use API\Commons\KleinController; use API\Commons\Validators\ProjectPasswordValidator; use API\Commons\Validators\ProjectValidator; -use API\Commons\Validators\LoginValidator; use Features\ProjectCompletion\Model\ProjectCompletionStatusModel; use Projects_ProjectStruct; diff --git a/lib/Controller/API/V2/ProjectsController.php b/lib/Controller/API/V2/ProjectsController.php index 2e01980dc5..c3e9f7c9d5 100644 --- a/lib/Controller/API/V2/ProjectsController.php +++ b/lib/Controller/API/V2/ProjectsController.php @@ -3,9 +3,9 @@ namespace API\V2; use API\Commons\KleinController; +use API\Commons\Validators\LoginValidator; use API\Commons\Validators\ProjectAccessValidator; use API\Commons\Validators\ProjectPasswordValidator; -use API\Commons\Validators\LoginValidator; use API\V2\Json\Project; use API\V2\Json\ProjectAnonymous; use Constants_JobStatus; diff --git a/lib/Controller/API/V2/ReviseTranslationIssuesController.php b/lib/Controller/API/V2/ReviseTranslationIssuesController.php index a936fe6924..e83bfec406 100644 --- a/lib/Controller/API/V2/ReviseTranslationIssuesController.php +++ b/lib/Controller/API/V2/ReviseTranslationIssuesController.php @@ -10,8 +10,8 @@ use API\Commons\Validators\JobPasswordValidator; -use API\Commons\Validators\SegmentTranslation; use API\Commons\Validators\LoginValidator; +use API\Commons\Validators\SegmentTranslation; use API\V2\Json\SegmentVersion; use Chunks_ChunkDao; use Features\TranslationVersions\Model\TranslationVersionDao; diff --git a/lib/Controller/API/V2/SegmentVersion.php b/lib/Controller/API/V2/SegmentVersion.php index 2eace2b885..103f344842 100644 --- a/lib/Controller/API/V2/SegmentVersion.php +++ b/lib/Controller/API/V2/SegmentVersion.php @@ -3,8 +3,8 @@ namespace API\V2; use API\Commons\Validators\JobPasswordValidator; -use API\Commons\Validators\SegmentValidator; use API\Commons\Validators\LoginValidator; +use API\Commons\Validators\SegmentValidator; use API\V2\Json\SegmentVersion as JsonFormatter; use Features\TranslationVersions\Model\TranslationVersionDao; diff --git a/lib/Controller/API/V2/TeamMembersController.php b/lib/Controller/API/V2/TeamMembersController.php index 05c194585b..052f3efe52 100644 --- a/lib/Controller/API/V2/TeamMembersController.php +++ b/lib/Controller/API/V2/TeamMembersController.php @@ -9,12 +9,10 @@ namespace API\V2; -use API\Commons\Authentication\AuthenticationHelper; use API\Commons\KleinController; use API\Commons\Validators\LoginValidator; use API\Commons\Validators\TeamAccessValidator; use API\V2\Json\Membership; -use Bootstrap; use Exception; use ReflectionException; use TeamModel; diff --git a/lib/Controller/API/V2/TeamsController.php b/lib/Controller/API/V2/TeamsController.php index 0298ef90fc..41adaa521e 100644 --- a/lib/Controller/API/V2/TeamsController.php +++ b/lib/Controller/API/V2/TeamsController.php @@ -10,14 +10,12 @@ namespace API\V2; -use API\Commons\Authentication\AuthenticationHelper; use API\Commons\Error; use API\Commons\Exceptions\AuthorizationError; use API\Commons\KleinController; use API\Commons\Validators\LoginValidator; use API\Commons\Validators\TeamAccessValidator; use API\V2\Json\Team; -use Bootstrap; use Exception; use InvalidArgumentException; use ReflectionException; diff --git a/lib/Controller/API/V2/TeamsProjectsController.php b/lib/Controller/API/V2/TeamsProjectsController.php index fc6b612ce5..4aa31bcdc3 100644 --- a/lib/Controller/API/V2/TeamsProjectsController.php +++ b/lib/Controller/API/V2/TeamsProjectsController.php @@ -9,7 +9,6 @@ namespace API\V2; -use API\Commons\Authentication\AuthenticationHelper; use API\Commons\Exceptions\AuthorizationError; use API\Commons\Exceptions\NotFoundException; use API\Commons\KleinController; @@ -18,7 +17,6 @@ use API\Commons\Validators\TeamAccessValidator; use API\Commons\Validators\TeamProjectValidator; use API\V2\Json\Project; -use Bootstrap; use Exception; use Exceptions\ValidationError; use ManageUtils; diff --git a/lib/Controller/API/V2/UrlsController.php b/lib/Controller/API/V2/UrlsController.php index e761f78d16..3d047a12cc 100644 --- a/lib/Controller/API/V2/UrlsController.php +++ b/lib/Controller/API/V2/UrlsController.php @@ -9,8 +9,8 @@ namespace API\V2; use API\Commons\KleinController; -use API\Commons\Validators\ProjectPasswordValidator; use API\Commons\Validators\LoginValidator; +use API\Commons\Validators\ProjectPasswordValidator; use API\V2\Json\ProjectUrls; use DataAccess\ShapelessConcreteStruct; diff --git a/lib/Controller/API/V3/ChunkController.php b/lib/Controller/API/V3/ChunkController.php index 1de5aad0dd..6eb3f3f9b2 100644 --- a/lib/Controller/API/V3/ChunkController.php +++ b/lib/Controller/API/V3/ChunkController.php @@ -12,9 +12,9 @@ use API\Commons\Validators\LoginValidator; use API\V2\BaseChunkController; use API\V3\Json\Chunk; -use Jobs_JobStruct; use Exception; use Exceptions\NotFoundException; +use Jobs_JobStruct; use Projects_ProjectStruct; class ChunkController extends BaseChunkController { diff --git a/lib/Controller/API/V3/CountWordController.php b/lib/Controller/API/V3/CountWordController.php index 3ec64ed8f0..429cb97e81 100644 --- a/lib/Controller/API/V3/CountWordController.php +++ b/lib/Controller/API/V3/CountWordController.php @@ -9,8 +9,8 @@ namespace API\V3; use API\Commons\Exceptions\ValidationError; -use API\Commons\Validators\LoginValidator; use API\Commons\KleinController; +use API\Commons\Validators\LoginValidator; use CatUtils; use Langs\Languages; use LQA\SizeRestriction\SizeRestriction; diff --git a/lib/Controller/API/V3/FileInfoController.php b/lib/Controller/API/V3/FileInfoController.php index d94ae6e5cf..7f290850d4 100644 --- a/lib/Controller/API/V3/FileInfoController.php +++ b/lib/Controller/API/V3/FileInfoController.php @@ -13,9 +13,9 @@ use API\Commons\Validators\ChunkPasswordValidator; use API\Commons\Validators\LoginValidator; use API\V2\BaseChunkController; -use Jobs_JobStruct; use Exceptions\ValidationError; use Files\FilesInfoUtility; +use Jobs_JobStruct; use Projects_ProjectStruct; use TaskRunner\Exceptions\EndQueueException; use TaskRunner\Exceptions\ReQueueException; diff --git a/lib/Controller/API/V3/PayableRateController.php b/lib/Controller/API/V3/PayableRateController.php index e096556725..28d8dee6b9 100644 --- a/lib/Controller/API/V3/PayableRateController.php +++ b/lib/Controller/API/V3/PayableRateController.php @@ -9,7 +9,6 @@ use Klein\Response; use PayableRates\CustomPayableRateDao; use PayableRates\CustomPayableRateStruct; -use ReflectionException; use Swaggest\JsonSchema\InvalidValue; use Validator\Errors\JSONValidatorException; use Validator\Errors\JsonValidatorGenericException; diff --git a/lib/Controller/API/V3/SegmentAnalysisController.php b/lib/Controller/API/V3/SegmentAnalysisController.php index 553c5a8aa2..6ca0b09b73 100644 --- a/lib/Controller/API/V3/SegmentAnalysisController.php +++ b/lib/Controller/API/V3/SegmentAnalysisController.php @@ -8,16 +8,12 @@ use CatUtils; use Chunks_ChunkDao; use DataAccess_IDaoStruct; -use Database; use Exception; use Exceptions\NotFoundException; use Features\ReviewExtended\ReviewUtils; use Jobs_JobDao; use Jobs_JobStruct; use LQA\EntryDao; -use Pagination\Pager; -use Pagination\PaginationParameters; -use Projects\ProjectTemplateStruct; use Projects_ProjectDao; use Projects_ProjectStruct; use ReflectionException; diff --git a/lib/Controller/API/V3/StatusController.php b/lib/Controller/API/V3/StatusController.php index 27b7294504..5ae5c5c4dd 100644 --- a/lib/Controller/API/V3/StatusController.php +++ b/lib/Controller/API/V3/StatusController.php @@ -3,13 +3,10 @@ namespace API\V3; use API\App\Json\Analysis\AnalysisProject; -use API\Commons\Exceptions\AuthenticationError; use API\Commons\Exceptions\NotFoundException; use API\Commons\KleinController; use API\Commons\Validators\LoginValidator; use API\Commons\Validators\ProjectPasswordValidator; -use Constants_JobStatus; -use Exceptions\ValidationError; use Model\Analysis\Status; use Projects_ProjectDao; diff --git a/lib/Model/Comments/CommentDao.php b/lib/Model/Comments/CommentDao.php index 82d1350222..8f83028acc 100644 --- a/lib/Model/Comments/CommentDao.php +++ b/lib/Model/Comments/CommentDao.php @@ -1,7 +1,6 @@ Details)', 'TM', 'Machine translation by the MT engine best suited to your project', 'https://api.mymemory.translated.net', 'get', 'set', 'update', 'delete_by_id', '{"analyze_url":"analyze","api_key_check_auth_url":"authkey","api_key_create_user_url":"createranduser","detect_language_url":"langdetect.php","glossary_check_relative_url":"v2/glossary/check","glossary_delete_relative_url":"v2/glossary/delete","glossary_domains_relative_url":"v2/glossary/domains","glossary_entry_status_relative_url":"v2/entry/status","glossary_export_relative_url":"v2/glossary/export","glossary_get_relative_url":"v2/glossary/get","glossary_import_relative_url":"v2/glossary/import","glossary_import_status_relative_url":"v2/import/status","glossary_keys_relative_url":"v2/glossary/keys","glossary_set_relative_url":"v2/glossary/set","glossary_update_relative_url":"v2/glossary/update","tmx_export_email_url":"tmx/export/create","tmx_import_relative_url":"tmx/import","tmx_status_relative_url":"v2/import/status","tags_projection":"tags-projection"}', +VALUES (11, 'ModernMT Lite', 'TM', 'Smart machine translation that learns from your corrections for enhanced quality and productivity thanks to ModernMT’s basic features. To unlock all features, click here.', 'https://api.mymemory.translated.net', 'get', 'set', 'update', 'delete_by_id', '{"analyze_url":"analyze","api_key_check_auth_url":"authkey","api_key_create_user_url":"createranduser","detect_language_url":"langdetect.php","glossary_check_relative_url":"v2/glossary/check","glossary_delete_relative_url":"v2/glossary/delete","glossary_domains_relative_url":"v2/glossary/domains","glossary_entry_status_relative_url":"v2/entry/status","glossary_export_relative_url":"v2/glossary/export","glossary_get_relative_url":"v2/glossary/get","glossary_import_relative_url":"v2/glossary/import","glossary_import_status_relative_url":"v2/import/status","glossary_keys_relative_url":"v2/glossary/keys","glossary_set_relative_url":"v2/glossary/set","glossary_update_relative_url":"v2/glossary/update","tmx_export_email_url":"tmx/export/create","tmx_import_relative_url":"tmx/import","tmx_status_relative_url":"v2/import/status","tags_projection":"tags-projection"}', 'MyMemory', '', '1', 0, 1, null); UPDATE engines @@ -1500,18 +1577,10 @@ UPDATE engines SET id = 1 WHERE id = 11; - -- populate sequences INSERT INTO sequences (id_segment, id_project) VALUES (IFNULL((SELECT MAX(id) + 1 FROM segments), 1), IFNULL((SELECT MAX(id) + 1 FROM projects), 1)); -#Create the user 'matecat'@'%' IF NOT EXISTS --- CREATE USER 'matecat'@'%' IDENTIFIED BY 'matecat01'; - -# Grants for 'matecat'@'%' -GRANT SELECT, INSERT, UPDATE, DELETE, EXECUTE, SHOW VIEW ON `matecat`.* TO 'matecat'@'%' IDENTIFIED BY 'matecat01'; - - CREATE SCHEMA IF NOT EXISTS `matecat_conversions_log` DEFAULT CHARACTER SET utf8mb4; USE matecat_conversions_log; CREATE TABLE IF NOT EXISTS conversions_log @@ -1553,12 +1622,6 @@ CREATE TABLE IF NOT EXISTS conversions_log ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4; -#Create the user 'matecat'@'%' ( even if already created ) -# Grants for 'matecat'@'%' -GRANT SELECT, INSERT, UPDATE, DELETE, EXECUTE, SHOW VIEW ON `matecat_conversions_log`.* TO 'matecat'@'%' IDENTIFIED BY 'matecat01'; - -GRANT DROP ON `matecat`.`jobs_stats` TO 'PEEWorker'@'%' IDENTIFIED BY 'matecat02'; - USE `matecat`; -- MySQL dump 10.13 Distrib 8.0.28, for Linux (x86_64) diff --git a/lib/Plugins/Features/Mmt.php b/lib/Plugins/Features/Mmt.php index c5282e7675..1863d0b00d 100644 --- a/lib/Plugins/Features/Mmt.php +++ b/lib/Plugins/Features/Mmt.php @@ -31,7 +31,6 @@ use FilesStorage\AbstractFilesStorage; use INIT; use Jobs_JobStruct; -use Klein\Klein; use Log; use NewController; use Projects_MetadataDao; diff --git a/lib/Plugins/Features/ProjectCompletion/Controller/CompletionEventController.php b/lib/Plugins/Features/ProjectCompletion/Controller/CompletionEventController.php index cdce417022..ba65542e94 100644 --- a/lib/Plugins/Features/ProjectCompletion/Controller/CompletionEventController.php +++ b/lib/Plugins/Features/ProjectCompletion/Controller/CompletionEventController.php @@ -13,9 +13,9 @@ use API\Commons\Validators\ChunkPasswordValidator; use Chunks_ChunkCompletionEventDao; use Chunks_ChunkCompletionEventStruct; -use Jobs_JobStruct; use Database; use Exception; +use Jobs_JobStruct; class CompletionEventController extends KleinController { diff --git a/lib/Plugins/Features/ProjectCompletion/Model/EventModel.php b/lib/Plugins/Features/ProjectCompletion/Model/EventModel.php index 3d7c4b62da..ffe780fbc9 100644 --- a/lib/Plugins/Features/ProjectCompletion/Model/EventModel.php +++ b/lib/Plugins/Features/ProjectCompletion/Model/EventModel.php @@ -9,10 +9,10 @@ namespace Features\ProjectCompletion\Model ; use Chunks_ChunkCompletionEventDao; -use Jobs_JobStruct; use Exception; use Features\ProjectCompletion\CompletionEventStruct; use FeatureSet; +use Jobs_JobStruct; use Projects_ProjectDao; diff --git a/lib/Plugins/Features/ProjectCompletion/Model/ProjectCompletionStatusModel.php b/lib/Plugins/Features/ProjectCompletion/Model/ProjectCompletionStatusModel.php index 93bca08737..b7292b22f2 100644 --- a/lib/Plugins/Features/ProjectCompletion/Model/ProjectCompletionStatusModel.php +++ b/lib/Plugins/Features/ProjectCompletion/Model/ProjectCompletionStatusModel.php @@ -11,11 +11,11 @@ use API\Commons\Exceptions\AuthenticationError; use Chunks_ChunkCompletionEventDao; -use Jobs_JobStruct; use Exception; use Exceptions\NotFoundException; use Exceptions\ValidationError; use FeatureSet; +use Jobs_JobStruct; use Projects_ProjectStruct; use TaskRunner\Exceptions\EndQueueException; use TaskRunner\Exceptions\ReQueueException; diff --git a/lib/Plugins/Features/ReviewExtended/BatchReviewProcessor.php b/lib/Plugins/Features/ReviewExtended/BatchReviewProcessor.php index 710eec5be4..5bb98c0fc2 100644 --- a/lib/Plugins/Features/ReviewExtended/BatchReviewProcessor.php +++ b/lib/Plugins/Features/ReviewExtended/BatchReviewProcessor.php @@ -8,10 +8,10 @@ namespace Features\ReviewExtended; -use Jobs_JobStruct; use Exception; use Features\ReviewExtended\Email\BatchReviewProcessorAlertEmail; use Features\TranslationEvents\Model\TranslationEvent; +use Jobs_JobStruct; use Log; use LQA\ChunkReviewDao; use Projects_ProjectStruct; diff --git a/lib/Plugins/Features/ReviewExtended/ChunkReviewModel.php b/lib/Plugins/Features/ReviewExtended/ChunkReviewModel.php index bd7c161eaf..ccfda33c83 100644 --- a/lib/Plugins/Features/ReviewExtended/ChunkReviewModel.php +++ b/lib/Plugins/Features/ReviewExtended/ChunkReviewModel.php @@ -9,8 +9,8 @@ namespace Features\ReviewExtended; -use Jobs_JobStruct; use Exception; +use Jobs_JobStruct; use LQA\ChunkReviewDao; use LQA\ChunkReviewStruct; use LQA\ModelStruct; diff --git a/lib/Plugins/Features/ReviewExtended/Controller/API/Json/ProjectUrls.php b/lib/Plugins/Features/ReviewExtended/Controller/API/Json/ProjectUrls.php index 057575cd53..aca3237f4d 100644 --- a/lib/Plugins/Features/ReviewExtended/Controller/API/Json/ProjectUrls.php +++ b/lib/Plugins/Features/ReviewExtended/Controller/API/Json/ProjectUrls.php @@ -8,8 +8,8 @@ namespace Features\ReviewExtended\Controller\API\Json; -use Jobs_JobStruct; use Features\ReviewExtended\ReviewUtils; +use Jobs_JobStruct; use LQA\ChunkReviewDao; use Routes; diff --git a/lib/Plugins/Features/ReviewExtended/Controller/API/QualityReportController.php b/lib/Plugins/Features/ReviewExtended/Controller/API/QualityReportController.php index 6882d59d49..a40b230b03 100644 --- a/lib/Plugins/Features/ReviewExtended/Controller/API/QualityReportController.php +++ b/lib/Plugins/Features/ReviewExtended/Controller/API/QualityReportController.php @@ -10,13 +10,13 @@ use API\Commons\Validators\ChunkPasswordValidator; use API\V2\BaseChunkController; -use Jobs_JobStruct; use Exception; use Features\ReviewExtended\Model\QualityReportModel; use Features\ReviewExtended\ReviewUtils; use Features\TranslationEvents\Model\TranslationEventDao; use Files\FilesInfoUtility; use INIT; +use Jobs_JobStruct; use Projects_ProjectStruct; use QualityReport\QualityReportSegmentModel; diff --git a/lib/Plugins/Features/ReviewExtended/Model/QualityReportModel.php b/lib/Plugins/Features/ReviewExtended/Model/QualityReportModel.php index 3f23f8b2d8..0f74724095 100644 --- a/lib/Plugins/Features/ReviewExtended/Model/QualityReportModel.php +++ b/lib/Plugins/Features/ReviewExtended/Model/QualityReportModel.php @@ -10,11 +10,11 @@ use ArrayObject; use Chunks_ChunkCompletionEventDao; -use Jobs_JobStruct; use Database; use Exception; use Features\ReviewExtended\IChunkReviewModel; use Features\ReviewExtended\ReviewUtils; +use Jobs_JobStruct; use LQA\ChunkReviewDao; use Revise\FeedbackDAO; use RevisionFactory; diff --git a/lib/Plugins/Features/ReviewExtended/ReviewUtils.php b/lib/Plugins/Features/ReviewExtended/ReviewUtils.php index f5f36a000f..6b5b932c38 100644 --- a/lib/Plugins/Features/ReviewExtended/ReviewUtils.php +++ b/lib/Plugins/Features/ReviewExtended/ReviewUtils.php @@ -8,10 +8,10 @@ namespace Features\ReviewExtended; -use Jobs_JobStruct; use Constants; use Constants_TranslationStatus; use Exception; +use Jobs_JobStruct; use LQA\ChunkReviewDao; use LQA\ModelStruct; diff --git a/lib/Plugins/Features/ReviewExtended/ReviewedWordCountModel.php b/lib/Plugins/Features/ReviewExtended/ReviewedWordCountModel.php index 0adababf2d..4169118511 100644 --- a/lib/Plugins/Features/ReviewExtended/ReviewedWordCountModel.php +++ b/lib/Plugins/Features/ReviewExtended/ReviewedWordCountModel.php @@ -8,12 +8,12 @@ namespace Features\ReviewExtended; -use Jobs_JobStruct; use Exception; use Features\ReviewExtended\Email\RevisionChangedNotificationEmail; use Features\TranslationEvents\Model\TranslationEvent; use Features\TranslationEvents\Model\TranslationEventDao; use Features\TranslationEvents\Model\TranslationEventStruct; +use Jobs_JobStruct; use LQA\ChunkReviewStruct; use LQA\EntryCommentStruct; use LQA\EntryDao; diff --git a/lib/Plugins/Features/ReviewExtended/TranslationIssueModel.php b/lib/Plugins/Features/ReviewExtended/TranslationIssueModel.php index 864c8348e1..03376167eb 100644 --- a/lib/Plugins/Features/ReviewExtended/TranslationIssueModel.php +++ b/lib/Plugins/Features/ReviewExtended/TranslationIssueModel.php @@ -8,12 +8,12 @@ namespace Features\ReviewExtended; -use Jobs_JobStruct; use Exception; use Exceptions\ValidationError; use Features\TranslationEvents\Model\TranslationEventDao; use Features\TranslationVersions\Model\TranslationVersionDao; use Features\TranslationVersions\Model\TranslationVersionStruct; +use Jobs_JobStruct; use LQA\ChunkReviewDao; use LQA\ChunkReviewStruct; use LQA\EntryDao; diff --git a/lib/Plugins/Features/SegmentFilter/Controller/API/FilterController.php b/lib/Plugins/Features/SegmentFilter/Controller/API/FilterController.php index 5340b54249..751bbd3134 100644 --- a/lib/Plugins/Features/SegmentFilter/Controller/API/FilterController.php +++ b/lib/Plugins/Features/SegmentFilter/Controller/API/FilterController.php @@ -6,10 +6,10 @@ use API\Commons\Exceptions\ValidationError; use API\Commons\Validators\ChunkPasswordValidator; use API\V2\BaseChunkController; -use Jobs_JobStruct; use Exception; use Features\SegmentFilter\Model\FilterDefinition; use Features\SegmentFilter\Model\SegmentFilterModel; +use Jobs_JobStruct; class FilterController extends BaseChunkController { diff --git a/lib/Plugins/Features/SegmentFilter/Model/SegmentFilterDao.php b/lib/Plugins/Features/SegmentFilter/Model/SegmentFilterDao.php index 37fb1cf461..7d4650fc1e 100644 --- a/lib/Plugins/Features/SegmentFilter/Model/SegmentFilterDao.php +++ b/lib/Plugins/Features/SegmentFilter/Model/SegmentFilterDao.php @@ -8,7 +8,6 @@ namespace Features\SegmentFilter\Model; -use Jobs_JobStruct; use Constants_SegmentTranslationsMatchType; use Constants_TranslationStatus; use DataAccess\ShapelessConcreteStruct; @@ -16,6 +15,7 @@ use DataAccess_IDaoStruct; use Database; use Exception; +use Jobs_JobStruct; class SegmentFilterDao extends DataAccess_AbstractDao { diff --git a/lib/Plugins/Features/SegmentFilter/Model/SegmentFilterModel.php b/lib/Plugins/Features/SegmentFilter/Model/SegmentFilterModel.php index e58dbde780..a12463edb0 100644 --- a/lib/Plugins/Features/SegmentFilter/Model/SegmentFilterModel.php +++ b/lib/Plugins/Features/SegmentFilter/Model/SegmentFilterModel.php @@ -8,8 +8,8 @@ namespace Features\SegmentFilter\Model; -use Jobs_JobStruct; use Exception; +use Jobs_JobStruct; use Translations_SegmentTranslationStruct; class SegmentFilterModel { diff --git a/lib/Plugins/Features/TranslationEvents/Model/TranslationEvent.php b/lib/Plugins/Features/TranslationEvents/Model/TranslationEvent.php index a4c2cd4bb1..13c25d38ae 100644 --- a/lib/Plugins/Features/TranslationEvents/Model/TranslationEvent.php +++ b/lib/Plugins/Features/TranslationEvents/Model/TranslationEvent.php @@ -2,17 +2,16 @@ namespace Features\TranslationEvents\Model; -use Jobs_JobStruct; use Constants; use Constants_TranslationStatus; use Database; use Exception; +use Jobs_JobStruct; use LQA\ChunkReviewStruct; use LQA\EntryWithCategoryStruct; use Segments_SegmentDao; use Segments_SegmentStruct; use Translations_SegmentTranslationStruct; -use Users_UserDao; use Users_UserStruct; class TranslationEvent { diff --git a/lib/Plugins/Features/TranslationEvents/TranslationEventsHandler.php b/lib/Plugins/Features/TranslationEvents/TranslationEventsHandler.php index ef1aab4ee4..bd22171bd5 100644 --- a/lib/Plugins/Features/TranslationEvents/TranslationEventsHandler.php +++ b/lib/Plugins/Features/TranslationEvents/TranslationEventsHandler.php @@ -8,16 +8,16 @@ namespace Features\TranslationEvents; -use Jobs_JobStruct; use Constants; use Constants_TranslationStatus; use Exception; use Exceptions\ValidationError; use Features\ReviewExtended\BatchReviewProcessor; -use Features\TranslationEvents\Model\TranslationEventDao; use Features\TranslationEvents\Model\TranslationEvent; +use Features\TranslationEvents\Model\TranslationEventDao; use Features\TranslationEvents\Model\TranslationEventStruct; use FeatureSet; +use Jobs_JobStruct; use Projects_ProjectStruct; use TransactionalTrait; diff --git a/lib/Plugins/Features/TranslationVersions.php b/lib/Plugins/Features/TranslationVersions.php index ade46f124c..30518a6956 100644 --- a/lib/Plugins/Features/TranslationVersions.php +++ b/lib/Plugins/Features/TranslationVersions.php @@ -2,9 +2,9 @@ namespace Features; -use Jobs_JobStruct; use Features\TranslationVersions\Handlers\DummyTranslationVersionHandler; use Features\TranslationVersions\Handlers\TranslationVersionsHandler; +use Jobs_JobStruct; use Projects_ProjectStruct; use Users_UserStruct; diff --git a/lib/Plugins/Features/TranslationVersions/Handlers/TranslationVersionsHandler.php b/lib/Plugins/Features/TranslationVersions/Handlers/TranslationVersionsHandler.php index 3da9ea6ee0..59523f6b90 100644 --- a/lib/Plugins/Features/TranslationVersions/Handlers/TranslationVersionsHandler.php +++ b/lib/Plugins/Features/TranslationVersions/Handlers/TranslationVersionsHandler.php @@ -2,7 +2,6 @@ namespace Features\TranslationVersions\Handlers; -use Jobs_JobStruct; use Constants_TranslationStatus; use Exception; use Exceptions\ControllerReturnException; @@ -14,6 +13,7 @@ use Features\TranslationVersions\VersionHandlerInterface; use FeatureSet; use Jobs_JobDao; +use Jobs_JobStruct; use Projects_ProjectDao; use Projects_ProjectStruct; use Translations_SegmentTranslationStruct; diff --git a/lib/Plugins/Features/TranslationVersions/Model/TranslationVersionDao.php b/lib/Plugins/Features/TranslationVersions/Model/TranslationVersionDao.php index bab0d73d31..e90414335f 100644 --- a/lib/Plugins/Features/TranslationVersions/Model/TranslationVersionDao.php +++ b/lib/Plugins/Features/TranslationVersions/Model/TranslationVersionDao.php @@ -2,12 +2,12 @@ namespace Features\TranslationVersions\Model; -use Jobs_JobStruct; use Constants; use DataAccess\ShapelessConcreteStruct; use DataAccess_AbstractDao; use DataAccess_IDaoStruct; use Database; +use Jobs_JobStruct; use PDO; use QualityReport\SegmentEventsStruct; use Translations_SegmentTranslationStruct; diff --git a/lib/Utils/ActivityLog/Activity.php b/lib/Utils/ActivityLog/Activity.php index ff632ecd31..538e015f91 100644 --- a/lib/Utils/ActivityLog/Activity.php +++ b/lib/Utils/ActivityLog/Activity.php @@ -4,7 +4,6 @@ use Exception; use Log; -use Utils; use WorkerClient; /** diff --git a/lib/Utils/AsyncTasks/Workers/BulkSegmentStatusChangeWorker.php b/lib/Utils/AsyncTasks/Workers/BulkSegmentStatusChangeWorker.php index 859f7663ae..a83e817a89 100644 --- a/lib/Utils/AsyncTasks/Workers/BulkSegmentStatusChangeWorker.php +++ b/lib/Utils/AsyncTasks/Workers/BulkSegmentStatusChangeWorker.php @@ -9,7 +9,6 @@ namespace AsyncTasks\Workers; -use Jobs_JobStruct; use Database; use Exception; use Features; @@ -17,6 +16,7 @@ use Features\ReviewExtended\ReviewUtils; use Features\TranslationEvents\Model\TranslationEvent; use Features\TranslationEvents\TranslationEventsHandler; +use Jobs_JobStruct; use ReflectionException; use TaskRunner\Commons\AbstractElement; use TaskRunner\Commons\AbstractWorker; diff --git a/lib/Utils/ConnectedServices/Microsoft/MicrosoftProvider.php b/lib/Utils/ConnectedServices/Microsoft/MicrosoftProvider.php index e361e796bf..8cd55bc0ff 100644 --- a/lib/Utils/ConnectedServices/Microsoft/MicrosoftProvider.php +++ b/lib/Utils/ConnectedServices/Microsoft/MicrosoftProvider.php @@ -4,7 +4,6 @@ use ConnectedServices\AbstractProvider; use ConnectedServices\ConnectedServiceUserModel; -use Exception; use INIT; use League\OAuth2\Client\Provider\Exception\IdentityProviderException; use League\OAuth2\Client\Token\AccessToken; diff --git a/lib/Utils/Contribution/ContributionRequestStruct.php b/lib/Utils/Contribution/ContributionRequestStruct.php index 778856c929..4f7218dd4a 100644 --- a/lib/Utils/Contribution/ContributionRequestStruct.php +++ b/lib/Utils/Contribution/ContributionRequestStruct.php @@ -10,9 +10,9 @@ namespace Contribution; -use Jobs_JobStruct; use DataAccess\ShapelessConcreteStruct; use DataAccess_IDaoStruct; +use Jobs_JobStruct; use Projects_ProjectStruct; class ContributionRequestStruct extends ShapelessConcreteStruct implements DataAccess_IDaoStruct { diff --git a/lib/Utils/Email/AbstractEmail.php b/lib/Utils/Email/AbstractEmail.php index 80ab1cdbde..6871446916 100644 --- a/lib/Utils/Email/AbstractEmail.php +++ b/lib/Utils/Email/AbstractEmail.php @@ -8,7 +8,6 @@ namespace Email; -use AMQHandler; use Exception; use INIT; use Log; diff --git a/lib/Utils/Engines/Traits/HotSwap.php b/lib/Utils/Engines/Traits/HotSwap.php index 9cde036aa3..5efafae106 100644 --- a/lib/Utils/Engines/Traits/HotSwap.php +++ b/lib/Utils/Engines/Traits/HotSwap.php @@ -13,7 +13,6 @@ use Exception; use Jobs_JobDao; use Jobs_JobStruct; -use Predis\Connection\ConnectionException; use RedisHandler; use ReflectionException; diff --git a/lib/Utils/LQA/QA.php b/lib/Utils/LQA/QA.php index f9f0a4662b..7907dd510d 100644 --- a/lib/Utils/LQA/QA.php +++ b/lib/Utils/LQA/QA.php @@ -2,9 +2,7 @@ namespace LQA; -use API\Commons\Exceptions\AuthenticationError; use CatUtils; -use Jobs_JobStruct; use DOMDocument; use DOMElement; use DOMException; @@ -12,16 +10,12 @@ use DOMNodeList; use DOMXPath; use Exception; -use Exceptions\NotFoundException; -use Exceptions\ValidationError; use FeatureSet; +use Jobs_JobStruct; use Log; use LogicException; use LQA\BxExG\Validator; -use Projects_MetadataDao; use Segments_SegmentMetadataDao; -use TaskRunner\Exceptions\EndQueueException; -use TaskRunner\Exceptions\ReQueueException; /** * Class errObject diff --git a/lib/Utils/ManageUtils.php b/lib/Utils/ManageUtils.php index 5ea64ccd3b..d7d1495420 100644 --- a/lib/Utils/ManageUtils.php +++ b/lib/Utils/ManageUtils.php @@ -40,7 +40,7 @@ protected static function _getProjects( $no_assignee = false ) { - list( $conditions, $data ) = static::conditionsForProjectsQuery( + [ $conditions, $data ] = static::conditionsForProjectsQuery( $search_in_pname, $search_source, $search_target, @@ -214,7 +214,7 @@ public static function getProjectsNumber( Users_UserStruct $user, $search_in_pn $no_assignee = false ) { - list( $conditions, $data ) = static::conditionsForProjectsQuery( + [ $conditions, $data ] = static::conditionsForProjectsQuery( $search_in_pname, $search_source, $search_target, $search_status, $search_only_completed ); diff --git a/lib/Utils/PostProcess.php b/lib/Utils/PostProcess.php index 8c41c30647..3ffd41d9a6 100644 --- a/lib/Utils/PostProcess.php +++ b/lib/Utils/PostProcess.php @@ -12,7 +12,7 @@ class PostProcess extends QA { public function realignMTSpaces() { try { - list( $srcNodeList, $trgNodeList ) = $this->_prepareDOMStructures(); + [ $srcNodeList, $trgNodeList ] = $this->_prepareDOMStructures(); } catch ( DOMException $ex ) { return $this->getErrors(); } @@ -24,7 +24,7 @@ public function realignMTSpaces() { return; //fail } - list ( $source_seg, $target_seg ) = $this->_realignTMSpaces(); + [ $source_seg, $target_seg ] = $this->_realignTMSpaces(); //- re-import in the dom target after regular expression //- perform check again ( recursive over the entire class ) diff --git a/lib/Utils/ProjectQueue/Queue.php b/lib/Utils/ProjectQueue/Queue.php index f314b5fa68..cce8411646 100644 --- a/lib/Utils/ProjectQueue/Queue.php +++ b/lib/Utils/ProjectQueue/Queue.php @@ -9,7 +9,6 @@ namespace ProjectQueue; -use AMQHandler; use ArrayObject; use Constants_ProjectStatus; use Exception; diff --git a/lib/Utils/RecursiveArrayObject.php b/lib/Utils/RecursiveArrayObject.php index 9a41c08be5..63a8bcf4a5 100644 --- a/lib/Utils/RecursiveArrayObject.php +++ b/lib/Utils/RecursiveArrayObject.php @@ -1,7 +1,5 @@