From d360a42b402211a7dd1f71e4c60860a9040bf2f8 Mon Sep 17 00:00:00 2001 From: Timo Schinkel Date: Thu, 19 Mar 2026 13:14:38 +0100 Subject: [PATCH 1/5] Support `symfony/console` version 8 Solves #28 --- .github/workflows/pull_request.yml | 2 +- composer.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 135bd43..8d8e1b7 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: php-versions: ['8.2', '8.3', '8.4'] - symfony-versions: ['^6.0', '^7.0'] + symfony-versions: ['^6.0', '^7.0', '^8.0'] name: PHP ${{ matrix.php-versions }} with Symfony ${{ matrix.symfony-versions }} steps: diff --git a/composer.json b/composer.json index b8abc09..5e98220 100755 --- a/composer.json +++ b/composer.json @@ -5,9 +5,9 @@ "license": "Apache-2.0", "require": { "php": "^8.2", - "symfony/console": "^6.0|^7.0", + "symfony/console": "^6.0|^7.0|^8.0", "timoschinkel/codeowners": "^2.0", - "symfony/finder": "^6.0|^7.0" + "symfony/finder": "^6.0|^7.0|^8.0" }, "bin": ["bin/codeowners"], "autoload": { From 87a28faf138c636c0acbe90c32c65e0440d65c63 Mon Sep 17 00:00:00 2001 From: Timo Schinkel Date: Thu, 19 Mar 2026 13:23:59 +0100 Subject: [PATCH 2/5] Loosen Psalm requirement Psalm was tied to `~6.4.0` due to https://github.com/vimeo/psalm/pull/11270 - I was running an "unwanted" version locally, and was too lazy to update. However, in order to support `symfony/console` version 8 we need a newer version of Psalm. I did suppress the `MissingOverrideAttribute`, because I don't agree that implementing a method that is defined in an interface would require an `#[Override]` attribute. See https://github.com/vimeo/psalm/issues/11305 --- composer.json | 2 +- psalm.xml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 5e98220..4cb1581 100755 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ }, "require-dev": { "squizlabs/php_codesniffer": "^3.5", - "vimeo/psalm": "~6.4.0", + "vimeo/psalm": "^6.4.0", "phpunit/phpunit": "^9.4", "mikey179/vfsstream": "^1.6", "phpspec/prophecy-phpunit": "^2.0" diff --git a/psalm.xml b/psalm.xml index 9d917d4..520d3f3 100644 --- a/psalm.xml +++ b/psalm.xml @@ -51,5 +51,6 @@ + From e224347a230623d1c4295992b749657366f920ff Mon Sep 17 00:00:00 2001 From: Timo Schinkel Date: Thu, 19 Mar 2026 13:30:54 +0100 Subject: [PATCH 3/5] Replace `App:add()` with `App:addCommands()` It was already deprecated, but in `symfony/console` version 8 it has been removed completely. --- tests/Command/ListFilesCommandTest.php | 2 +- tests/Command/ListOwnersCommandTest.php | 2 +- tests/Command/ListUnownedFilesCommandTest.php | 2 +- tests/Command/OwnerCommandTest.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/Command/ListFilesCommandTest.php b/tests/Command/ListFilesCommandTest.php index aa38208..4fb9ed1 100644 --- a/tests/Command/ListFilesCommandTest.php +++ b/tests/Command/ListFilesCommandTest.php @@ -152,7 +152,7 @@ public function testCommandPassesSpecifiedCodeownersFileToFileLocator(): void private function executeCommand(Command $command, array $parameters): string { $application = new Application(); - $application->add($command); + $application->addCommands([$command]); $tester = new CommandTester($application->find($command->getName())); $tester->execute($parameters); diff --git a/tests/Command/ListOwnersCommandTest.php b/tests/Command/ListOwnersCommandTest.php index bf015ed..e6396bc 100644 --- a/tests/Command/ListOwnersCommandTest.php +++ b/tests/Command/ListOwnersCommandTest.php @@ -133,7 +133,7 @@ public function testCommandThrowsExceptionIfCodeOwnersFileDoesNotExist(): void private function executeCommand(Command $command, array $parameters): string { $application = new Application(); - $application->add($command); + $application->addCommands([$command]); $tester = new CommandTester($application->find($command->getName())); $tester->execute($parameters); diff --git a/tests/Command/ListUnownedFilesCommandTest.php b/tests/Command/ListUnownedFilesCommandTest.php index 4b06d9e..e680e26 100644 --- a/tests/Command/ListUnownedFilesCommandTest.php +++ b/tests/Command/ListUnownedFilesCommandTest.php @@ -202,7 +202,7 @@ public function testCommandPassesSpecifiedCodeownersFileToFileLocator(): void private function executeCommand(Command $command, array $parameters): array { $application = new Application(); - $application->add($command); + $application->addCommands([$command]); $tester = new CommandTester($application->find($command->getName())); $exit = $tester->execute($parameters); diff --git a/tests/Command/OwnerCommandTest.php b/tests/Command/OwnerCommandTest.php index d68e708..90ba6f3 100644 --- a/tests/Command/OwnerCommandTest.php +++ b/tests/Command/OwnerCommandTest.php @@ -189,7 +189,7 @@ public function testCommandThrowsExceptionIfCodeOwnersFileDoesNotExist(): void private function executeCommand(Command $command, array $parameters): string { $application = new Application(); - $application->add($command); + $application->addCommands([$command]); $tester = new CommandTester($application->find($command->getName())); $tester->execute($parameters); From 46034cb4e537b528b9809305bc9698e974da4edc Mon Sep 17 00:00:00 2001 From: Timo Schinkel Date: Thu, 19 Mar 2026 13:44:09 +0100 Subject: [PATCH 4/5] Change matrix structure `symfony/console:8.x` requires PHP 8.4. This blocks the matix as it was created. This rearranges the matrix to only PHP versions and separate steps for Symfony versions. Less parallelism, but now it is possible to only test against Symfony 8 on PHP 8.4. --- .github/workflows/pull_request.yml | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 8d8e1b7..bc06d86 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -8,8 +8,7 @@ jobs: strategy: matrix: php-versions: ['8.2', '8.3', '8.4'] - symfony-versions: ['^6.0', '^7.0', '^8.0'] - name: PHP ${{ matrix.php-versions }} with Symfony ${{ matrix.symfony-versions }} + name: PHP ${{ matrix.php-versions }} steps: - uses: actions/checkout@v2 @@ -20,11 +19,22 @@ jobs: coverage: xdebug - name: Install dependencies # Verify that the package can be installed for current environment run: composer install --prefer-dist --no-progress --no-suggest - - name: Configure Symfony # Specify desired Symfony version - run: composer update --with symfony/console:${{ matrix.symfony-versions }} --with symfony/finder:${{ matrix.symfony-versions }} --ignore-platform-reqs -W - - name: Unit tests - run: ./vendor/bin/phpunit - - name: Static Analysis - run: ./vendor/bin/psalm - - name: Code style - run: ./vendor/bin/phpcs + - name: Symfony 6.x + run: | + composer update --with symfony/console:^6.0 --with symfony/finder:^6.0 -W + ./vendor/bin/phpunit + ./vendor/bin/psalm + ./vendor/bin/phpcs + - name: Symfony 7.x + run: | + composer update --with symfony/console:^7.0 --with symfony/finder:^7.0 -W + ./vendor/bin/phpunit + ./vendor/bin/psalm + ./vendor/bin/phpcs + - name: Symfony 8.x + run: | + composer update --with symfony/console:^8.0 --with symfony/finder:^8.0 -W + ./vendor/bin/phpunit + ./vendor/bin/psalm + ./vendor/bin/phpcs + if: contains(matrix.php-versions, '8.4') From 7e3cea48dc07f80a6469ecbc5a05ae05018a0fc6 Mon Sep 17 00:00:00 2001 From: Timo Schinkel Date: Thu, 19 Mar 2026 13:57:12 +0100 Subject: [PATCH 5/5] Release as 17.0 --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5116686..69a68e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.7.0] - 2026-03-19 +### Added +- Support for Symfony 8 ([#29](https://github.com/timoschinkel/codeowners-cli/pull/29)) + ## [1.6.1] - 2026-03-10 ### Changed - Solve implicitly nullable parameters to better support PHP 8.4 ([#27](https://github.com/timoschinkel/codeowners-cli/pull/27))