From 15845169e9a8904d4aec4de94a51a90c52122aec Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Mon, 25 Nov 2024 11:58:43 +0100 Subject: [PATCH 1/6] [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 6352262..b76940b 100644 --- a/composer.json +++ b/composer.json @@ -16,16 +16,16 @@ }, "require-dev": { "composer/composer": "^2.0.8", + "ibexa/code-style": "^1.0", "phpstan/phpstan": "^1", "phpstan/phpstan-phpunit": "^1", "phpstan/phpstan-webmozart-assert": "^1", - "symfony/console": "^5.2", - "symfony/dotenv": "^5.2", - "symfony/finder": "^5.2", - "symfony/filesystem": "^5.2", - "symfony/phpunit-bridge": "^5.2", - "symfony/process": "^5.2", - "ibexa/code-style": "^1.0" + "symfony/console": "^6.4", + "symfony/dotenv": "^6.4", + "symfony/filesystem": "^6.4", + "symfony/finder": "^6.4", + "symfony/phpunit-bridge": "^6.4", + "symfony/process": "^6.4" }, "autoload": { "psr-4": { From 1f67319f242e30545d5620116bd0f89c18108db6 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Mon, 25 Nov 2024 12:05:05 +0100 Subject: [PATCH 2/6] [CS] Bumped Ibexa Code Style to ~2.0.0 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index b76940b..a92de78 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ }, "require-dev": { "composer/composer": "^2.0.8", - "ibexa/code-style": "^1.0", + "ibexa/code-style": "~2.0.0", "phpstan/phpstan": "^1", "phpstan/phpstan-phpunit": "^1", "phpstan/phpstan-webmozart-assert": "^1", From 446b165bec804fd1c0e33871eea6e85d6412b215 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Mon, 25 Nov 2024 12:07:48 +0100 Subject: [PATCH 3/6] [CI] Switched GHA CI job to run on PHP 8.3 --- .github/workflows/ci.yaml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1f835e2..a6712de 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -14,9 +14,9 @@ jobs: strategy: matrix: php: - - '8.0' + - '8.3' steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Setup PHP Action uses: shivammathur/setup-php@v2 @@ -42,9 +42,7 @@ jobs: fail-fast: false matrix: php: - - '7.4' - - '8.0' - - '8.1' + - '8.3' steps: - uses: actions/checkout@v2 @@ -57,7 +55,7 @@ jobs: extensions: pdo_sqlite, gd tools: cs2pr - - uses: "ramsey/composer-install@v1" + - uses: ramsey/composer-install@v3 with: dependency-versions: "highest" From 294558a7b44cceadfb3a8a9acb9973e3f1ae46eb Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Mon, 25 Nov 2024 12:11:51 +0100 Subject: [PATCH 4/6] Improved IbexaSetupCommand code quality --- src/lib/Command/IbexaSetupCommand.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/lib/Command/IbexaSetupCommand.php b/src/lib/Command/IbexaSetupCommand.php index dbe51c4..08045e9 100644 --- a/src/lib/Command/IbexaSetupCommand.php +++ b/src/lib/Command/IbexaSetupCommand.php @@ -27,8 +27,7 @@ class IbexaSetupCommand extends BaseCommand { - /** @var \Composer\Semver\VersionParser */ - private $versionParser; + private VersionParser $versionParser; private const PSH_RESOURCES_PATH = __DIR__ . '/../../../resources/platformsh'; @@ -40,6 +39,9 @@ protected function configure(): void ; } + /** + * @throws \Exception + */ protected function execute(InputInterface $input, OutputInterface $output): int { if ($input->getOption('platformsh')) { @@ -108,6 +110,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int return Command::SUCCESS; } + /** + * @throws \Exception + */ protected function getCommonFiles(string $product): Finder { $versionDir = $this->getVersionDirectory($product, self::PSH_RESOURCES_PATH . '/common'); @@ -122,6 +127,9 @@ protected function getCommonFiles(string $product): Finder return $finder; } + /** + * @throws \Exception + */ protected function getProductSpecificFiles(string $product, string $version): Finder { $productDir = str_replace('/', '-', $product); @@ -198,7 +206,7 @@ static function (SplFileInfo $dir): string { private function getVersionParser(): VersionParser { - if (null === $this->versionParser) { + if (!isset($this->versionParser)) { $this->versionParser = new VersionParser(); } From bd9a329db25290574a4b8c05833e5974b038509c Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Mon, 25 Nov 2024 12:13:57 +0100 Subject: [PATCH 5/6] Added strict return types for Composer plugin extension points --- src/lib/CommandProvider.php | 2 +- src/lib/PostInstall.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/CommandProvider.php b/src/lib/CommandProvider.php index 3f9dc6a..1bcfe6e 100644 --- a/src/lib/CommandProvider.php +++ b/src/lib/CommandProvider.php @@ -12,7 +12,7 @@ class CommandProvider implements \Composer\Plugin\Capability\CommandProvider { - public function getCommands() + public function getCommands(): array { return [ new IbexaSetupCommand(), diff --git a/src/lib/PostInstall.php b/src/lib/PostInstall.php index 1c93b2c..f1e82ec 100644 --- a/src/lib/PostInstall.php +++ b/src/lib/PostInstall.php @@ -32,7 +32,7 @@ public function uninstall(Composer $composer, IOInterface $io): void $io->write('[Ibexa PostInstall tool] Uninstall', true, IOInterface::DEBUG); } - public function getCapabilities() + public function getCapabilities(): array { return [ CommandProvider::class => SetupToolCommandProvider::class, From f878f4e26f233f64bef12b9bf7b7b86f71f41f4d Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Mon, 25 Nov 2024 12:21:54 +0100 Subject: [PATCH 6/6] [Composer] Bumped PHP requirement to >=8.3 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index a92de78..fae1a98 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ } ], "require": { - "php": "^7.4 || ^8.0", + "php": ">=8.3", "composer-plugin-api": "^2.0", "composer/semver": "^3.2" },