Skip to content

Commit

Permalink
PHPRO-415 Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
BrentRobert committed Jul 1, 2024
1 parent 5faa0bc commit 08c61a2
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 43 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/grumphp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
fail-fast: true
matrix:
php-versions:
- "8.1"
- "8.3"
dependencies:
- "lowest"
steps:
Expand All @@ -27,4 +27,4 @@ jobs:
run: composer install

- name: GrumPHP
run: ./vendor/bin/grumphp run
run: ./vendor/bin/grumphp run
4 changes: 2 additions & 2 deletions Api/Data/TranslationInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ public function setFrontend($frontend);
/**
* Retrieve existing extension attributes object or create a new one.
*
* @return \Phpro\Translations\Api\Data\TranslationExtensionInterface|null
* @return TranslationExtensionInterface|null
*/
public function getExtensionAttributes();

/**
* Set an extension attributes object.
*
* @param \Phpro\Translations\Api\Data\TranslationExtensionInterface $extensionAttributes
* @param TranslationExtensionInterface $extensionAttributes
* @return $this
*/
public function setExtensionAttributes(
Expand Down
10 changes: 5 additions & 5 deletions Api/TranslationRepositoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ interface TranslationRepositoryInterface
/**
* Save Translation
*
* @param \Phpro\Translations\Api\Data\TranslationInterface $translation
* @param Data\TranslationInterface $translation
* @throws \Magento\Framework\Exception\LocalizedException
* @return \Phpro\Translations\Api\Data\TranslationInterface
* @return Data\TranslationInterface
*/
public function save(
Data\TranslationInterface $translation
Expand All @@ -24,16 +24,16 @@ public function save(
*
* @param string $translationId
* @throws \Magento\Framework\Exception\LocalizedException
* @return \Phpro\Translations\Api\Data\TranslationInterface
* @return Data\TranslationInterface
*/
public function getById($translationId);

/**
* Retrieve Translation matching the specified criteria.
*
* @param \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria
* @param SearchCriteriaInterface $searchCriteria
* @throws \Magento\Framework\Exception\LocalizedException
* @return \Phpro\Translations\Api\Data\TranslationSearchResultsInterface
* @return Data\TranslationSearchResultsInterface
*/
public function getList(
SearchCriteriaInterface $searchCriteria
Expand Down
2 changes: 1 addition & 1 deletion Block/Adminhtml/Translation/Edit/GenericButton.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ abstract class GenericButton
protected $context;

/**
* @param \Magento\Backend\Block\Widget\Context $context
* @param Context $context
*/
public function __construct(Context $context)
{
Expand Down
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@
## [1.2.2] - 2022-10-14
### Added
- Hyva support: remove requirejs from head.additional
-

## [1.3.0] - 2024-03-28
### Updated
- PHP ^8.1 compatibility

## [1.4.0] - 2024-06-05
### Updated
- Set minimum PHP version to 8.3
### Bugfix
- Fix return types console commands
- Locales are not found if set in env.php and not in core_config_table
- Locales are not found if set in env.php and not in core_config_table
6 changes: 2 additions & 4 deletions Console/Command/Export.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ protected function configure(): void
*/
protected function execute(InputInterface $input, OutputInterface $output): int
{
$exitCode = 0;

try {
$locales = $input->getArgument(self::ARGUMENT_LOCALES);

Expand All @@ -63,9 +61,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$output->writeln('<info>Done!</info>');
} catch (\Exception $e) {
$output->writeln('<error>' . $e->getMessage() . '</error>');
$exitCode = 1;
return Command::FAILURE;
}

return $exitCode;
return Command::SUCCESS;
}
}
6 changes: 2 additions & 4 deletions Console/Command/GenerateFrontendTranslations.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ protected function configure(): void
*/
protected function execute(InputInterface $input, OutputInterface $output): int
{
$exitCode = 0;

try {
$storeId = (int)$input->getArgument('storeId');
$statsCollection = $this->generatedTranslations($storeId);
Expand All @@ -64,10 +62,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$output->writeln('<info>Please clean full_page and block_html caches manually</info>');
} catch (\Exception $e) {
$output->writeln('<error>' . $e->getMessage() . '</error>');
$exitCode = 1;
return Command::FAILURE;
}

return $exitCode;
return Command::SUCCESS;
}

/**
Expand Down
6 changes: 2 additions & 4 deletions Console/Command/Import.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ protected function configure(): void
*/
protected function execute(InputInterface $input, OutputInterface $output): int
{
$exitCode = 0;

try {
$csvFile = $input->getArgument(self::ARGUMENT_CSV_FILE);
$locale = $input->getArgument(self::ARGUMENT_LOCALE);
Expand Down Expand Up @@ -86,9 +84,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$output->writeln('<info>Done!</info>');
} catch (\Exception $e) {
$output->writeln('<error>' . $e->getMessage() . '</error>');
$exitCode = 1;
return Command::FAILURE;
}

return $exitCode;
return Command::SUCCESS;
}
}
6 changes: 2 additions & 4 deletions Console/Command/ImportFull.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ protected function configure(): void
*/
protected function execute(InputInterface $input, OutputInterface $output): int
{
$exitCode = 0;

try {
$csvFile = $input->getArgument(self::ARGUMENT_CSV_FILE);

Expand All @@ -82,9 +80,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$output->writeln('<info>Done!</info>');
} catch (\Exception $e) {
$output->writeln('<error>' . $e->getMessage() . '</error>');
$exitCode = 1;
return Command::FAILURE;
}

return $exitCode;
return Command::SUCCESS;
}
}
6 changes: 2 additions & 4 deletions Console/Command/PrepareKeysCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ protected function configure()
*/
protected function execute(InputInterface $input, OutputInterface $output): int
{
$exitCode = 0;

try {
$phraseCollector = new PhraseCollector(new Tokenizer());
$adapters = [
Expand All @@ -91,9 +89,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$output->writeln('<info>Keys successfully created.</info>');
} catch (\Exception $e) {
$output->writeln('<error>' . $e->getMessage() . '</error>');
$exitCode = 1;
return Command::FAILURE;
}

return $exitCode;
return Command::SUCCESS;
}
}
19 changes: 10 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@
}
],
"require": {
"php": "^8.1",
"php": "^8.3",
"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": "~3.4.0",
"magento/magento-coding-standard": "21",
"friendsofphp/php-cs-fixer": "~3.59.0",
"magento/magento-coding-standard": "^33",
"php-parallel-lint/php-parallel-lint": "^1.3",
"phpro/grumphp-shim": "^1.5",
"phpunit/phpunit": "^8.5",
"squizlabs/php_codesniffer": "~3.4"
"phpro/grumphp-shim": "^2.6",
"phpunit/phpunit": "^9.5",
"squizlabs/php_codesniffer": "~3.7"
},
"autoload": {
"psr-4": {
Expand All @@ -42,15 +42,16 @@
"sort-packages": true,
"allow-plugins": {
"phpro/grumphp-shim": true,
"magento/composer-dependency-version-audit-plugin": true
"magento/composer-dependency-version-audit-plugin": true,
"dealerdirect/phpcodesniffer-composer-installer": true
}
},
"scripts": {
"post-install-cmd": [
"([ $COMPOSER_DEV_MODE -eq 0 ] || vendor/bin/phpcs --config-set installed_paths ../../magento/magento-coding-standard,../../phpcompatibility/php-compatibility/PHPCompatibility)"
"([ $COMPOSER_DEV_MODE -eq 0 ] || vendor/bin/phpcs --config-set installed_paths ../../magento/magento-coding-standard/,../../magento/php-compatibility-fork)"
],
"post-update-cmd": [
"([ $COMPOSER_DEV_MODE -eq 0 ] || vendor/bin/phpcs --config-set installed_paths ../../magento/magento-coding-standard,../../phpcompatibility/php-compatibility/PHPCompatibility)"
"([ $COMPOSER_DEV_MODE -eq 0 ] || vendor/bin/phpcs --config-set installed_paths ../../magento/magento-coding-standard/,../../magento/php-compatibility-fork)"
]
}
}
4 changes: 2 additions & 2 deletions registration.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::MODULE,
Magento\Framework\Component\ComponentRegistrar::register(
Magento\Framework\Component\ComponentRegistrar::MODULE,
'Phpro_Translations',
__DIR__
);

0 comments on commit 08c61a2

Please sign in to comment.