From feccf7e3bd6edbd607075fd95318c6a8104836a2 Mon Sep 17 00:00:00 2001 From: decelsi Date: Wed, 18 May 2022 13:53:48 +0200 Subject: [PATCH 01/47] PHP 8.1 compatibility --- CHANGELOG.md | 2 +- composer.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9aa84b1..d7e8d7e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,4 +10,4 @@ ## [1.1.0] - 2022-05-18 ### Added -- PHP 8.0 compatibility +- PHP 8.1 compatibility diff --git a/composer.json b/composer.json index 584bc90..16a7ffd 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ } ], "require": { - "php": "^7.3 || ^8.0", + "php": "^7.3 || ^8.1", "magento/framework": "^102.0|^103.0", "magento/module-backend": "^101.0|^102.0", "magento/module-ui": "^101.1" From f0d6f60baa3e38a57b8d27144f122fc030239972 Mon Sep 17 00:00:00 2001 From: decelsi Date: Wed, 18 May 2022 14:14:51 +0200 Subject: [PATCH 02/47] PHP 8.1 compatibility --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 16a7ffd..8e1e8c9 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ } ], "require": { - "php": "^7.3 || ^8.1", + "php": "^7.3|^8.1", "magento/framework": "^102.0|^103.0", "magento/module-backend": "^101.0|^102.0", "magento/module-ui": "^101.1" From 50a7ef26c5e7ad41163319b1d2f97744f1f5aca0 Mon Sep 17 00:00:00 2001 From: decelsi Date: Wed, 18 May 2022 14:20:01 +0200 Subject: [PATCH 03/47] Updated module version --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 8e1e8c9..8eafaf5 100644 --- a/composer.json +++ b/composer.json @@ -13,14 +13,14 @@ "require": { "php": "^7.3|^8.1", "magento/framework": "^102.0|^103.0", - "magento/module-backend": "^101.0|^102.0", + "magento/module-backend": "^101.0|^102.0|^103.0", "magento/module-ui": "^101.1" }, "require-dev": { "friendsofphp/php-cs-fixer": "~2.14", - "magento/magento-coding-standard": "5", + "magento/magento-coding-standard": "*", "php-parallel-lint/php-parallel-lint": "^1.3", - "phpro/grumphp-shim": "~1.5.0", + "phpro/grumphp-shim": "^1.5", "phpunit/phpunit": "^8.5", "squizlabs/php_codesniffer": "~3.4" }, From 68f48ddd4eaa56ffdec91c3772ee204dc05e0514 Mon Sep 17 00:00:00 2001 From: decelsi Date: Wed, 18 May 2022 14:23:20 +0200 Subject: [PATCH 04/47] Updated module version --- composer.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 8eafaf5..f12625d 100644 --- a/composer.json +++ b/composer.json @@ -11,16 +11,16 @@ } ], "require": { - "php": "^7.3|^8.1", - "magento/framework": "^102.0|^103.0", - "magento/module-backend": "^101.0|^102.0|^103.0", + "php": "^7.3||^8.1", + "magento/framework": "^102.0||^103.0", + "magento/module-backend": "^101.0|^102.0", "magento/module-ui": "^101.1" }, "require-dev": { "friendsofphp/php-cs-fixer": "~2.14", - "magento/magento-coding-standard": "*", + "magento/magento-coding-standard": "5", "php-parallel-lint/php-parallel-lint": "^1.3", - "phpro/grumphp-shim": "^1.5", + "phpro/grumphp-shim": "~1.5.0", "phpunit/phpunit": "^8.5", "squizlabs/php_codesniffer": "~3.4" }, From 63ddc0b6d81e1f98e99e13da95ed3f5d8dc7c786 Mon Sep 17 00:00:00 2001 From: decelsi Date: Wed, 18 May 2022 14:32:54 +0200 Subject: [PATCH 05/47] Updated module version --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index f12625d..8e1e8c9 100644 --- a/composer.json +++ b/composer.json @@ -11,8 +11,8 @@ } ], "require": { - "php": "^7.3||^8.1", - "magento/framework": "^102.0||^103.0", + "php": "^7.3|^8.1", + "magento/framework": "^102.0|^103.0", "magento/module-backend": "^101.0|^102.0", "magento/module-ui": "^101.1" }, From 5829fe53b9e54b7cc6d14dabda3c36892ba697d8 Mon Sep 17 00:00:00 2001 From: decelsi Date: Wed, 18 May 2022 14:33:48 +0200 Subject: [PATCH 06/47] Changed coding standard version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 8e1e8c9..b10514f 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ }, "require-dev": { "friendsofphp/php-cs-fixer": "~2.14", - "magento/magento-coding-standard": "5", + "magento/magento-coding-standard": "*", "php-parallel-lint/php-parallel-lint": "^1.3", "phpro/grumphp-shim": "~1.5.0", "phpunit/phpunit": "^8.5", From b3e51531982835945230ec1df2bdf620c168e677 Mon Sep 17 00:00:00 2001 From: decelsi Date: Wed, 18 May 2022 14:37:53 +0200 Subject: [PATCH 07/47] Changed coding standard version --- composer.json | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/composer.json b/composer.json index b10514f..925dc09 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ "friendsofphp/php-cs-fixer": "~2.14", "magento/magento-coding-standard": "*", "php-parallel-lint/php-parallel-lint": "^1.3", - "phpro/grumphp-shim": "~1.5.0", + "phpro/grumphp-shim": "^1.5", "phpunit/phpunit": "^8.5", "squizlabs/php_codesniffer": "~3.4" }, @@ -40,14 +40,6 @@ ], "config": { "sort-packages": true, - "platform": { - "ext-gd": "7.3", - "ext-xsl": "7.3", - "ext-bcmath": "7.3", - "ext-pdo_mysql": "7.3", - "ext-soap": "7.3", - "ext-zip": "7.3" - }, "allow-plugins": { "phpro/grumphp-shim": true } From c4bc5ff442afced2454fb73835ccb1787f7d9c4a Mon Sep 17 00:00:00 2001 From: decelsi Date: Wed, 18 May 2022 14:47:56 +0200 Subject: [PATCH 08/47] Tried to fix first grumphp bug --- Api/Data/TranslationSearchResultsInterface.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Api/Data/TranslationSearchResultsInterface.php b/Api/Data/TranslationSearchResultsInterface.php index 90c80e4..c633655 100644 --- a/Api/Data/TranslationSearchResultsInterface.php +++ b/Api/Data/TranslationSearchResultsInterface.php @@ -8,12 +8,14 @@ interface TranslationSearchResultsInterface extends \Magento\Framework\Api\Searc /** * Get Translation list. + * * @return \Phpro\Translations\Api\Data\TranslationInterface[] */ public function getItems(); /** * Set translate list. + * * @param \Phpro\Translations\Api\Data\TranslationInterface[] $items * @return $this */ From 8e947c2b702d5c15159dcfd7451b2ce65347c065 Mon Sep 17 00:00:00 2001 From: decelsi Date: Wed, 18 May 2022 15:52:16 +0200 Subject: [PATCH 09/47] Grumphp fixes --- .../TranslationSearchResultsInterface.php | 2 +- Api/ExportManagementInterface.php | 4 ++ Api/ImportManagementInterface.php | 2 + Api/TranslationDataManagementInterface.php | 2 + Api/TranslationRepositoryInterface.php | 5 +++ .../Adminhtml/Translation/Edit/BackButton.php | 2 + .../Translation/Edit/DeleteButton.php | 2 + .../Translation/Edit/GenericButton.php | 3 ++ .../Edit/SaveAndContinueButton.php | 2 + .../Adminhtml/Translation/Edit/SaveButton.php | 2 + .../Translation/GenerateJson/SaveButton.php | 2 + Console/Command/Export.php | 11 ++++- .../Command/GenerateFrontendTranslations.php | 21 +++++++++- Console/Command/Import.php | 16 ++++++-- Console/Command/ImportFull.php | 20 +++++++-- Console/Command/PrepareKeysCommand.php | 8 ++++ Controller/Adminhtml/Translation.php | 2 +- Controller/Adminhtml/Translation/Delete.php | 4 +- .../Adminhtml/Translation/DoGenerate.php | 15 ++++++- Controller/Adminhtml/Translation/Edit.php | 12 +++++- .../Adminhtml/Translation/GenerateJson.php | 8 +++- Controller/Adminhtml/Translation/Index.php | 10 ++++- .../Adminhtml/Translation/InlineEdit.php | 9 +++- .../Adminhtml/Translation/NewAction.php | 10 ++++- Controller/Adminhtml/Translation/Save.php | 11 ++++- Controller/Adminhtml/Translation/SaveNew.php | 11 ++++- Model/Data/ExportStats.php | 17 ++++++++ Model/Data/ImportStats.php | 21 ++++++++++ Model/Data/InlineGenerateStats.php | 16 ++++++++ Model/Data/InlineGenerateStatsCollection.php | 14 +++++++ Model/Data/Translation.php | 37 +++++++++++++++++ Model/ExportManagement.php | 27 +++++++++++- Model/Import/Translations.php | 34 +++++++++++---- Model/ImportManagement.php | 41 +++++++++++++++++-- Model/InlineTranslations/FileManager.php | 19 +++++++-- Model/InlineTranslationsGenerator.php | 22 ++++++++++ Model/ResourceModel/Translation.php | 6 +++ Model/Translation.php | 11 +++++ Model/Translation/EmptyDataProvider.php | 4 +- Model/Translation/Source/Locales.php | 12 +++++- Model/TranslationDataManagement.php | 19 +++++++++ Model/TranslationManagement.php | 14 +++++++ Model/TranslationRepository.php | 19 ++++++++- Model/Validator/LocaleValidator.php | 8 ++++ Plugin/UpdateMetadataFields.php | 14 ++++++- .../Listing/Column/TranslationActions.php | 10 +++-- ViewModel/JsTranslationConfig.php | 8 ++++ 47 files changed, 517 insertions(+), 52 deletions(-) diff --git a/Api/Data/TranslationSearchResultsInterface.php b/Api/Data/TranslationSearchResultsInterface.php index c633655..887464d 100644 --- a/Api/Data/TranslationSearchResultsInterface.php +++ b/Api/Data/TranslationSearchResultsInterface.php @@ -15,7 +15,7 @@ public function getItems(); /** * Set translate list. - * + * * @param \Phpro\Translations\Api\Data\TranslationInterface[] $items * @return $this */ diff --git a/Api/ExportManagementInterface.php b/Api/ExportManagementInterface.php index ca9097b..e576ad4 100644 --- a/Api/ExportManagementInterface.php +++ b/Api/ExportManagementInterface.php @@ -7,5 +7,9 @@ interface ExportManagementInterface { + /** + * @param array|null $locale + * @return ExportStats + */ public function export(?array $locale): ExportStats; } diff --git a/Api/ImportManagementInterface.php b/Api/ImportManagementInterface.php index 56eaeff..cc60e89 100644 --- a/Api/ImportManagementInterface.php +++ b/Api/ImportManagementInterface.php @@ -9,6 +9,7 @@ interface ImportManagementInterface { /** * Import Magento translation CSV to the database. + * * Example structure: "Foo","Foo value",module,Magento_Catalog * * @param string $filePath @@ -20,6 +21,7 @@ public function importMagentoCsv(string $filePath, string $locale): ImportStats; /** * Import translation CSV (based on export) to the database. + * * Example structure: "Bar","Bar value",en_US * * @param string $filePath diff --git a/Api/TranslationDataManagementInterface.php b/Api/TranslationDataManagementInterface.php index a14f1dc..c6a1732 100644 --- a/Api/TranslationDataManagementInterface.php +++ b/Api/TranslationDataManagementInterface.php @@ -7,6 +7,7 @@ interface TranslationDataManagementInterface { /** * Add the translation key for all enabled locales of the Magento instance. + * * If default translation is not set, the translation key will be used as default translation. * * @param string $translationKey @@ -25,6 +26,7 @@ public function create(string $translationKey, string $translationValue, array $ /** * Delete a translation for given translation key and locale(s). + * * In case no locales are given, all enabled locales will be used. * * @param string $translationKey diff --git a/Api/TranslationRepositoryInterface.php b/Api/TranslationRepositoryInterface.php index 902f664..16159b6 100644 --- a/Api/TranslationRepositoryInterface.php +++ b/Api/TranslationRepositoryInterface.php @@ -10,6 +10,7 @@ interface TranslationRepositoryInterface /** * Save Translation + * * @param \Phpro\Translations\Api\Data\TranslationInterface $translation * @throws \Magento\Framework\Exception\LocalizedException * @return \Phpro\Translations\Api\Data\TranslationInterface @@ -20,6 +21,7 @@ public function save( /** * Retrieve Translation + * * @param string $translationId * @throws \Magento\Framework\Exception\LocalizedException * @return \Phpro\Translations\Api\Data\TranslationInterface @@ -28,6 +30,7 @@ public function getById($translationId); /** * Retrieve Translation matching the specified criteria. + * * @param \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria * @throws \Magento\Framework\Exception\LocalizedException * @return \Phpro\Translations\Api\Data\TranslationSearchResultsInterface @@ -38,6 +41,7 @@ public function getList( /** * Delete translation by given key and locales. + * * @param string $translationKey * @param array $locales * @return bool true on success @@ -46,6 +50,7 @@ public function deleteByTranslationKeyAndLocales(string $translationKey, array $ /** * Delete Translation by ID + * * @param string $translationId * @throws \Magento\Framework\Exception\NoSuchEntityException * @throws \Magento\Framework\Exception\LocalizedException diff --git a/Block/Adminhtml/Translation/Edit/BackButton.php b/Block/Adminhtml/Translation/Edit/BackButton.php index 0e72792..49602aa 100644 --- a/Block/Adminhtml/Translation/Edit/BackButton.php +++ b/Block/Adminhtml/Translation/Edit/BackButton.php @@ -9,6 +9,8 @@ class BackButton extends GenericButton implements ButtonProviderInterface { /** + * Get data for back (reset) button + * * @return array */ public function getButtonData() diff --git a/Block/Adminhtml/Translation/Edit/DeleteButton.php b/Block/Adminhtml/Translation/Edit/DeleteButton.php index 1267834..e895a60 100644 --- a/Block/Adminhtml/Translation/Edit/DeleteButton.php +++ b/Block/Adminhtml/Translation/Edit/DeleteButton.php @@ -9,6 +9,8 @@ class DeleteButton extends GenericButton implements ButtonProviderInterface { /** + * Get data for back (reset) button + * * @return array */ public function getButtonData() diff --git a/Block/Adminhtml/Translation/Edit/GenericButton.php b/Block/Adminhtml/Translation/Edit/GenericButton.php index f209eae..ab91135 100644 --- a/Block/Adminhtml/Translation/Edit/GenericButton.php +++ b/Block/Adminhtml/Translation/Edit/GenericButton.php @@ -7,6 +7,9 @@ abstract class GenericButton { + /** + * @var Context + */ protected $context; /** diff --git a/Block/Adminhtml/Translation/Edit/SaveAndContinueButton.php b/Block/Adminhtml/Translation/Edit/SaveAndContinueButton.php index 528e71b..9387e3f 100644 --- a/Block/Adminhtml/Translation/Edit/SaveAndContinueButton.php +++ b/Block/Adminhtml/Translation/Edit/SaveAndContinueButton.php @@ -9,6 +9,8 @@ class SaveAndContinueButton extends GenericButton implements ButtonProviderInter { /** + * Get data for back (reset) button + * * @return array */ public function getButtonData() diff --git a/Block/Adminhtml/Translation/Edit/SaveButton.php b/Block/Adminhtml/Translation/Edit/SaveButton.php index 63eeb5a..a0c7c19 100644 --- a/Block/Adminhtml/Translation/Edit/SaveButton.php +++ b/Block/Adminhtml/Translation/Edit/SaveButton.php @@ -9,6 +9,8 @@ class SaveButton extends GenericButton implements ButtonProviderInterface { /** + * Get data for back (reset) button + * * @return array */ public function getButtonData() diff --git a/Block/Adminhtml/Translation/GenerateJson/SaveButton.php b/Block/Adminhtml/Translation/GenerateJson/SaveButton.php index bb12336..a776cc1 100644 --- a/Block/Adminhtml/Translation/GenerateJson/SaveButton.php +++ b/Block/Adminhtml/Translation/GenerateJson/SaveButton.php @@ -10,6 +10,8 @@ class SaveButton extends GenericButton implements ButtonProviderInterface { /** + * Get data for back (reset) button + * * @return array */ public function getButtonData() diff --git a/Console/Command/Export.php b/Console/Command/Export.php index 00be805..70e679b 100644 --- a/Console/Command/Export.php +++ b/Console/Command/Export.php @@ -11,8 +11,8 @@ class Export extends Command { - const COMMAND_NAME = 'phpro:translations:export'; - const ARGUMENT_LOCALES = 'locales'; + private const COMMAND_NAME = 'phpro:translations:export'; + private const ARGUMENT_LOCALES = 'locales'; /** * @var ExportManagementInterface @@ -26,6 +26,9 @@ public function __construct( parent::__construct(); } + /** + * Configure export command + */ protected function configure(): void { $this->setName(self::COMMAND_NAME); @@ -35,6 +38,10 @@ protected function configure(): void parent::configure(); } + /** + * @param InputInterface $input + * @param OutputInterface $output + */ protected function execute(InputInterface $input, OutputInterface $output): void { try { diff --git a/Console/Command/GenerateFrontendTranslations.php b/Console/Command/GenerateFrontendTranslations.php index 465ee15..c4465dd 100644 --- a/Console/Command/GenerateFrontendTranslations.php +++ b/Console/Command/GenerateFrontendTranslations.php @@ -13,10 +13,18 @@ class GenerateFrontendTranslations extends Command { - const COMMAND_NAME = 'phpro:translations:generate-frontend-translations'; + private const COMMAND_NAME = 'phpro:translations:generate-frontend-translations'; + /** + * @var InlineTranslationsGenerator + */ private $inlineTranslationsGenerator; + /** + * GenerateFrontendTranslations constructor. + * + * @param InlineTranslationsGenerator $inlineTranslations + */ public function __construct( InlineTranslationsGenerator $inlineTranslations ) { @@ -24,6 +32,9 @@ public function __construct( parent::__construct(); } + /** + * Configure frontend translations command + */ protected function configure(): void { $this->setName(self::COMMAND_NAME); @@ -32,6 +43,10 @@ protected function configure(): void parent::configure(); } + /** + * @param InputInterface $input + * @param OutputInterface $output + */ protected function execute(InputInterface $input, OutputInterface $output): void { try { @@ -55,6 +70,10 @@ protected function execute(InputInterface $input, OutputInterface $output): void } } + /** + * @param int $storeId + * @return InlineGenerateStatsCollection + */ private function generatedTranslations(int $storeId): InlineGenerateStatsCollection { if (0 === $storeId) { diff --git a/Console/Command/Import.php b/Console/Command/Import.php index 9ce7f3d..7565758 100644 --- a/Console/Command/Import.php +++ b/Console/Command/Import.php @@ -13,15 +13,16 @@ class Import extends Command { - const COMMAND_NAME = 'phpro:translations:import'; - const ARGUMENT_CSV_FILE = 'csvfile'; - const ARGUMENT_LOCALE = 'locale'; - const OPTION_CLEAR_CACHE = 'clear-cache'; + private const COMMAND_NAME = 'phpro:translations:import'; + private const ARGUMENT_CSV_FILE = 'csvfile'; + private const ARGUMENT_LOCALE = 'locale'; + private const OPTION_CLEAR_CACHE = 'clear-cache'; /** * @var ImportManagementInterface */ private $importer; + /** * @var Manager */ @@ -36,6 +37,9 @@ public function __construct( parent::__construct(); } + /** + * Configure import command + */ protected function configure(): void { $this->setName(self::COMMAND_NAME); @@ -47,6 +51,10 @@ protected function configure(): void parent::configure(); } + /** + * @param InputInterface $input + * @param OutputInterface $output + */ protected function execute(InputInterface $input, OutputInterface $output): void { try { diff --git a/Console/Command/ImportFull.php b/Console/Command/ImportFull.php index 8742587..3479ddd 100644 --- a/Console/Command/ImportFull.php +++ b/Console/Command/ImportFull.php @@ -13,19 +13,26 @@ class ImportFull extends Command { - const COMMAND_NAME = 'phpro:translations:import-full'; - const ARGUMENT_CSV_FILE = 'csvfile'; - const OPTION_CLEAR_CACHE = 'clear-cache'; + private const COMMAND_NAME = 'phpro:translations:import-full'; + private const ARGUMENT_CSV_FILE = 'csvfile'; + private const OPTION_CLEAR_CACHE = 'clear-cache'; /** * @var ImportManagementInterface */ private $importer; + /** * @var Manager */ private $cacheManager; + /** + * ImportFull constructor. + * + * @param ImportManagementInterface $importer + * @param Manager $cacheManager + */ public function __construct( ImportManagementInterface $importer, Manager $cacheManager @@ -35,6 +42,9 @@ public function __construct( parent::__construct(); } + /** + * Configure import full command + */ protected function configure(): void { $this->setName(self::COMMAND_NAME); @@ -45,6 +55,10 @@ protected function configure(): void parent::configure(); } + /** + * @param InputInterface $input + * @param OutputInterface $output + */ protected function execute(InputInterface $input, OutputInterface $output): void { try { diff --git a/Console/Command/PrepareKeysCommand.php b/Console/Command/PrepareKeysCommand.php index e0bbbda..d5ef444 100644 --- a/Console/Command/PrepareKeysCommand.php +++ b/Console/Command/PrepareKeysCommand.php @@ -33,6 +33,14 @@ class PrepareKeysCommand extends Command */ private $translationDataManagement; + /** + * PrepareKeysCommand constructor. + * + * @param ResolverFactory $optionResolverFactory + * @param Parser $parser + * @param TranslationDataManagementInterface $translationDataManagement + * @param string|null $name + */ public function __construct( ResolverFactory $optionResolverFactory, Parser $parser, diff --git a/Controller/Adminhtml/Translation.php b/Controller/Adminhtml/Translation.php index d965701..e5cc9c1 100644 --- a/Controller/Adminhtml/Translation.php +++ b/Controller/Adminhtml/Translation.php @@ -8,7 +8,7 @@ abstract class Translation extends Action { - const ADMIN_RESOURCE = 'Phpro_Translations::translations'; + private const ADMIN_RESOURCE = 'Phpro_Translations::translations'; /** * Init page diff --git a/Controller/Adminhtml/Translation/Delete.php b/Controller/Adminhtml/Translation/Delete.php index 987bf15..a91db2d 100644 --- a/Controller/Adminhtml/Translation/Delete.php +++ b/Controller/Adminhtml/Translation/Delete.php @@ -9,7 +9,7 @@ class Delete extends Translation { - const ADMIN_RESOURCE = 'Phpro_Translations::Translation_delete'; + private const ADMIN_RESOURCE = 'Phpro_Translations::Translation_delete'; /** * @var TranslationRepositoryInterface @@ -25,7 +25,7 @@ public function __construct( } /** - * @inheridoc + * @inheritDoc */ public function execute() { diff --git a/Controller/Adminhtml/Translation/DoGenerate.php b/Controller/Adminhtml/Translation/DoGenerate.php index e6ae713..8d1a8c9 100644 --- a/Controller/Adminhtml/Translation/DoGenerate.php +++ b/Controller/Adminhtml/Translation/DoGenerate.php @@ -23,6 +23,13 @@ class DoGenerate extends Action */ private $cacheTypeList; + /** + * DoGenerate constructor. + * + * @param Context $context + * @param InlineTranslationsGenerator $inlineTranslationsGenerator + * @param TypeListInterface $cacheTypeList + */ public function __construct( Context $context, InlineTranslationsGenerator $inlineTranslationsGenerator, @@ -38,7 +45,9 @@ public function __construct( */ public function execute() { - /** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */ + /** + * @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect + */ $resultRedirect = $this->resultRedirectFactory->create(); $data = $this->getRequest()->getPostValue(); @@ -66,6 +75,10 @@ public function execute() return $resultRedirect->setPath('*/*/generatejson'); } + /** + * @param array $storeIds + * @return InlineGenerateStatsCollection + */ private function generatedTranslations(array $storeIds): InlineGenerateStatsCollection { if (isset($storeIds[0]) && (0 === $storeIds[0])) { diff --git a/Controller/Adminhtml/Translation/Edit.php b/Controller/Adminhtml/Translation/Edit.php index ee489ad..de45305 100644 --- a/Controller/Adminhtml/Translation/Edit.php +++ b/Controller/Adminhtml/Translation/Edit.php @@ -12,7 +12,7 @@ class Edit extends Translation { - const ADMIN_RESOURCE = 'Phpro_Translations::Translation_update'; + private const ADMIN_RESOURCE = 'Phpro_Translations::Translation_update'; /** * @var PageFactory @@ -29,6 +29,14 @@ class Edit extends Translation */ private $coreRegistry; + /** + * Edit constructor. + * + * @param Context $context + * @param Registry $coreRegistry + * @param PageFactory $resultPageFactory + * @param TranslationRepositoryInterface $translationRepository + */ public function __construct( Context $context, Registry $coreRegistry, @@ -42,7 +50,7 @@ public function __construct( } /** - * @inheridoc + * @inheritDoc */ public function execute() { diff --git a/Controller/Adminhtml/Translation/GenerateJson.php b/Controller/Adminhtml/Translation/GenerateJson.php index e1c7773..0bd06d2 100644 --- a/Controller/Adminhtml/Translation/GenerateJson.php +++ b/Controller/Adminhtml/Translation/GenerateJson.php @@ -15,6 +15,12 @@ class GenerateJson extends Translation */ private $resultPageFactory; + /** + * GenerateJson constructor. + * + * @param Context $context + * @param PageFactory $resultPageFactory + */ public function __construct( Context $context, PageFactory $resultPageFactory @@ -24,7 +30,7 @@ public function __construct( } /** - * @inheridoc + * @inheritDoc */ public function execute() { diff --git a/Controller/Adminhtml/Translation/Index.php b/Controller/Adminhtml/Translation/Index.php index 5bf1f98..9256e6e 100644 --- a/Controller/Adminhtml/Translation/Index.php +++ b/Controller/Adminhtml/Translation/Index.php @@ -9,13 +9,19 @@ class Index extends Action { - const ADMIN_RESOURCE = 'Phpro_Translations::Translation'; + private const ADMIN_RESOURCE = 'Phpro_Translations::Translation'; /** * @var PageFactory */ private $resultPageFactory; + /** + * Index constructor. + * + * @param Context $context + * @param PageFactory $resultPageFactory + */ public function __construct( Context $context, PageFactory $resultPageFactory @@ -25,7 +31,7 @@ public function __construct( } /** - * @inheridoc + * @inheritDoc */ public function execute() { diff --git a/Controller/Adminhtml/Translation/InlineEdit.php b/Controller/Adminhtml/Translation/InlineEdit.php index 1433bd9..4a77651 100644 --- a/Controller/Adminhtml/Translation/InlineEdit.php +++ b/Controller/Adminhtml/Translation/InlineEdit.php @@ -19,6 +19,13 @@ class InlineEdit extends Action */ private $translationFactory; + /** + * InlineEdit constructor. + * + * @param Context $context + * @param JsonFactory $jsonFactory + * @param TranslationFactory $translationFactory + */ public function __construct( Context $context, JsonFactory $jsonFactory, @@ -30,7 +37,7 @@ public function __construct( } /** - * @inheridoc + * @inheritDoc */ public function execute() { diff --git a/Controller/Adminhtml/Translation/NewAction.php b/Controller/Adminhtml/Translation/NewAction.php index cefdfc7..4f5388c 100644 --- a/Controller/Adminhtml/Translation/NewAction.php +++ b/Controller/Adminhtml/Translation/NewAction.php @@ -9,13 +9,19 @@ class NewAction extends Translation { - const ADMIN_RESOURCE = 'Phpro_Translations::Translation_new_action'; + private const ADMIN_RESOURCE = 'Phpro_Translations::Translation_new_action'; /** * @var PageFactory */ private $resultPageFactory; + /** + * NewAction constructor. + * + * @param Context $context + * @param PageFactory $resultPageFactory + */ public function __construct( Context $context, PageFactory $resultPageFactory @@ -25,7 +31,7 @@ public function __construct( } /** - * @inheridoc + * @inheritDoc */ public function execute() { diff --git a/Controller/Adminhtml/Translation/Save.php b/Controller/Adminhtml/Translation/Save.php index 618051e..2b55c99 100644 --- a/Controller/Adminhtml/Translation/Save.php +++ b/Controller/Adminhtml/Translation/Save.php @@ -12,7 +12,7 @@ class Save extends Action { - const ADMIN_RESOURCE = 'Phpro_Translations::Translation_save'; + private const ADMIN_RESOURCE = 'Phpro_Translations::Translation_save'; /** * @var DataPersistorInterface @@ -24,6 +24,13 @@ class Save extends Action */ private $translationRepository; + /** + * Save constructor. + * + * @param Context $context + * @param DataPersistorInterface $dataPersistor + * @param TranslationRepositoryInterface $translationRepository + */ public function __construct( Context $context, DataPersistorInterface $dataPersistor, @@ -35,7 +42,7 @@ public function __construct( } /** - * @inheridoc + * @inheritDoc */ public function execute() { diff --git a/Controller/Adminhtml/Translation/SaveNew.php b/Controller/Adminhtml/Translation/SaveNew.php index 089a8ef..22de0cb 100644 --- a/Controller/Adminhtml/Translation/SaveNew.php +++ b/Controller/Adminhtml/Translation/SaveNew.php @@ -12,7 +12,7 @@ class SaveNew extends Action { - const ADMIN_RESOURCE = 'Phpro_Translations::Translation_save'; + private const ADMIN_RESOURCE = 'Phpro_Translations::Translation_save'; /** * @var DataPersistorInterface @@ -24,6 +24,13 @@ class SaveNew extends Action */ private $translationManagement; + /** + * SaveNew constructor. + * + * @param Context $context + * @param DataPersistorInterface $dataPersistor + * @param TranslationManagement $translationManagement + */ public function __construct( Context $context, DataPersistorInterface $dataPersistor, @@ -35,7 +42,7 @@ public function __construct( } /** - * @inheridoc + * @inheritDoc */ public function execute() { diff --git a/Model/Data/ExportStats.php b/Model/Data/ExportStats.php index 679520b..e4256e8 100644 --- a/Model/Data/ExportStats.php +++ b/Model/Data/ExportStats.php @@ -15,22 +15,39 @@ class ExportStats */ private $totalRows; + /** + * ExportStats constructor. + * + * @param string $fileName + * @param int $totalRows + */ public function __construct(string $fileName, int $totalRows) { $this->fileName = $fileName; $this->totalRows = $totalRows; } + /** + * @param string $fileName + * @param int $totalRows + * @return ExportStats + */ public static function fromRawData(string $fileName, int $totalRows): ExportStats { return new self($fileName, $totalRows); } + /** + * @return string + */ public function getFileName(): string { return $this->fileName; } + /** + * @return int + */ public function getTotalRows(): int { return $this->totalRows; diff --git a/Model/Data/ImportStats.php b/Model/Data/ImportStats.php index aed8823..45e33a1 100644 --- a/Model/Data/ImportStats.php +++ b/Model/Data/ImportStats.php @@ -20,31 +20,52 @@ class ImportStats */ private $failed = []; + /** + * @param int $rowModel/Data/InlineGenerateStats.php + * @param string $key + */ public function addCreated(int $row, string $key) { $this->created[$row] = $key; } + /** + * @return int + */ public function getCreatedCount(): int { return count($this->created); } + /** + * @param int $row + * @param string $reason + */ public function addFailed(int $row, string $reason) { $this->failed[$row] = $reason; } + /** + * @return int + */ public function getFailedCount(): int { return count($this->failed); } + /** + * @param int $row + * @param string $reason + */ public function addSkipped(int $row, string $reason) { $this->skipped[$row] = $reason; } + /** + * @return int + */ public function getSkippedCount(): int { return count($this->skipped); diff --git a/Model/Data/InlineGenerateStats.php b/Model/Data/InlineGenerateStats.php index 3dff6ce..c7172e2 100644 --- a/Model/Data/InlineGenerateStats.php +++ b/Model/Data/InlineGenerateStats.php @@ -18,6 +18,13 @@ class InlineGenerateStats */ public $amountGenerated; + /** + * InlineGenerateStats constructor. + * + * @param string $storeInformation + * @param int $storeId + * @param int $amountGenerated + */ public function __construct(string $storeInformation, int $storeId, int $amountGenerated) { $this->storeInformation = $storeInformation; @@ -25,16 +32,25 @@ public function __construct(string $storeInformation, int $storeId, int $amountG $this->amountGenerated = $amountGenerated; } + /** + * @return string + */ public function getStoreInformation(): string { return $this->storeInformation; } + /** + * @return int + */ public function getStoreId(): int { return $this->storeId; } + /** + * @return int + */ public function getAmountGenerated(): int { return $this->amountGenerated; diff --git a/Model/Data/InlineGenerateStatsCollection.php b/Model/Data/InlineGenerateStatsCollection.php index 79d2ea6..494c5ab 100644 --- a/Model/Data/InlineGenerateStatsCollection.php +++ b/Model/Data/InlineGenerateStatsCollection.php @@ -14,11 +14,19 @@ class InlineGenerateStatsCollection implements IteratorAggregate, Countable */ private $statsItems; + /** + * InlineGenerateStatsCollection constructor. + * + * @param InlineGenerateStats ...$statsItems + */ public function __construct(InlineGenerateStats ...$statsItems) { $this->statsItems = $statsItems; } + /** + * @param InlineGenerateStats $stats + */ public function add(InlineGenerateStats $stats) { $this->statsItems[] = $stats; @@ -32,11 +40,17 @@ public function getIterator() return new ArrayIterator($this->statsItems); } + /** + * @return int + */ public function count(): int { return \count($this->statsItems); } + /** + * @return array + */ public function toArray(): array { $result = []; diff --git a/Model/Data/Translation.php b/Model/Data/Translation.php index cb4fc1f..dc884cc 100644 --- a/Model/Data/Translation.php +++ b/Model/Data/Translation.php @@ -8,51 +8,86 @@ class Translation extends AbstractExtensibleObject implements TranslationInterface { + /** + * @return int|null + */ public function getKeyId() { return $this->_get(self::KEY_ID); } + /** + * @param $keyId + * @return mixed + */ public function setKeyId($keyId) { return $this->setData(self::KEY_ID, $keyId); } + /** + * @return string|null + */ public function getString() { return $this->_get(self::STRING); } + /** + * @param $string + * @return mixed + */ public function setString($string) { return $this->setData(self::STRING, $string); } + /** + * @return string|null + */ public function getLocale() { return $this->_get(self::LOCALE); } + /** + * @param $locale + * @return mixed + */ public function setLocale($locale) { return $this->setData(self::LOCALE, $locale); } + /** + * @return string|null + */ public function getTranslate() { return $this->_get(self::TRANSLATE); } + /** + * @param $translate + * @return mixed + */ public function setTranslate($translate) { return $this->setData(self::TRANSLATE, $translate); } + /** + * @return bool + */ public function getFrontend() { return (boolean) $this->_get(self::FRONTEND); } + /** + * @param $translate + * @return mixed + */ public function setFrontend($translate) { return $this->setData(self::FRONTEND, $translate); @@ -60,6 +95,7 @@ public function setFrontend($translate) /** * Retrieve existing extension attributes object or create a new one. + * * @return \Phpro\Translations\Api\Data\TranslationExtensionInterface|null */ public function getExtensionAttributes() @@ -69,6 +105,7 @@ public function getExtensionAttributes() /** * Set an extension attributes object. + * * @param \Phpro\Translations\Api\Data\TranslationExtensionInterface $extensionAttributes * @return $this */ diff --git a/Model/ExportManagement.php b/Model/ExportManagement.php index 9a3bd3e..53bb0f4 100644 --- a/Model/ExportManagement.php +++ b/Model/ExportManagement.php @@ -12,7 +12,7 @@ class ExportManagement implements ExportManagementInterface { - const CSV_SUFFIX = '_export.csv'; + private const CSV_SUFFIX = '_export.csv'; /** * @var Csv @@ -31,6 +31,15 @@ class ExportManagement implements ExportManagementInterface */ private $directoryList; + /** + * ExportManagement constructor. + * + * @param Csv $csv + * @param SearchCriteriaBuilder $searchCriteriaBuilder + * @param TranslationRepository $repository + * @param DirectoryList $directoryList + * @param TimezoneInterface $time + */ public function __construct( Csv $csv, SearchCriteriaBuilder $searchCriteriaBuilder, @@ -44,6 +53,10 @@ public function __construct( $this->directoryList = $directoryList; } + /** + * @param array|null $locales + * @return ExportStats + */ public function export(?array $locales): ExportStats { $this->csv->setDelimiter(','); @@ -60,14 +73,24 @@ public function export(?array $locales): ExportStats return ExportStats::fromRawData($fileName, $result->getTotalCount()); } + /** + * @param \Magento\Framework\Api\SearchResultsInterface $result + * @return \Generator + */ private function formatResultsToCsvData(\Magento\Framework\Api\SearchResultsInterface $result): \Generator { - /** @var \Phpro\Translations\Api\Data\TranslationInterface $item */ + /** + * @var \Phpro\Translations\Api\Data\TranslationInterface $item + */ foreach ($result->getItems() as $item) { yield [$item->getString(), $item->getTranslate(), $item->getLocale()]; } } + /** + * @param string $suffix + * @return string + */ private function getExportPath(string $suffix): string { $date = new \DateTime(); diff --git a/Model/Import/Translations.php b/Model/Import/Translations.php index f37bb45..aa5b31f 100644 --- a/Model/Import/Translations.php +++ b/Model/Import/Translations.php @@ -15,16 +15,16 @@ class Translations extends AbstractEntity { - const ENTITY_CODE = 'translations'; - const TABLE = 'translation'; + private const ENTITY_CODE = 'translations'; + private const TABLE = 'translation'; - const COL_KEY = 'string'; - const COL_TRANSLATION = 'translate'; - const COL_LOCALE = 'locale'; + public const COL_KEY = 'string'; + public const COL_TRANSLATION = 'translate'; + public const COL_LOCALE = 'locale'; - const HEADER_KEY = 'key'; - const HEADER_TRANSLATION = 'translation'; - const HEADER_LOCALE = 'locale'; + public const HEADER_KEY = 'key'; + public const HEADER_TRANSLATION = 'translation'; + public const HEADER_LOCALE = 'locale'; /** * @var string[] @@ -37,11 +37,15 @@ class Translations extends AbstractEntity /** * If we should check column names + * + * @var bool */ protected $needColumnCheck = true; /** * Need to log in import history + * + * @var bool */ protected $logInHistory = true; @@ -55,6 +59,17 @@ class Translations extends AbstractEntity */ private $localeValidator; + /** + * Translations constructor. + * + * @param JsonHelper $jsonHelper + * @param ImportHelper $importExportData + * @param Data $importData + * @param ResourceConnection $resource + * @param Helper $resourceHelper + * @param ProcessingErrorAggregatorInterface $errorAggregator + * @param LocaleValidator $localeValidator + */ public function __construct( JsonHelper $jsonHelper, ImportHelper $importExportData, @@ -144,6 +159,7 @@ public function getUpdatedItemsCount() /** * Import data + * * @throws \Exception * @return bool */ @@ -164,6 +180,7 @@ protected function _importData(): bool /** * Save and replace entities + * * @return void */ private function saveAndReplaceEntity(): void @@ -197,6 +214,7 @@ private function saveAndReplaceEntity(): void /** * Save entities + * * @param array $entityList * @return int */ diff --git a/Model/ImportManagement.php b/Model/ImportManagement.php index 61de9bc..62fc22f 100644 --- a/Model/ImportManagement.php +++ b/Model/ImportManagement.php @@ -35,6 +35,15 @@ class ImportManagement implements ImportManagementInterface */ private $importStatsFactory; + /** + * ImportManagement constructor. + * + * @param Csv $csv + * @param LocaleValidator $localeValidator + * @param TranslationFactory $translationFactory + * @param TranslationRepository $repository + * @param ImportStatsFactory $importStatsFactory + */ public function __construct( Csv $csv, LocaleValidator $localeValidator, @@ -49,6 +58,12 @@ public function __construct( $this->importStatsFactory = $importStatsFactory; } + /** + * @param string $filePath + * @param string $locale + * @return ImportStats + * @throws \Exception + */ public function importMagentoCsv(string $filePath, string $locale): ImportStats { $this->localeValidator->validate($locale); @@ -57,7 +72,9 @@ public function importMagentoCsv(string $filePath, string $locale): ImportStats $this->csv->setEnclosure('"'); $csvData = $this->csv->getData($filePath); - /** @var ImportStats $importStats */ + /** + * @var ImportStats $importStats + */ $importStats = $this->importStatsFactory->create(); foreach ($csvData as $row => $data) { @@ -79,13 +96,19 @@ public function importMagentoCsv(string $filePath, string $locale): ImportStats return $importStats; } + /** + * @param string $filePath + * @return ImportStats + */ public function importFull(string $filePath): ImportStats { $this->csv->setDelimiter(','); $this->csv->setEnclosure('"'); $csvData = $this->csv->getData($filePath); - /** @var ImportStats $importStats */ + /** + * @var ImportStats $importStats + */ $importStats = $this->importStatsFactory->create(); foreach ($csvData as $row => $data) { @@ -108,9 +131,16 @@ public function importFull(string $filePath): ImportStats return $importStats; } + /** + * @param string $translationKey + * @param string $translationValue + * @param string $locale + */ private function createTranslations(string $translationKey, string $translationValue, string $locale) { - /** @var Translation $translationModel */ + /** + * @var Translation $translationModel + */ $translationModel = $this->translationFactory->create(); $translationModel->setLocale($locale); @@ -120,6 +150,11 @@ private function createTranslations(string $translationKey, string $translationV $this->repository->save($translationModel); } + /** + * @param \Exception $e + * @param ImportStats $importStats + * @param int $rowNumber + */ private function handleException(\Exception $e, ImportStats $importStats, int $rowNumber) { if ($e instanceof CouldNotSaveException && (false !== strpos(strtolower($e->getMessage()), 'unique'))) { diff --git a/Model/InlineTranslations/FileManager.php b/Model/InlineTranslations/FileManager.php index e9f1b40..16c1615 100644 --- a/Model/InlineTranslations/FileManager.php +++ b/Model/InlineTranslations/FileManager.php @@ -46,6 +46,16 @@ class FileManager */ private $date; + /** + * FileManager constructor. + * + * @param Json $serializer + * @param DirectoryList $directoryList + * @param Filesystem $filesystem + * @param File $driverFile + * @param UrlInterface $urlGenerator + * @param TimezoneInterface $dateTime + */ public function __construct( Json $serializer, DirectoryList $directoryList, @@ -63,8 +73,7 @@ public function __construct( } /** - * This method will return a public URL containing the replacement url for the original js-translation.json - * located in pub/static/frontend////... folders. + * This method will return a public URL containing the replacement url for the original js-translation.json located in pub/static/frontend////... folders. * * E.g. https://www.webshop.com/media/phpro_translations/ThemeName/default/nl_BE/1642691554translation.json * @@ -94,8 +103,8 @@ public function getJsTranslationUrl(string $themePath): string /** * This method saves the translations as json string in the media directory for related theme and locale. - * Also old generated translation files will be cleaned up and a new version string is created. * + * Also old generated translation files will be cleaned up and a new version string is created. * Example save path: pub/media/phpro_translations/ThemeName/default/nl_BE/1642691554translation.json * * @param array $translations @@ -169,6 +178,10 @@ private function cleanupOldTranslationFiles(string $themePath, string $savePath) } } + /** + * @param string $themeLocalePath + * @return string + */ private function getRelativeVersionFilePath(string $themeLocalePath): string { return sprintf( diff --git a/Model/InlineTranslationsGenerator.php b/Model/InlineTranslationsGenerator.php index 8f05439..52ae79c 100644 --- a/Model/InlineTranslationsGenerator.php +++ b/Model/InlineTranslationsGenerator.php @@ -45,6 +45,17 @@ class InlineTranslationsGenerator */ private $systemStore; + /** + * InlineTranslationsGenerator constructor. + * + * @param DataProviderInterface $dataProvider + * @param State $state + * @param TranslateInterface $translate + * @param FileManager $fileManager + * @param Emulation $emulation + * @param DesignInterface $viewDesign + * @param SystemStore $systemStore + */ public function __construct( DataProviderInterface $dataProvider, State $state, @@ -63,6 +74,9 @@ public function __construct( $this->systemStore = $systemStore; } + /** + * @return InlineGenerateStatsCollection + */ public function forAll(): InlineGenerateStatsCollection { $storeIds = []; @@ -73,6 +87,10 @@ public function forAll(): InlineGenerateStatsCollection return $this->forStores($storeIds); } + /** + * @param array $storeIds + * @return InlineGenerateStatsCollection + */ public function forStores(array $storeIds): InlineGenerateStatsCollection { $statsCollection = new InlineGenerateStatsCollection(); @@ -85,6 +103,10 @@ public function forStores(array $storeIds): InlineGenerateStatsCollection return $statsCollection; } + /** + * @param int $storeId + * @return InlineGenerateStats + */ private function generate(int $storeId): InlineGenerateStats { $translations = []; diff --git a/Model/ResourceModel/Translation.php b/Model/ResourceModel/Translation.php index e4bb6ec..6fc11a0 100644 --- a/Model/ResourceModel/Translation.php +++ b/Model/ResourceModel/Translation.php @@ -7,6 +7,12 @@ class Translation extends AbstractDb { + /** + * @param string $translationKey + * @param array $locales + * @return $this + * @throws \Exception + */ public function deleteByTranslationKeyAndLocales(string $translationKey, array $locales) { $conn = $this->getConnection(); diff --git a/Model/Translation.php b/Model/Translation.php index 3d9e7eb..b98c805 100644 --- a/Model/Translation.php +++ b/Model/Translation.php @@ -23,6 +23,17 @@ class Translation extends AbstractModel */ private $dataObjectHelper; + /** + * Translation constructor. + * + * @param Context $context + * @param Registry $registry + * @param TranslationInterfaceFactory $translationDataFactory + * @param DataObjectHelper $dataObjectHelper + * @param ResourceModel\Translation $resource + * @param ResourceModel\Translation\Collection $resourceCollection + * @param array $data + */ public function __construct( Context $context, Registry $registry, diff --git a/Model/Translation/EmptyDataProvider.php b/Model/Translation/EmptyDataProvider.php index 29c23cf..05eaae2 100644 --- a/Model/Translation/EmptyDataProvider.php +++ b/Model/Translation/EmptyDataProvider.php @@ -9,7 +9,7 @@ class EmptyDataProvider extends AbstractDataProvider { /** - * @inheridoc + * @inheritDoc */ public function addFilter(Filter $filter) { @@ -17,7 +17,7 @@ public function addFilter(Filter $filter) } /** - * @inheridoc + * @inheritDoc */ public function getData() { diff --git a/Model/Translation/Source/Locales.php b/Model/Translation/Source/Locales.php index ecbed2a..a93a158 100644 --- a/Model/Translation/Source/Locales.php +++ b/Model/Translation/Source/Locales.php @@ -8,17 +8,25 @@ class Locales implements OptionSourceInterface { - const XML_PATH_LOCALE = 'general/locale/code'; + private const XML_PATH_LOCALE = 'general/locale/code'; + /** + * @var ResourceConnection + */ private $resourceConnection; + /** + * Locales constructor. + * + * @param ResourceConnection $resourceConnection + */ public function __construct(ResourceConnection $resourceConnection) { $this->resourceConnection = $resourceConnection; } /** - * @inheritdoc + * @inheritDoc */ public function toOptionArray() { diff --git a/Model/TranslationDataManagement.php b/Model/TranslationDataManagement.php index 26b01c4..afc9ad6 100644 --- a/Model/TranslationDataManagement.php +++ b/Model/TranslationDataManagement.php @@ -40,6 +40,16 @@ class TranslationDataManagement implements TranslationDataManagementInterface */ private $throwException; + /** + * TranslationDataManagement constructor. + * + * @param LoggerInterface $logger + * @param LocaleValidator $localeValidator + * @param LocaleSource $localeSource + * @param TranslationFactory $translationFactory + * @param TranslationRepository $repository + * @param bool $throwException + */ public function __construct( LoggerInterface $logger, LocaleValidator $localeValidator, @@ -105,6 +115,12 @@ public function delete(string $translationKey, ?array $locales = []) } } + /** + * @param string $translationKey + * @param string $translationValue + * @param string $locale + * @throws \Exception + */ private function insertTranslation(string $translationKey, string $translationValue, string $locale) { try { @@ -133,6 +149,9 @@ private function insertTranslation(string $translationKey, string $translationVa } } + /** + * @return array + */ private function getEnabledLocales(): array { if (!empty($this->enabledLocales)) { diff --git a/Model/TranslationManagement.php b/Model/TranslationManagement.php index 4a4e544..043e3eb 100644 --- a/Model/TranslationManagement.php +++ b/Model/TranslationManagement.php @@ -21,6 +21,13 @@ class TranslationManagement */ private $repository; + /** + * TranslationManagement constructor. + * + * @param LocaleValidator $localeValidator + * @param TranslationFactory $translationFactory + * @param TranslationRepository $repository + */ public function __construct( LocaleValidator $localeValidator, TranslationFactory $translationFactory, @@ -31,6 +38,13 @@ public function __construct( $this->repository = $repository; } + /** + * @param string $translationKey + * @param string $translationValue + * @param string $locale + * @param string $frontend + * @throws \Exception + */ public function addTranslation( string $translationKey, string $translationValue, diff --git a/Model/TranslationRepository.php b/Model/TranslationRepository.php index bd61499..5ff01e3 100644 --- a/Model/TranslationRepository.php +++ b/Model/TranslationRepository.php @@ -67,6 +67,21 @@ class TranslationRepository implements TranslationRepositoryInterface */ private $extensibleDataObjectConverter; + /** + * TranslationRepository constructor. + * + * @param ResourceTranslation $resource + * @param TranslationFactory $translationFactory + * @param TranslationInterfaceFactory $dataTranslationFactory + * @param TranslationCollectionFactory $translationCollectionFactory + * @param TranslationSearchResultsInterfaceFactory $searchResultsFactory + * @param DataObjectHelper $dataObjectHelper + * @param DataObjectProcessor $dataObjectProcessor + * @param StoreManagerInterface $storeManager + * @param CollectionProcessorInterface $collectionProcessor + * @param JoinProcessorInterface $extensionAttributesJoinProcessor + * @param ExtensibleDataObjectConverter $extensibleDataObjectConverter + */ public function __construct( ResourceTranslation $resource, TranslationFactory $translationFactory, @@ -93,8 +108,10 @@ public function __construct( $this->extensibleDataObjectConverter = $extensibleDataObjectConverter; } + /** - * {@inheritdoc + * @param TranslationInterface $translation + * @return TranslationInterface */ public function save(TranslationInterface $translation) { diff --git a/Model/Validator/LocaleValidator.php b/Model/Validator/LocaleValidator.php index 6c742f4..ccee70c 100644 --- a/Model/Validator/LocaleValidator.php +++ b/Model/Validator/LocaleValidator.php @@ -17,6 +17,11 @@ class LocaleValidator */ private $locales = []; + /** + * LocaleValidator constructor. + * + * @param ListsInterface $localeLists + */ public function __construct(ListsInterface $localeLists) { $this->localeLists = $localeLists; @@ -33,6 +38,9 @@ public function validate(string $locale) } } + /** + * @return array + */ private function getSupportedLocales(): array { if (!empty($this->locales)) { diff --git a/Plugin/UpdateMetadataFields.php b/Plugin/UpdateMetadataFields.php index a8a8830..057d408 100644 --- a/Plugin/UpdateMetadataFields.php +++ b/Plugin/UpdateMetadataFields.php @@ -14,8 +14,14 @@ */ class UpdateMetadataFields { - const UI_COMPONENT_NAME = 'phpro_translations_listing'; + private const UI_COMPONENT_NAME = 'phpro_translations_listing'; + /** + * @param Subject $subject + * @param $result + * @param UiComponentInterface $component + * @return array|mixed + */ public function afterGetFields(Subject $subject, $result, UiComponentInterface $component) { if (self::UI_COMPONENT_NAME === $component->getName()) { @@ -29,6 +35,12 @@ public function afterGetFields(Subject $subject, $result, UiComponentInterface $ return $result; } + /** + * @param Subject $subject + * @param $result + * @param UiComponentInterface $component + * @return array|mixed + */ public function afterGetHeaders(Subject $subject, $result, UiComponentInterface $component) { if (self::UI_COMPONENT_NAME === $component->getName()) { diff --git a/Ui/Component/Listing/Column/TranslationActions.php b/Ui/Component/Listing/Column/TranslationActions.php index ebc067f..fbc6f4e 100644 --- a/Ui/Component/Listing/Column/TranslationActions.php +++ b/Ui/Component/Listing/Column/TranslationActions.php @@ -7,9 +7,13 @@ class TranslationActions extends Column { - const URL_PATH_EDIT = 'phpro_translations/translation/edit'; - const URL_PATH_DELETE = 'phpro_translations/translation/delete'; - const URL_PATH_DETAILS = 'phpro_translations/translation/details'; + private const URL_PATH_EDIT = 'phpro_translations/translation/edit'; + private const URL_PATH_DELETE = 'phpro_translations/translation/delete'; + private const URL_PATH_DETAILS = 'phpro_translations/translation/details'; + + /** + * @var \Magento\Framework\UrlInterface + */ protected $urlBuilder; /** diff --git a/ViewModel/JsTranslationConfig.php b/ViewModel/JsTranslationConfig.php index c1061e4..f3ba38d 100644 --- a/ViewModel/JsTranslationConfig.php +++ b/ViewModel/JsTranslationConfig.php @@ -18,6 +18,11 @@ class JsTranslationConfig implements ArgumentInterface */ private $design; + /** + * JsTranslationConfig constructor. + * @param FileManager $fileManager + * @param DesignInterface $design + */ public function __construct( FileManager $fileManager, DesignInterface $design @@ -26,6 +31,9 @@ public function __construct( $this->design = $design; } + /** + * @return string + */ public function getJsTranslationFilePath(): string { try { From b68bae97ab88246d044f087c78b8474bc111b706 Mon Sep 17 00:00:00 2001 From: decelsi Date: Thu, 19 May 2022 07:32:00 +0200 Subject: [PATCH 10/47] Created new docblocks --- Api/Data/TranslationInterface.php | 12 +++++++----- Api/ExportManagementInterface.php | 2 ++ Console/Command/Export.php | 5 +++++ Plugin/UpdateMetadataFields.php | 1 + 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Api/Data/TranslationInterface.php b/Api/Data/TranslationInterface.php index 172a9f4..870a8df 100644 --- a/Api/Data/TranslationInterface.php +++ b/Api/Data/TranslationInterface.php @@ -5,11 +5,11 @@ interface TranslationInterface extends \Magento\Framework\Api\ExtensibleDataInterface { - const STRING = 'string'; - const LOCALE = 'locale'; - const TRANSLATE = 'translate'; - const FRONTEND = 'frontend'; - const KEY_ID = 'key_id'; + public const STRING = 'string'; + public const LOCALE = 'locale'; + public const TRANSLATE = 'translate'; + public const FRONTEND = 'frontend'; + public const KEY_ID = 'key_id'; /** * @return int|null @@ -68,12 +68,14 @@ public function setFrontend($frontend); /** * Retrieve existing extension attributes object or create a new one. + * * @return \Phpro\Translations\Api\Data\TranslationExtensionInterface|null */ public function getExtensionAttributes(); /** * Set an extension attributes object. + * * @param \Phpro\Translations\Api\Data\TranslationExtensionInterface $extensionAttributes * @return $this */ diff --git a/Api/ExportManagementInterface.php b/Api/ExportManagementInterface.php index e576ad4..8a5b851 100644 --- a/Api/ExportManagementInterface.php +++ b/Api/ExportManagementInterface.php @@ -8,6 +8,8 @@ interface ExportManagementInterface { /** + * Export function + * * @param array|null $locale * @return ExportStats */ diff --git a/Console/Command/Export.php b/Console/Command/Export.php index 70e679b..60bfcf1 100644 --- a/Console/Command/Export.php +++ b/Console/Command/Export.php @@ -19,6 +19,11 @@ class Export extends Command */ private $exporter; + /** + * Export constructor. + * + * @param ExportManagementInterface $exporter + */ public function __construct( ExportManagementInterface $exporter ) { diff --git a/Plugin/UpdateMetadataFields.php b/Plugin/UpdateMetadataFields.php index 057d408..6880f85 100644 --- a/Plugin/UpdateMetadataFields.php +++ b/Plugin/UpdateMetadataFields.php @@ -35,6 +35,7 @@ public function afterGetFields(Subject $subject, $result, UiComponentInterface $ return $result; } + /** * @param Subject $subject * @param $result From bd34f45ff97b0e055eb31d354ce9f9423ce17f2e Mon Sep 17 00:00:00 2001 From: decelsi Date: Thu, 19 May 2022 08:42:13 +0200 Subject: [PATCH 11/47] Changed coding standard versions --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 925dc09..7215b33 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ }, "require-dev": { "friendsofphp/php-cs-fixer": "~2.14", - "magento/magento-coding-standard": "*", + "magento/magento-coding-standard": "5|8", "php-parallel-lint/php-parallel-lint": "^1.3", "phpro/grumphp-shim": "^1.5", "phpunit/phpunit": "^8.5", From 89655e3f36ae8d4d9a50f9bdcfd1824a66940e63 Mon Sep 17 00:00:00 2001 From: decelsi Date: Thu, 19 May 2022 09:33:36 +0200 Subject: [PATCH 12/47] Changed coding standards version to 21 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 7215b33..4db5a64 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ }, "require-dev": { "friendsofphp/php-cs-fixer": "~2.14", - "magento/magento-coding-standard": "5|8", + "magento/magento-coding-standard": "21", "php-parallel-lint/php-parallel-lint": "^1.3", "phpro/grumphp-shim": "^1.5", "phpunit/phpunit": "^8.5", From 8b74bbc48f5594ee633ff61104530400f5e87ea2 Mon Sep 17 00:00:00 2001 From: decelsi Date: Thu, 19 May 2022 09:50:18 +0200 Subject: [PATCH 13/47] Removed constructor doc blocks --- Console/Command/Export.php | 5 ----- Console/Command/GenerateFrontendTranslations.php | 5 ----- Console/Command/ImportFull.php | 6 ------ Console/Command/PrepareKeysCommand.php | 8 -------- Controller/Adminhtml/Translation.php | 2 +- Controller/Adminhtml/Translation/Delete.php | 2 +- Controller/Adminhtml/Translation/DoGenerate.php | 7 ------- Controller/Adminhtml/Translation/Edit.php | 10 +--------- .../Adminhtml/Translation/GenerateJson.php | 6 ------ Controller/Adminhtml/Translation/Index.php | 8 +------- Controller/Adminhtml/Translation/InlineEdit.php | 7 ------- Controller/Adminhtml/Translation/NewAction.php | 8 +------- Controller/Adminhtml/Translation/Save.php | 9 +-------- Controller/Adminhtml/Translation/SaveNew.php | 9 +-------- Model/Data/ExportStats.php | 6 ------ Model/Data/InlineGenerateStats.php | 7 ------- Model/Data/InlineGenerateStatsCollection.php | 5 ----- Model/ExportManagement.php | 9 --------- Model/Import/Translations.php | 16 ++-------------- Model/ImportManagement.php | 11 +---------- Model/InlineTranslations/FileManager.php | 10 ---------- Model/InlineTranslationsGenerator.php | 11 ----------- Model/ResourceModel/Translation.php | 2 +- Model/Translation.php | 11 ----------- Model/Translation/Source/Locales.php | 5 ----- Model/TranslationDataManagement.php | 10 ---------- Model/TranslationManagement.php | 7 ------- Model/TranslationRepository.php | 15 --------------- Model/Validator/LocaleValidator.php | 5 ----- ViewModel/JsTranslationConfig.php | 7 +------ grumphp.yml | 1 + 31 files changed, 13 insertions(+), 217 deletions(-) diff --git a/Console/Command/Export.php b/Console/Command/Export.php index 60bfcf1..70e679b 100644 --- a/Console/Command/Export.php +++ b/Console/Command/Export.php @@ -19,11 +19,6 @@ class Export extends Command */ private $exporter; - /** - * Export constructor. - * - * @param ExportManagementInterface $exporter - */ public function __construct( ExportManagementInterface $exporter ) { diff --git a/Console/Command/GenerateFrontendTranslations.php b/Console/Command/GenerateFrontendTranslations.php index c4465dd..f004bbc 100644 --- a/Console/Command/GenerateFrontendTranslations.php +++ b/Console/Command/GenerateFrontendTranslations.php @@ -20,11 +20,6 @@ class GenerateFrontendTranslations extends Command */ private $inlineTranslationsGenerator; - /** - * GenerateFrontendTranslations constructor. - * - * @param InlineTranslationsGenerator $inlineTranslations - */ public function __construct( InlineTranslationsGenerator $inlineTranslations ) { diff --git a/Console/Command/ImportFull.php b/Console/Command/ImportFull.php index 3479ddd..525c913 100644 --- a/Console/Command/ImportFull.php +++ b/Console/Command/ImportFull.php @@ -27,12 +27,6 @@ class ImportFull extends Command */ private $cacheManager; - /** - * ImportFull constructor. - * - * @param ImportManagementInterface $importer - * @param Manager $cacheManager - */ public function __construct( ImportManagementInterface $importer, Manager $cacheManager diff --git a/Console/Command/PrepareKeysCommand.php b/Console/Command/PrepareKeysCommand.php index d5ef444..e0bbbda 100644 --- a/Console/Command/PrepareKeysCommand.php +++ b/Console/Command/PrepareKeysCommand.php @@ -33,14 +33,6 @@ class PrepareKeysCommand extends Command */ private $translationDataManagement; - /** - * PrepareKeysCommand constructor. - * - * @param ResolverFactory $optionResolverFactory - * @param Parser $parser - * @param TranslationDataManagementInterface $translationDataManagement - * @param string|null $name - */ public function __construct( ResolverFactory $optionResolverFactory, Parser $parser, diff --git a/Controller/Adminhtml/Translation.php b/Controller/Adminhtml/Translation.php index e5cc9c1..7586bfc 100644 --- a/Controller/Adminhtml/Translation.php +++ b/Controller/Adminhtml/Translation.php @@ -8,7 +8,7 @@ abstract class Translation extends Action { - private const ADMIN_RESOURCE = 'Phpro_Translations::translations'; + public const ADMIN_RESOURCE = 'Phpro_Translations::translations'; /** * Init page diff --git a/Controller/Adminhtml/Translation/Delete.php b/Controller/Adminhtml/Translation/Delete.php index a91db2d..8989078 100644 --- a/Controller/Adminhtml/Translation/Delete.php +++ b/Controller/Adminhtml/Translation/Delete.php @@ -9,7 +9,7 @@ class Delete extends Translation { - private const ADMIN_RESOURCE = 'Phpro_Translations::Translation_delete'; + public const ADMIN_RESOURCE = 'Phpro_Translations::Translation_delete'; /** * @var TranslationRepositoryInterface diff --git a/Controller/Adminhtml/Translation/DoGenerate.php b/Controller/Adminhtml/Translation/DoGenerate.php index 8d1a8c9..e374cef 100644 --- a/Controller/Adminhtml/Translation/DoGenerate.php +++ b/Controller/Adminhtml/Translation/DoGenerate.php @@ -23,13 +23,6 @@ class DoGenerate extends Action */ private $cacheTypeList; - /** - * DoGenerate constructor. - * - * @param Context $context - * @param InlineTranslationsGenerator $inlineTranslationsGenerator - * @param TypeListInterface $cacheTypeList - */ public function __construct( Context $context, InlineTranslationsGenerator $inlineTranslationsGenerator, diff --git a/Controller/Adminhtml/Translation/Edit.php b/Controller/Adminhtml/Translation/Edit.php index de45305..82c3d64 100644 --- a/Controller/Adminhtml/Translation/Edit.php +++ b/Controller/Adminhtml/Translation/Edit.php @@ -12,7 +12,7 @@ class Edit extends Translation { - private const ADMIN_RESOURCE = 'Phpro_Translations::Translation_update'; + public const ADMIN_RESOURCE = 'Phpro_Translations::Translation_update'; /** * @var PageFactory @@ -29,14 +29,6 @@ class Edit extends Translation */ private $coreRegistry; - /** - * Edit constructor. - * - * @param Context $context - * @param Registry $coreRegistry - * @param PageFactory $resultPageFactory - * @param TranslationRepositoryInterface $translationRepository - */ public function __construct( Context $context, Registry $coreRegistry, diff --git a/Controller/Adminhtml/Translation/GenerateJson.php b/Controller/Adminhtml/Translation/GenerateJson.php index 0bd06d2..807fada 100644 --- a/Controller/Adminhtml/Translation/GenerateJson.php +++ b/Controller/Adminhtml/Translation/GenerateJson.php @@ -15,12 +15,6 @@ class GenerateJson extends Translation */ private $resultPageFactory; - /** - * GenerateJson constructor. - * - * @param Context $context - * @param PageFactory $resultPageFactory - */ public function __construct( Context $context, PageFactory $resultPageFactory diff --git a/Controller/Adminhtml/Translation/Index.php b/Controller/Adminhtml/Translation/Index.php index 9256e6e..2a91a3f 100644 --- a/Controller/Adminhtml/Translation/Index.php +++ b/Controller/Adminhtml/Translation/Index.php @@ -9,19 +9,13 @@ class Index extends Action { - private const ADMIN_RESOURCE = 'Phpro_Translations::Translation'; + public const ADMIN_RESOURCE = 'Phpro_Translations::Translation'; /** * @var PageFactory */ private $resultPageFactory; - /** - * Index constructor. - * - * @param Context $context - * @param PageFactory $resultPageFactory - */ public function __construct( Context $context, PageFactory $resultPageFactory diff --git a/Controller/Adminhtml/Translation/InlineEdit.php b/Controller/Adminhtml/Translation/InlineEdit.php index 4a77651..c4b8c59 100644 --- a/Controller/Adminhtml/Translation/InlineEdit.php +++ b/Controller/Adminhtml/Translation/InlineEdit.php @@ -19,13 +19,6 @@ class InlineEdit extends Action */ private $translationFactory; - /** - * InlineEdit constructor. - * - * @param Context $context - * @param JsonFactory $jsonFactory - * @param TranslationFactory $translationFactory - */ public function __construct( Context $context, JsonFactory $jsonFactory, diff --git a/Controller/Adminhtml/Translation/NewAction.php b/Controller/Adminhtml/Translation/NewAction.php index 4f5388c..129cd8b 100644 --- a/Controller/Adminhtml/Translation/NewAction.php +++ b/Controller/Adminhtml/Translation/NewAction.php @@ -9,19 +9,13 @@ class NewAction extends Translation { - private const ADMIN_RESOURCE = 'Phpro_Translations::Translation_new_action'; + public const ADMIN_RESOURCE = 'Phpro_Translations::Translation_new_action'; /** * @var PageFactory */ private $resultPageFactory; - /** - * NewAction constructor. - * - * @param Context $context - * @param PageFactory $resultPageFactory - */ public function __construct( Context $context, PageFactory $resultPageFactory diff --git a/Controller/Adminhtml/Translation/Save.php b/Controller/Adminhtml/Translation/Save.php index 2b55c99..9328d4a 100644 --- a/Controller/Adminhtml/Translation/Save.php +++ b/Controller/Adminhtml/Translation/Save.php @@ -12,7 +12,7 @@ class Save extends Action { - private const ADMIN_RESOURCE = 'Phpro_Translations::Translation_save'; + public const ADMIN_RESOURCE = 'Phpro_Translations::Translation_save'; /** * @var DataPersistorInterface @@ -24,13 +24,6 @@ class Save extends Action */ private $translationRepository; - /** - * Save constructor. - * - * @param Context $context - * @param DataPersistorInterface $dataPersistor - * @param TranslationRepositoryInterface $translationRepository - */ public function __construct( Context $context, DataPersistorInterface $dataPersistor, diff --git a/Controller/Adminhtml/Translation/SaveNew.php b/Controller/Adminhtml/Translation/SaveNew.php index 22de0cb..44ffd58 100644 --- a/Controller/Adminhtml/Translation/SaveNew.php +++ b/Controller/Adminhtml/Translation/SaveNew.php @@ -12,7 +12,7 @@ class SaveNew extends Action { - private const ADMIN_RESOURCE = 'Phpro_Translations::Translation_save'; + public const ADMIN_RESOURCE = 'Phpro_Translations::Translation_save'; /** * @var DataPersistorInterface @@ -24,13 +24,6 @@ class SaveNew extends Action */ private $translationManagement; - /** - * SaveNew constructor. - * - * @param Context $context - * @param DataPersistorInterface $dataPersistor - * @param TranslationManagement $translationManagement - */ public function __construct( Context $context, DataPersistorInterface $dataPersistor, diff --git a/Model/Data/ExportStats.php b/Model/Data/ExportStats.php index e4256e8..ec35047 100644 --- a/Model/Data/ExportStats.php +++ b/Model/Data/ExportStats.php @@ -15,12 +15,6 @@ class ExportStats */ private $totalRows; - /** - * ExportStats constructor. - * - * @param string $fileName - * @param int $totalRows - */ public function __construct(string $fileName, int $totalRows) { $this->fileName = $fileName; diff --git a/Model/Data/InlineGenerateStats.php b/Model/Data/InlineGenerateStats.php index c7172e2..935e3c2 100644 --- a/Model/Data/InlineGenerateStats.php +++ b/Model/Data/InlineGenerateStats.php @@ -18,13 +18,6 @@ class InlineGenerateStats */ public $amountGenerated; - /** - * InlineGenerateStats constructor. - * - * @param string $storeInformation - * @param int $storeId - * @param int $amountGenerated - */ public function __construct(string $storeInformation, int $storeId, int $amountGenerated) { $this->storeInformation = $storeInformation; diff --git a/Model/Data/InlineGenerateStatsCollection.php b/Model/Data/InlineGenerateStatsCollection.php index 494c5ab..18dd364 100644 --- a/Model/Data/InlineGenerateStatsCollection.php +++ b/Model/Data/InlineGenerateStatsCollection.php @@ -14,11 +14,6 @@ class InlineGenerateStatsCollection implements IteratorAggregate, Countable */ private $statsItems; - /** - * InlineGenerateStatsCollection constructor. - * - * @param InlineGenerateStats ...$statsItems - */ public function __construct(InlineGenerateStats ...$statsItems) { $this->statsItems = $statsItems; diff --git a/Model/ExportManagement.php b/Model/ExportManagement.php index 53bb0f4..d616a39 100644 --- a/Model/ExportManagement.php +++ b/Model/ExportManagement.php @@ -31,15 +31,6 @@ class ExportManagement implements ExportManagementInterface */ private $directoryList; - /** - * ExportManagement constructor. - * - * @param Csv $csv - * @param SearchCriteriaBuilder $searchCriteriaBuilder - * @param TranslationRepository $repository - * @param DirectoryList $directoryList - * @param TimezoneInterface $time - */ public function __construct( Csv $csv, SearchCriteriaBuilder $searchCriteriaBuilder, diff --git a/Model/Import/Translations.php b/Model/Import/Translations.php index aa5b31f..4c18574 100644 --- a/Model/Import/Translations.php +++ b/Model/Import/Translations.php @@ -15,9 +15,6 @@ class Translations extends AbstractEntity { - private const ENTITY_CODE = 'translations'; - private const TABLE = 'translation'; - public const COL_KEY = 'string'; public const COL_TRANSLATION = 'translate'; public const COL_LOCALE = 'locale'; @@ -25,6 +22,8 @@ class Translations extends AbstractEntity public const HEADER_KEY = 'key'; public const HEADER_TRANSLATION = 'translation'; public const HEADER_LOCALE = 'locale'; + private const ENTITY_CODE = 'translations'; + private const TABLE = 'translation'; /** * @var string[] @@ -59,17 +58,6 @@ class Translations extends AbstractEntity */ private $localeValidator; - /** - * Translations constructor. - * - * @param JsonHelper $jsonHelper - * @param ImportHelper $importExportData - * @param Data $importData - * @param ResourceConnection $resource - * @param Helper $resourceHelper - * @param ProcessingErrorAggregatorInterface $errorAggregator - * @param LocaleValidator $localeValidator - */ public function __construct( JsonHelper $jsonHelper, ImportHelper $importExportData, diff --git a/Model/ImportManagement.php b/Model/ImportManagement.php index 62fc22f..b92b2d7 100644 --- a/Model/ImportManagement.php +++ b/Model/ImportManagement.php @@ -35,15 +35,6 @@ class ImportManagement implements ImportManagementInterface */ private $importStatsFactory; - /** - * ImportManagement constructor. - * - * @param Csv $csv - * @param LocaleValidator $localeValidator - * @param TranslationFactory $translationFactory - * @param TranslationRepository $repository - * @param ImportStatsFactory $importStatsFactory - */ public function __construct( Csv $csv, LocaleValidator $localeValidator, @@ -61,8 +52,8 @@ public function __construct( /** * @param string $filePath * @param string $locale - * @return ImportStats * @throws \Exception + * @return ImportStats */ public function importMagentoCsv(string $filePath, string $locale): ImportStats { diff --git a/Model/InlineTranslations/FileManager.php b/Model/InlineTranslations/FileManager.php index 16c1615..ac683a5 100644 --- a/Model/InlineTranslations/FileManager.php +++ b/Model/InlineTranslations/FileManager.php @@ -46,16 +46,6 @@ class FileManager */ private $date; - /** - * FileManager constructor. - * - * @param Json $serializer - * @param DirectoryList $directoryList - * @param Filesystem $filesystem - * @param File $driverFile - * @param UrlInterface $urlGenerator - * @param TimezoneInterface $dateTime - */ public function __construct( Json $serializer, DirectoryList $directoryList, diff --git a/Model/InlineTranslationsGenerator.php b/Model/InlineTranslationsGenerator.php index 52ae79c..72d6379 100644 --- a/Model/InlineTranslationsGenerator.php +++ b/Model/InlineTranslationsGenerator.php @@ -45,17 +45,6 @@ class InlineTranslationsGenerator */ private $systemStore; - /** - * InlineTranslationsGenerator constructor. - * - * @param DataProviderInterface $dataProvider - * @param State $state - * @param TranslateInterface $translate - * @param FileManager $fileManager - * @param Emulation $emulation - * @param DesignInterface $viewDesign - * @param SystemStore $systemStore - */ public function __construct( DataProviderInterface $dataProvider, State $state, diff --git a/Model/ResourceModel/Translation.php b/Model/ResourceModel/Translation.php index 6fc11a0..5dbab9a 100644 --- a/Model/ResourceModel/Translation.php +++ b/Model/ResourceModel/Translation.php @@ -10,8 +10,8 @@ class Translation extends AbstractDb /** * @param string $translationKey * @param array $locales - * @return $this * @throws \Exception + * @return $this */ public function deleteByTranslationKeyAndLocales(string $translationKey, array $locales) { diff --git a/Model/Translation.php b/Model/Translation.php index b98c805..3d9e7eb 100644 --- a/Model/Translation.php +++ b/Model/Translation.php @@ -23,17 +23,6 @@ class Translation extends AbstractModel */ private $dataObjectHelper; - /** - * Translation constructor. - * - * @param Context $context - * @param Registry $registry - * @param TranslationInterfaceFactory $translationDataFactory - * @param DataObjectHelper $dataObjectHelper - * @param ResourceModel\Translation $resource - * @param ResourceModel\Translation\Collection $resourceCollection - * @param array $data - */ public function __construct( Context $context, Registry $registry, diff --git a/Model/Translation/Source/Locales.php b/Model/Translation/Source/Locales.php index a93a158..5d08ac4 100644 --- a/Model/Translation/Source/Locales.php +++ b/Model/Translation/Source/Locales.php @@ -15,11 +15,6 @@ class Locales implements OptionSourceInterface */ private $resourceConnection; - /** - * Locales constructor. - * - * @param ResourceConnection $resourceConnection - */ public function __construct(ResourceConnection $resourceConnection) { $this->resourceConnection = $resourceConnection; diff --git a/Model/TranslationDataManagement.php b/Model/TranslationDataManagement.php index afc9ad6..387c059 100644 --- a/Model/TranslationDataManagement.php +++ b/Model/TranslationDataManagement.php @@ -40,16 +40,6 @@ class TranslationDataManagement implements TranslationDataManagementInterface */ private $throwException; - /** - * TranslationDataManagement constructor. - * - * @param LoggerInterface $logger - * @param LocaleValidator $localeValidator - * @param LocaleSource $localeSource - * @param TranslationFactory $translationFactory - * @param TranslationRepository $repository - * @param bool $throwException - */ public function __construct( LoggerInterface $logger, LocaleValidator $localeValidator, diff --git a/Model/TranslationManagement.php b/Model/TranslationManagement.php index 043e3eb..3f9e877 100644 --- a/Model/TranslationManagement.php +++ b/Model/TranslationManagement.php @@ -21,13 +21,6 @@ class TranslationManagement */ private $repository; - /** - * TranslationManagement constructor. - * - * @param LocaleValidator $localeValidator - * @param TranslationFactory $translationFactory - * @param TranslationRepository $repository - */ public function __construct( LocaleValidator $localeValidator, TranslationFactory $translationFactory, diff --git a/Model/TranslationRepository.php b/Model/TranslationRepository.php index 5ff01e3..dcde311 100644 --- a/Model/TranslationRepository.php +++ b/Model/TranslationRepository.php @@ -67,21 +67,6 @@ class TranslationRepository implements TranslationRepositoryInterface */ private $extensibleDataObjectConverter; - /** - * TranslationRepository constructor. - * - * @param ResourceTranslation $resource - * @param TranslationFactory $translationFactory - * @param TranslationInterfaceFactory $dataTranslationFactory - * @param TranslationCollectionFactory $translationCollectionFactory - * @param TranslationSearchResultsInterfaceFactory $searchResultsFactory - * @param DataObjectHelper $dataObjectHelper - * @param DataObjectProcessor $dataObjectProcessor - * @param StoreManagerInterface $storeManager - * @param CollectionProcessorInterface $collectionProcessor - * @param JoinProcessorInterface $extensionAttributesJoinProcessor - * @param ExtensibleDataObjectConverter $extensibleDataObjectConverter - */ public function __construct( ResourceTranslation $resource, TranslationFactory $translationFactory, diff --git a/Model/Validator/LocaleValidator.php b/Model/Validator/LocaleValidator.php index ccee70c..af34dd2 100644 --- a/Model/Validator/LocaleValidator.php +++ b/Model/Validator/LocaleValidator.php @@ -17,11 +17,6 @@ class LocaleValidator */ private $locales = []; - /** - * LocaleValidator constructor. - * - * @param ListsInterface $localeLists - */ public function __construct(ListsInterface $localeLists) { $this->localeLists = $localeLists; diff --git a/ViewModel/JsTranslationConfig.php b/ViewModel/JsTranslationConfig.php index f3ba38d..0d5c61d 100644 --- a/ViewModel/JsTranslationConfig.php +++ b/ViewModel/JsTranslationConfig.php @@ -17,12 +17,7 @@ class JsTranslationConfig implements ArgumentInterface * @var DesignInterface */ private $design; - - /** - * JsTranslationConfig constructor. - * @param FileManager $fileManager - * @param DesignInterface $design - */ + public function __construct( FileManager $fileManager, DesignInterface $design diff --git a/grumphp.yml b/grumphp.yml index 71259bd..66f40ab 100644 --- a/grumphp.yml +++ b/grumphp.yml @@ -18,6 +18,7 @@ grumphp: - Magento2.Translation.ConstantUsage - Magento2.NamingConvention.ReservedWords triggered_by: [php] + warning_severity: 0 phpunit: always_execute: true file_size: From 0634597886932c579c9331e024d39f6f56d0832b Mon Sep 17 00:00:00 2001 From: decelsi Date: Thu, 19 May 2022 09:56:41 +0200 Subject: [PATCH 14/47] Upgraded friendsofphp --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 4db5a64..b80f2f2 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "magento/module-ui": "^101.1" }, "require-dev": { - "friendsofphp/php-cs-fixer": "~2.14", + "friendsofphp/php-cs-fixer": "3.3.0", "magento/magento-coding-standard": "21", "php-parallel-lint/php-parallel-lint": "^1.3", "phpro/grumphp-shim": "^1.5", From 98d81a903a3e96c2962ea1364ad0d2be2a1ef2f9 Mon Sep 17 00:00:00 2001 From: decelsi Date: Thu, 19 May 2022 09:59:45 +0200 Subject: [PATCH 15/47] Upgraded friendsofphp --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index b80f2f2..5438fa1 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "magento/module-ui": "^101.1" }, "require-dev": { - "friendsofphp/php-cs-fixer": "3.3.0", + "friendsofphp/php-cs-fixer": "~2.14|3.3.0", "magento/magento-coding-standard": "21", "php-parallel-lint/php-parallel-lint": "^1.3", "phpro/grumphp-shim": "^1.5", From ad1c07c40ba6874160c80020efb03c0c8849e9f4 Mon Sep 17 00:00:00 2001 From: decelsi Date: Thu, 19 May 2022 10:02:20 +0200 Subject: [PATCH 16/47] Upgraded friendsofphp --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 5438fa1..034ed36 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "magento/module-ui": "^101.1" }, "require-dev": { - "friendsofphp/php-cs-fixer": "~2.14|3.3.0", + "friendsofphp/php-cs-fixer": "~2.19.3", "magento/magento-coding-standard": "21", "php-parallel-lint/php-parallel-lint": "^1.3", "phpro/grumphp-shim": "^1.5", From 5c76f12e9ebf1189e6e1347611fa6516c40fd80a Mon Sep 17 00:00:00 2001 From: decelsi Date: Thu, 19 May 2022 10:05:01 +0200 Subject: [PATCH 17/47] Upgraded friendsofphp --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 034ed36..f65a14d 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "magento/module-ui": "^101.1" }, "require-dev": { - "friendsofphp/php-cs-fixer": "~2.19.3", + "friendsofphp/php-cs-fixer": "~2.19.3 || 3.7.0", "magento/magento-coding-standard": "21", "php-parallel-lint/php-parallel-lint": "^1.3", "phpro/grumphp-shim": "^1.5", From b01226232a9f7c4cef7ee54ab9331f28bfbc6202 Mon Sep 17 00:00:00 2001 From: decelsi Date: Thu, 19 May 2022 10:08:22 +0200 Subject: [PATCH 18/47] Upgraded friendsofphp --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index f65a14d..1d93944 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "magento/module-ui": "^101.1" }, "require-dev": { - "friendsofphp/php-cs-fixer": "~2.19.3 || 3.7.0", + "friendsofphp/php-cs-fixer": "~2.19.3|3.8.0", "magento/magento-coding-standard": "21", "php-parallel-lint/php-parallel-lint": "^1.3", "phpro/grumphp-shim": "^1.5", From cb53158dd2d75df15bd5615c56b142f60da310f9 Mon Sep 17 00:00:00 2001 From: decelsi Date: Thu, 19 May 2022 10:10:21 +0200 Subject: [PATCH 19/47] Upgraded friendsofphp --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 1d93944..e538542 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "magento/module-ui": "^101.1" }, "require-dev": { - "friendsofphp/php-cs-fixer": "~2.19.3|3.8.0", + "friendsofphp/php-cs-fixer": "3.8.0", "magento/magento-coding-standard": "21", "php-parallel-lint/php-parallel-lint": "^1.3", "phpro/grumphp-shim": "^1.5", From 44452d8d4483b26835c0f95bd309e349c32f65d1 Mon Sep 17 00:00:00 2001 From: decelsi Date: Thu, 19 May 2022 10:11:33 +0200 Subject: [PATCH 20/47] Upgraded friendsofphp --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index e538542..1d93944 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "magento/module-ui": "^101.1" }, "require-dev": { - "friendsofphp/php-cs-fixer": "3.8.0", + "friendsofphp/php-cs-fixer": "~2.19.3|3.8.0", "magento/magento-coding-standard": "21", "php-parallel-lint/php-parallel-lint": "^1.3", "phpro/grumphp-shim": "^1.5", From 19721a2e227dc6eb4b92ea12941554cb35939c4b Mon Sep 17 00:00:00 2001 From: decelsi Date: Thu, 19 May 2022 10:14:44 +0200 Subject: [PATCH 21/47] Added friendsofphp/php-cs-fixer ^3.8.0 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 1d93944..624ff9b 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "magento/module-ui": "^101.1" }, "require-dev": { - "friendsofphp/php-cs-fixer": "~2.19.3|3.8.0", + "friendsofphp/php-cs-fixer": "~2.19.3|^3.8.0", "magento/magento-coding-standard": "21", "php-parallel-lint/php-parallel-lint": "^1.3", "phpro/grumphp-shim": "^1.5", From 2d633d1a83347d75225e8195fac561cf486e931b Mon Sep 17 00:00:00 2001 From: decelsi Date: Thu, 19 May 2022 10:20:35 +0200 Subject: [PATCH 22/47] Changed PHP and cs fixer version --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 624ff9b..fefd132 100644 --- a/composer.json +++ b/composer.json @@ -11,13 +11,13 @@ } ], "require": { - "php": "^7.3|^8.1", + "php": "^7.4|^8.1", "magento/framework": "^102.0|^103.0", "magento/module-backend": "^101.0|^102.0", "magento/module-ui": "^101.1" }, "require-dev": { - "friendsofphp/php-cs-fixer": "~2.19.3|^3.8.0", + "friendsofphp/php-cs-fixer": "^3.8.0", "magento/magento-coding-standard": "21", "php-parallel-lint/php-parallel-lint": "^1.3", "phpro/grumphp-shim": "^1.5", From 3d1ae8733e9507aa1c09c7c71072180c268018e5 Mon Sep 17 00:00:00 2001 From: decelsi Date: Thu, 19 May 2022 10:22:51 +0200 Subject: [PATCH 23/47] Changed PHP and cs fixer version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index fefd132..ad2ea82 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "magento/module-ui": "^101.1" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.8.0", + "friendsofphp/php-cs-fixer": "^3.4.0", "magento/magento-coding-standard": "21", "php-parallel-lint/php-parallel-lint": "^1.3", "phpro/grumphp-shim": "^1.5", From b7cdaff3d3e55a50f79abca3d7fe5094f0169cbb Mon Sep 17 00:00:00 2001 From: decelsi Date: Thu, 19 May 2022 10:25:43 +0200 Subject: [PATCH 24/47] Changed PHP and cs fixer version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index ad2ea82..7d9c5a1 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "magento/module-ui": "^101.1" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.4.0", + "friendsofphp/php-cs-fixer": "^3.5.0", "magento/magento-coding-standard": "21", "php-parallel-lint/php-parallel-lint": "^1.3", "phpro/grumphp-shim": "^1.5", From 0a62f33ddf4823b698f51b24ed4362c3b072bc82 Mon Sep 17 00:00:00 2001 From: decelsi Date: Thu, 19 May 2022 10:27:05 +0200 Subject: [PATCH 25/47] Removed PHP 7.3 from grumphp.yml --- .github/workflows/grumphp.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/grumphp.yml b/.github/workflows/grumphp.yml index cc238d4..d540a3d 100644 --- a/.github/workflows/grumphp.yml +++ b/.github/workflows/grumphp.yml @@ -8,7 +8,6 @@ jobs: fail-fast: true matrix: php-versions: - - "7.3" - "7.4" - "8.1" dependencies: From 485a0b34b5f8c901c8b30b93093f5ea9804eaa4e Mon Sep 17 00:00:00 2001 From: decelsi Date: Thu, 19 May 2022 10:34:45 +0200 Subject: [PATCH 26/47] Changed PHP version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 7d9c5a1..e1cc92b 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ } ], "require": { - "php": "^7.4|^8.1", + "php": "~7.4||^8.1", "magento/framework": "^102.0|^103.0", "magento/module-backend": "^101.0|^102.0", "magento/module-ui": "^101.1" From 22b2b07c1db00c80874bb490b4a92c04af2aa1e5 Mon Sep 17 00:00:00 2001 From: decelsi Date: Thu, 19 May 2022 10:36:14 +0200 Subject: [PATCH 27/47] Changed PHP and cs fixer version --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index e1cc92b..3cdc985 100644 --- a/composer.json +++ b/composer.json @@ -11,13 +11,13 @@ } ], "require": { - "php": "~7.4||^8.1", + "php": "^7.4||^8.1", "magento/framework": "^102.0|^103.0", "magento/module-backend": "^101.0|^102.0", "magento/module-ui": "^101.1" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.5.0", + "friendsofphp/php-cs-fixer": "3.5.0", "magento/magento-coding-standard": "21", "php-parallel-lint/php-parallel-lint": "^1.3", "phpro/grumphp-shim": "^1.5", From c3b543f0ec186d963993b37978a7f8a70c84052f Mon Sep 17 00:00:00 2001 From: decelsi Date: Thu, 19 May 2022 10:38:49 +0200 Subject: [PATCH 28/47] Changed PHP version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 3cdc985..339c562 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ } ], "require": { - "php": "^7.4||^8.1", + "php": "^7.4|^8.1", "magento/framework": "^102.0|^103.0", "magento/module-backend": "^101.0|^102.0", "magento/module-ui": "^101.1" From 570ff683e95be3df1acf468f19004746b8b949da Mon Sep 17 00:00:00 2001 From: decelsi Date: Thu, 19 May 2022 10:42:18 +0200 Subject: [PATCH 29/47] Changed PHP version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 339c562..120190b 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ } ], "require": { - "php": "^7.4|^8.1", + "php": "^7.3|^8.1", "magento/framework": "^102.0|^103.0", "magento/module-backend": "^101.0|^102.0", "magento/module-ui": "^101.1" From d305c7c12b928e615c7d222e964160b50ffb143d Mon Sep 17 00:00:00 2001 From: decelsi Date: Thu, 19 May 2022 10:49:14 +0200 Subject: [PATCH 30/47] Upgraded magento/module-backend and magento/module-ui --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 120190b..d331b4b 100644 --- a/composer.json +++ b/composer.json @@ -11,10 +11,10 @@ } ], "require": { - "php": "^7.3|^8.1", + "php": "~7.4.0||~8.1.0", "magento/framework": "^102.0|^103.0", - "magento/module-backend": "^101.0|^102.0", - "magento/module-ui": "^101.1" + "magento/module-backend": "^102.0|^103.0", + "magento/module-ui": "^102.0|^103.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "3.5.0", From 4ab7f943406b16a07c3b27b9102251fde911b293 Mon Sep 17 00:00:00 2001 From: decelsi Date: Thu, 19 May 2022 10:51:47 +0200 Subject: [PATCH 31/47] Changed PHP version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index d331b4b..5625378 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ } ], "require": { - "php": "~7.4.0||~8.1.0", + "php": "^7.4|^8.1", "magento/framework": "^102.0|^103.0", "magento/module-backend": "^102.0|^103.0", "magento/module-ui": "^102.0|^103.0" From 20baa50e24fe8782bb5ab0cf554f818aabd46af5 Mon Sep 17 00:00:00 2001 From: decelsi Date: Thu, 19 May 2022 10:56:43 +0200 Subject: [PATCH 32/47] Upgraded magento/module-backend and magento/module-ui --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 5625378..cd871f9 100644 --- a/composer.json +++ b/composer.json @@ -13,8 +13,8 @@ "require": { "php": "^7.4|^8.1", "magento/framework": "^102.0|^103.0", - "magento/module-backend": "^102.0|^103.0", - "magento/module-ui": "^102.0|^103.0" + "magento/module-backend": "^101.2|^102.0", + "magento/module-ui": "^101.2" }, "require-dev": { "friendsofphp/php-cs-fixer": "3.5.0", From 79694611a33012b368e8dfe61b80d505ec8dfa76 Mon Sep 17 00:00:00 2001 From: decelsi Date: Thu, 19 May 2022 10:57:53 +0200 Subject: [PATCH 33/47] Upgraded magento/module-backend and magento/module-ui --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index cd871f9..5625378 100644 --- a/composer.json +++ b/composer.json @@ -13,8 +13,8 @@ "require": { "php": "^7.4|^8.1", "magento/framework": "^102.0|^103.0", - "magento/module-backend": "^101.2|^102.0", - "magento/module-ui": "^101.2" + "magento/module-backend": "^102.0|^103.0", + "magento/module-ui": "^102.0|^103.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "3.5.0", From dc0bcde5bfb392ebe48bf5b4ce9d7d6d498f3b87 Mon Sep 17 00:00:00 2001 From: decelsi Date: Thu, 19 May 2022 11:00:41 +0200 Subject: [PATCH 34/47] Changed magento/module-ui version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 5625378..76b6fda 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "php": "^7.4|^8.1", "magento/framework": "^102.0|^103.0", "magento/module-backend": "^102.0|^103.0", - "magento/module-ui": "^102.0|^103.0" + "magento/module-ui": "101.2.*" }, "require-dev": { "friendsofphp/php-cs-fixer": "3.5.0", From 9cabf92791c122d221e2fef829407f4dda6b2c10 Mon Sep 17 00:00:00 2001 From: decelsi Date: Thu, 19 May 2022 11:01:52 +0200 Subject: [PATCH 35/47] Changed PHP version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 76b6fda..d64ad86 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ } ], "require": { - "php": "^7.4|^8.1", + "php": "^7.3|^8.1", "magento/framework": "^102.0|^103.0", "magento/module-backend": "^102.0|^103.0", "magento/module-ui": "101.2.*" From 9a49c8d8186e3746430a251d47de4f57a3ce49bb Mon Sep 17 00:00:00 2001 From: decelsi Date: Thu, 19 May 2022 11:04:18 +0200 Subject: [PATCH 36/47] Changed module-ui version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index d64ad86..bf215fe 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "php": "^7.3|^8.1", "magento/framework": "^102.0|^103.0", "magento/module-backend": "^102.0|^103.0", - "magento/module-ui": "101.2.*" + "magento/module-ui": "^101.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "3.5.0", From 800a978c30d2f69627846089613abeab1480e3f1 Mon Sep 17 00:00:00 2001 From: decelsi Date: Thu, 19 May 2022 11:09:04 +0200 Subject: [PATCH 37/47] Changed module-ui version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index bf215fe..380daf4 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ } ], "require": { - "php": "^7.3|^8.1", + "php": "~7.4.0|^8.1", "magento/framework": "^102.0|^103.0", "magento/module-backend": "^102.0|^103.0", "magento/module-ui": "^101.0" From d8ffe5bef4a8008d4acf1b1ef107bb93514dea5b Mon Sep 17 00:00:00 2001 From: decelsi Date: Thu, 19 May 2022 11:12:02 +0200 Subject: [PATCH 38/47] Changed PHP version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 380daf4..70f81e0 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ } ], "require": { - "php": "~7.4.0|^8.1", + "php": "~7.4.0 || ^8.1", "magento/framework": "^102.0|^103.0", "magento/module-backend": "^102.0|^103.0", "magento/module-ui": "^101.0" From 4a354b1bde13f09605964bdc687382c270970034 Mon Sep 17 00:00:00 2001 From: decelsi Date: Thu, 19 May 2022 11:13:25 +0200 Subject: [PATCH 39/47] Changed PHP version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 70f81e0..54b2c34 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ "require": { "php": "~7.4.0 || ^8.1", "magento/framework": "^102.0|^103.0", - "magento/module-backend": "^102.0|^103.0", + "magento/module-backend": "^102.2|^103.0", "magento/module-ui": "^101.0" }, "require-dev": { From 1c6d1da927afe4f23278fdeea9cb62f06dc7d701 Mon Sep 17 00:00:00 2001 From: decelsi Date: Thu, 19 May 2022 11:14:49 +0200 Subject: [PATCH 40/47] Upgraded magento/module-backend and magento/module-ui --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 54b2c34..3922928 100644 --- a/composer.json +++ b/composer.json @@ -13,8 +13,8 @@ "require": { "php": "~7.4.0 || ^8.1", "magento/framework": "^102.0|^103.0", - "magento/module-backend": "^102.2|^103.0", - "magento/module-ui": "^101.0" + "magento/module-backend": "^102.0.4|^103.0", + "magento/module-ui": "^101.2" }, "require-dev": { "friendsofphp/php-cs-fixer": "3.5.0", From c1ee4ff1601f034397a709ded3a980a7fdeb61ff Mon Sep 17 00:00:00 2001 From: decelsi Date: Thu, 19 May 2022 11:17:30 +0200 Subject: [PATCH 41/47] Changed PHP version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 3922928..d2d562f 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ } ], "require": { - "php": "~7.4.0 || ^8.1", + "php": "^7.0 || ^8.1", "magento/framework": "^102.0|^103.0", "magento/module-backend": "^102.0.4|^103.0", "magento/module-ui": "^101.2" From 9a12f5b7f3b823cb75a99409344ff4ec8f39df46 Mon Sep 17 00:00:00 2001 From: decelsi Date: Thu, 19 May 2022 11:18:52 +0200 Subject: [PATCH 42/47] Upgraded magento/module-backend and magento/module-ui --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index d2d562f..f63e5a1 100644 --- a/composer.json +++ b/composer.json @@ -11,10 +11,10 @@ } ], "require": { - "php": "^7.0 || ^8.1", + "php": "^7.4 || ^8.1", "magento/framework": "^102.0|^103.0", - "magento/module-backend": "^102.0.4|^103.0", - "magento/module-ui": "^101.2" + "magento/module-backend": "^101.0|^102.0", + "magento/module-ui": "^101.0|^102.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "3.5.0", From 8f1c6928e4b6b366863d4b15101bf38e1fc62d37 Mon Sep 17 00:00:00 2001 From: decelsi Date: Thu, 19 May 2022 11:20:24 +0200 Subject: [PATCH 43/47] Changed PHP version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index f63e5a1..63d2e22 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ } ], "require": { - "php": "^7.4 || ^8.1", + "php": "^7.3 || ^8.1", "magento/framework": "^102.0|^103.0", "magento/module-backend": "^101.0|^102.0", "magento/module-ui": "^101.0|^102.0" From 9f3be1996e994d88f7bead3588bc34c6f3df060d Mon Sep 17 00:00:00 2001 From: decelsi Date: Thu, 19 May 2022 11:22:00 +0200 Subject: [PATCH 44/47] Changed PHP version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 63d2e22..6a08617 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ } ], "require": { - "php": "^7.3 || ^8.1", + "php": "^7.3|^8.1", "magento/framework": "^102.0|^103.0", "magento/module-backend": "^101.0|^102.0", "magento/module-ui": "^101.0|^102.0" From 6367c76ea4b7da21e8f21f35e698c7c08471b2aa Mon Sep 17 00:00:00 2001 From: decelsi Date: Thu, 19 May 2022 11:41:05 +0200 Subject: [PATCH 45/47] Updated friendsofphp/php-cs-fixer versions --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 6a08617..fdb0e92 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "magento/module-ui": "^101.0|^102.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "3.5.0", + "friendsofphp/php-cs-fixer": "~2.14|~3.5", "magento/magento-coding-standard": "21", "php-parallel-lint/php-parallel-lint": "^1.3", "phpro/grumphp-shim": "^1.5", From 7554b3ffb285b7061322df78241153277ee65b37 Mon Sep 17 00:00:00 2001 From: decelsi Date: Thu, 19 May 2022 11:54:04 +0200 Subject: [PATCH 46/47] Updated .php-cs-fixer.php --- .php_cs => .php-cs-fixer.php | 12 +++++------- composer.json | 4 ++-- grumphp.yml | 2 +- 3 files changed, 8 insertions(+), 10 deletions(-) rename .php_cs => .php-cs-fixer.php (91%) diff --git a/.php_cs b/.php-cs-fixer.php similarity index 91% rename from .php_cs rename to .php-cs-fixer.php index cecf418..8f7e7ad 100644 --- a/.php_cs +++ b/.php-cs-fixer.php @@ -2,14 +2,14 @@ /** * PHP Coding Standards fixer configuration */ -use PhpCsFixer\Config; -use PhpCsFixer\Finder; -$finder = Finder::create() +$finder = PhpCsFixer\Finder::create() ->in('./') ->name(['*.php']); -return Config::create() +return (new PhpCsFixer\Config()) + ->setRiskyAllowed(true) + ->setUsingCache(false) ->setRules([ '@PSR2' => true, 'no_useless_else' => true, @@ -40,7 +40,5 @@ 'compact_nullable_typehint' => true, 'fully_qualified_strict_types' => true, ]) - ->setFinder($finder) - ->setRiskyAllowed(true) - ->setUsingCache(false); + ->setFinder($finder); diff --git a/composer.json b/composer.json index fdb0e92..fb08d06 100644 --- a/composer.json +++ b/composer.json @@ -11,13 +11,13 @@ } ], "require": { - "php": "^7.3|^8.1", + "php": "~7.4.0||~8.1.0", "magento/framework": "^102.0|^103.0", "magento/module-backend": "^101.0|^102.0", "magento/module-ui": "^101.0|^102.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "~2.14|~3.5", + "friendsofphp/php-cs-fixer": "~3.3.0", "magento/magento-coding-standard": "21", "php-parallel-lint/php-parallel-lint": "^1.3", "phpro/grumphp-shim": "^1.5", diff --git a/grumphp.yml b/grumphp.yml index 66f40ab..4f56c0c 100644 --- a/grumphp.yml +++ b/grumphp.yml @@ -2,7 +2,7 @@ grumphp: tasks: phpcsfixer: config_contains_finder: true - config: .php_cs + config: .php-cs-fixer.php triggered_by: [php] phplint: triggered_by: [php] From 483bdcea5a4eb346fcba6c0c0e14a6f038d6b55c Mon Sep 17 00:00:00 2001 From: decelsi Date: Thu, 19 May 2022 12:25:18 +0200 Subject: [PATCH 47/47] Changed friendsofphp/php-cs-fixer version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index fb08d06..fba2807 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "magento/module-ui": "^101.0|^102.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "~3.3.0", + "friendsofphp/php-cs-fixer": "~3.4.0", "magento/magento-coding-standard": "21", "php-parallel-lint/php-parallel-lint": "^1.3", "phpro/grumphp-shim": "^1.5",