From a95badd8ed8f756297cfc711cb6c35e2e29c3233 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Wed, 19 Feb 2025 13:23:34 +0100 Subject: [PATCH 1/3] [Composer] Bumped Symfony packages requirements to ^6.4 --- composer.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index d1d4c22..c72b54a 100644 --- a/composer.json +++ b/composer.json @@ -32,16 +32,16 @@ "require": { "php": "^8.3", "ext-libxml": "*", - "symfony/yaml": "^5.0", - "symfony/routing": "^5.0", - "symfony/console": "^5.0", - "symfony/form": "^5.0", - "symfony/http-foundation": "^5.0", - "symfony/event-dispatcher": "^5.0", "guzzlehttp/guzzle": "^6.3.0", + "ibexa/admin-ui": "~5.0.0@dev", "ibexa/core": "~5.0.0@dev", "ibexa/fieldtype-richtext": "~5.0.0@dev", - "ibexa/admin-ui": "~5.0.0@dev" + "symfony/console": "^6.4", + "symfony/event-dispatcher": "^6.4", + "symfony/form": "^6.4", + "symfony/http-foundation": "^6.4", + "symfony/routing": "^6.4", + "symfony/yaml": "^6.4" }, "require-dev": { "dg/bypass-finals": "^1.3", From 36ef24070feebff197152d13f892577de779b708 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Tue, 25 Feb 2025 21:49:00 +0100 Subject: [PATCH 2/3] IBX-9627: [GHA] Configured Rector PHP workflow --- .github/workflows/rector.yaml | 15 +++++++++++++++ composer.json | 1 + rector.php | 16 ++++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 .github/workflows/rector.yaml create mode 100644 rector.php diff --git a/.github/workflows/rector.yaml b/.github/workflows/rector.yaml new file mode 100644 index 0000000..6f2b453 --- /dev/null +++ b/.github/workflows/rector.yaml @@ -0,0 +1,15 @@ +name: Rector PHP +on: + push: + branches: + - main + - '[0-9]+.[0-9]+' + pull_request: ~ +jobs: + rector: + name: Run rector + uses: ibexa/gh-workflows/.github/workflows/rector.yml@main + secrets: + SATIS_NETWORK_KEY: ${{ secrets.SATIS_NETWORK_KEY }} + SATIS_NETWORK_TOKEN: ${{ secrets.SATIS_NETWORK_TOKEN }} + TRAVIS_GITHUB_TOKEN: ${{ secrets.TRAVIS_GITHUB_TOKEN }} diff --git a/composer.json b/composer.json index c72b54a..00bd290 100644 --- a/composer.json +++ b/composer.json @@ -54,6 +54,7 @@ "ibexa/http-cache": "~5.0.x-dev", "ibexa/migrations": "~5.0.x-dev", "ibexa/notifications": "~5.0.x-dev", + "ibexa/rector": "~5.0.x-dev", "ibexa/rest": "~5.0.x-dev", "ibexa/search": "~5.0.x-dev", "ibexa/user": "~5.0.x-dev", diff --git a/rector.php b/rector.php new file mode 100644 index 0000000..2cf3d7f --- /dev/null +++ b/rector.php @@ -0,0 +1,16 @@ +createConfig(); From 42179f6fb3611f37335594b3fcb70d5010bf42cf Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Tue, 25 Feb 2025 22:27:20 +0100 Subject: [PATCH 3/3] [Rector] Upgraded codebase according to configured rules --- src/bundle/Command/TranslateContentCommand.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/bundle/Command/TranslateContentCommand.php b/src/bundle/Command/TranslateContentCommand.php index a8ca6d4..b735506 100644 --- a/src/bundle/Command/TranslateContentCommand.php +++ b/src/bundle/Command/TranslateContentCommand.php @@ -13,12 +13,14 @@ use Ibexa\Contracts\Core\Repository\ContentService; use Ibexa\Contracts\Core\Repository\PermissionResolver; use Ibexa\Contracts\Core\Repository\UserService; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; +#[AsCommand(name: 'ibexa:automated:translate', description: 'Translate a Content in a new Language', aliases: ['ibexatranslate'])] final class TranslateContentCommand extends Command { private const ADMINISTRATOR_USER_ID = 14; @@ -52,9 +54,6 @@ public function __construct( protected function configure(): void { $this - ->setName('ibexa:automated:translate') - ->setAliases(['ibexatranslate']) - ->setDescription('Translate a Content in a new Language') ->addArgument('contentId', InputArgument::REQUIRED, 'ContentId') ->addArgument( 'service',