From 6019e1072a2b84be47440c4a7a7bdafdd5a0b1b5 Mon Sep 17 00:00:00 2001 From: SonataCI Date: Sun, 23 Nov 2025 10:12:00 +0000 Subject: [PATCH 1/3] DevKit updates --- .github/workflows/lint.yaml | 4 ++-- .github/workflows/qa.yaml | 8 ++++---- .github/workflows/symfony-lint.yaml | 8 ++++---- .github/workflows/test.yaml | 28 +++++++++++++++++++--------- .gitignore | 1 + Makefile | 2 +- rector.php | 2 +- 7 files changed, 32 insertions(+), 21 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 2ceef54..64577c6 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -29,7 +29,7 @@ jobs: - name: Install PHP with extensions uses: shivammathur/setup-php@v2 with: - php-version: '8.4' + php-version: '8.5' coverage: none tools: composer:v2 @@ -53,7 +53,7 @@ jobs: - name: Install PHP with extensions uses: shivammathur/setup-php@v2 with: - php-version: '8.4' + php-version: '8.5' coverage: none tools: composer:v2, composer-normalize:2 env: diff --git a/.github/workflows/qa.yaml b/.github/workflows/qa.yaml index f7694ed..64f017f 100644 --- a/.github/workflows/qa.yaml +++ b/.github/workflows/qa.yaml @@ -29,7 +29,7 @@ jobs: - name: Install PHP with extensions uses: shivammathur/setup-php@v2 with: - php-version: '8.4' + php-version: '8.5' coverage: none tools: composer:v2 @@ -53,7 +53,7 @@ jobs: - name: Install PHP with extensions uses: shivammathur/setup-php@v2 with: - php-version: '8.4' + php-version: '8.5' coverage: none tools: composer:v2 @@ -63,7 +63,7 @@ jobs: dependency-versions: highest - name: Psalm - run: vendor/bin/psalm --no-progress --show-info=false --stats --output-format=github --threads=$(nproc) --shepherd --php-version=8.4 + run: vendor/bin/psalm --no-progress --show-info=false --stats --output-format=github --threads=$(nproc) --shepherd --php-version=8.5 rector: name: Rector @@ -77,7 +77,7 @@ jobs: - name: Install PHP with extensions uses: shivammathur/setup-php@v2 with: - php-version: '8.4' + php-version: '8.5' coverage: none tools: composer:v2 diff --git a/.github/workflows/symfony-lint.yaml b/.github/workflows/symfony-lint.yaml index 61e5930..010f865 100644 --- a/.github/workflows/symfony-lint.yaml +++ b/.github/workflows/symfony-lint.yaml @@ -29,7 +29,7 @@ jobs: - name: Install PHP with extensions uses: shivammathur/setup-php@v2 with: - php-version: '8.4' + php-version: '8.5' coverage: none tools: composer:v2 @@ -53,7 +53,7 @@ jobs: - name: Install PHP with extensions uses: shivammathur/setup-php@v2 with: - php-version: '8.4' + php-version: '8.5' coverage: none tools: composer:v2 @@ -77,7 +77,7 @@ jobs: - name: Install PHP with extensions uses: shivammathur/setup-php@v2 with: - php-version: '8.4' + php-version: '8.5' coverage: none tools: composer:v2 @@ -101,7 +101,7 @@ jobs: - name: Install PHP with extensions uses: shivammathur/setup-php@v2 with: - php-version: '8.4' + php-version: '8.5' coverage: none tools: composer:v2 diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 26b3832..adbab9e 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -30,34 +30,39 @@ jobs: strategy: matrix: php-version: - - '8.1' - '8.2' - '8.3' - '8.4' + - '8.5' dependencies: [highest] allowed-to-fail: [false] symfony-require: [''] variant: [normal] include: - - php-version: '8.1' + - php-version: '8.2' dependencies: lowest allowed-to-fail: false variant: normal - - php-version: '8.4' + - php-version: '8.5' dependencies: highest allowed-to-fail: false symfony-require: 6.4.* variant: symfony/symfony:"6.4.*" - - php-version: '8.4' + - php-version: '8.5' dependencies: highest allowed-to-fail: false - symfony-require: 7.1.* - variant: symfony/symfony:"7.1.*" - - php-version: '8.4' + symfony-require: 7.3.* + variant: symfony/symfony:"7.3.*" + - php-version: '8.5' dependencies: highest allowed-to-fail: false - symfony-require: 7.2.* - variant: symfony/symfony:"7.2.*" + symfony-require: 7.4.* + variant: symfony/symfony:"7.4.*" + - php-version: '8.5' + dependencies: highest + allowed-to-fail: false + symfony-require: 8.0.* + variant: symfony/symfony:"8.0.*" steps: - name: Checkout @@ -73,6 +78,11 @@ jobs: - name: Add PHPUnit matcher run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" + # until Psalm supports Symfony 8 + - name: Remove psalm + if: matrix.symfony-require == '8.0.*' + run: composer remove vimeo/psalm psalm/plugin-symfony psalm/plugin-phpunit --dev --no-update + - name: Install variant if: matrix.variant != 'normal' && !startsWith(matrix.variant, 'symfony/symfony') run: composer require ${{ matrix.variant }} --no-update diff --git a/.gitignore b/.gitignore index 3fc5b4a..2fa6c0d 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,5 @@ composer.lock phpunit.xml phpstan.neon /.phpunit.result.cache +tests/App/config/reference.php /docs/_build/ diff --git a/Makefile b/Makefile index 1f772ff..1cc4346 100644 --- a/Makefile +++ b/Makefile @@ -117,7 +117,7 @@ phpstan: .PHONY: phpstan psalm: - vendor/bin/psalm --php-version=8.4 + vendor/bin/psalm --php-version=8.5 .PHONY: psalm rector: diff --git a/rector.php b/rector.php index 085115f..3f21a4e 100644 --- a/rector.php +++ b/rector.php @@ -33,7 +33,7 @@ ]); $rectorConfig->sets([ - LevelSetList::UP_TO_PHP_81, + LevelSetList::UP_TO_PHP_82, PHPUnitSetList::PHPUNIT_100, PHPUnitSetList::PHPUNIT_CODE_QUALITY, ]); From f9d679ead513e982dec2cc41063dbf67690122d8 Mon Sep 17 00:00:00 2001 From: SonataCI Date: Sun, 23 Nov 2025 14:33:37 +0000 Subject: [PATCH 2/3] DevKit updates --- .gitattributes | 2 -- .github/workflows/qa.yaml | 24 ------------------------ .github/workflows/test.yaml | 5 ----- Makefile | 4 ---- README.md | 1 - tests/bootstrap.php | 5 ----- 6 files changed, 41 deletions(-) diff --git a/.gitattributes b/.gitattributes index 1c8e163..5684210 100644 --- a/.gitattributes +++ b/.gitattributes @@ -13,5 +13,3 @@ rector.php export-ignore phpstan.neon.dist export-ignore phpstan-baseline.neon export-ignore phpstan-console-application.php export-ignore -psalm.xml export-ignore -psalm-baseline.xml export-ignore diff --git a/.github/workflows/qa.yaml b/.github/workflows/qa.yaml index 64f017f..f7d0b34 100644 --- a/.github/workflows/qa.yaml +++ b/.github/workflows/qa.yaml @@ -41,30 +41,6 @@ jobs: - name: PHPStan run: vendor/bin/phpstan --no-progress --memory-limit=1G analyse --error-format=github - psalm: - name: Psalm - - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Install PHP with extensions - uses: shivammathur/setup-php@v2 - with: - php-version: '8.5' - coverage: none - tools: composer:v2 - - - name: Install Composer dependencies (highest) - uses: ramsey/composer-install@v3 - with: - dependency-versions: highest - - - name: Psalm - run: vendor/bin/psalm --no-progress --show-info=false --stats --output-format=github --threads=$(nproc) --shepherd --php-version=8.5 - rector: name: Rector diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index adbab9e..546ec79 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -78,11 +78,6 @@ jobs: - name: Add PHPUnit matcher run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - # until Psalm supports Symfony 8 - - name: Remove psalm - if: matrix.symfony-require == '8.0.*' - run: composer remove vimeo/psalm psalm/plugin-symfony psalm/plugin-phpunit --dev --no-update - - name: Install variant if: matrix.variant != 'normal' && !startsWith(matrix.variant, 'symfony/symfony') run: composer require ${{ matrix.variant }} --no-update diff --git a/Makefile b/Makefile index 1cc4346..18b8dc0 100644 --- a/Makefile +++ b/Makefile @@ -116,10 +116,6 @@ phpstan: vendor/bin/phpstan --memory-limit=1G analyse .PHONY: phpstan -psalm: - vendor/bin/psalm --php-version=8.5 -.PHONY: psalm - rector: vendor/bin/rector .PHONY: rector diff --git a/README.md b/README.md index 5453dee..4ae76b7 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,6 @@ Sonata twig extensions [![Latest Stable Version](https://poser.pugx.org/sonata-project/twig-extensions/v/stable)](https://packagist.org/packages/sonata-project/twig-extensions) [![Latest Unstable Version](https://poser.pugx.org/sonata-project/twig-extensions/v/unstable)](https://packagist.org/packages/sonata-project/twig-extensions) -[![Psalm Type Coverage][shepherd_stable_badge]][shepherd_stable_link] [![License](https://poser.pugx.org/sonata-project/twig-extensions/license)](https://packagist.org/packages/sonata-project/twig-extensions) [![Total Downloads](https://poser.pugx.org/sonata-project/twig-extensions/downloads)](https://packagist.org/packages/sonata-project/twig-extensions) diff --git a/tests/bootstrap.php b/tests/bootstrap.php index c9a0134..ee11adb 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -31,10 +31,5 @@ } if (file_exists($file = __DIR__.'/custom_bootstrap.php')) { - /** - * @psalm-suppress MissingFile,UnusedPsalmSuppress - * - * @see https://github.com/vimeo/psalm/issues/3886 - */ require_once $file; } From 7bd80fd9cc1a488cbf5858758568f16ba8c06075 Mon Sep 17 00:00:00 2001 From: David Maicher Date: Sun, 23 Nov 2025 11:21:13 +0100 Subject: [PATCH 3/3] Add support for Symfony 8 try running psalm with php target 8.4 remove Psalm --- composer.json | 33 ++++++++++--------- psalm.xml | 20 ----------- .../DependencyInjection/Configuration.php | 2 -- src/TokenParser/TemplateBoxTokenParser.php | 4 --- tests/App/AppKernel.php | 1 - 5 files changed, 18 insertions(+), 42 deletions(-) delete mode 100644 psalm.xml diff --git a/composer.json b/composer.json index 770016d..1979363 100644 --- a/composer.json +++ b/composer.json @@ -21,33 +21,36 @@ ], "homepage": "https://docs.sonata-project.org/projects/twig-extensions", "require": { - "php": "^8.1", - "symfony/config": "^6.4 || ^7.1", - "symfony/twig-bridge": "^6.4 || ^7.1", + "php": "^8.2", + "symfony/config": "^6.4 || ^7.3 || ^8.0", + "symfony/twig-bridge": "^6.4 || ^7.3 || ^8.0", "twig/twig": "^3.13" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.4", "matthiasnoback/symfony-config-test": "^6.1", - "matthiasnoback/symfony-dependency-injection-test": "^6.1", + "matthiasnoback/symfony-dependency-injection-test": "dev-ci-updates as 6.1.0.1", "phpstan/extension-installer": "^1.0", "phpstan/phpstan": "^1.0 || ^2.0", "phpstan/phpstan-phpunit": "^1.0 || ^2.0", "phpstan/phpstan-strict-rules": "^1.0 || ^2.0", "phpstan/phpstan-symfony": "^1.0 || ^2.0", - "phpunit/phpunit": "^10.5.54 || ^11.5.38 || ^12.3.10", - "psalm/plugin-phpunit": "^0.18 || ^0.19", - "psalm/plugin-symfony": "^5.0", + "phpunit/phpunit": "^11.5.38 || ^12.3.10", "rector/rector": "^1.1 || ^2.0", - "symfony/browser-kit": "^6.4 || ^7.1", - "symfony/dependency-injection": "^6.4 || ^7.1", - "symfony/framework-bundle": "^6.4 || ^7.1", - "symfony/http-foundation": "^6.4 || ^7.1", - "symfony/http-kernel": "^6.4 || ^7.1", - "symfony/translation": "^6.4 || ^7.1", - "symfony/twig-bundle": "^6.4 || ^7.1", - "vimeo/psalm": "^5.0 || ^6.10" + "symfony/browser-kit": "^6.4 || ^7.3 || ^8.0", + "symfony/dependency-injection": "^6.4 || ^7.3 || ^8.0", + "symfony/framework-bundle": "^6.4 || ^7.3 || ^8.0", + "symfony/http-foundation": "^6.4 || ^7.3 || ^8.0", + "symfony/http-kernel": "^6.4 || ^7.3 || ^8.0", + "symfony/translation": "^6.4 || ^7.3 || ^8.0", + "symfony/twig-bundle": "^6.4 || ^7.3 || ^8.0" }, + "repositories": [ + { + "type": "git", + "url": "git@github.com:dmaicher/SymfonyDependencyInjectionTest.git" + } + ], "minimum-stability": "dev", "prefer-stable": true, "autoload": { diff --git a/psalm.xml b/psalm.xml deleted file mode 100644 index ccce1e1..0000000 --- a/psalm.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/src/Bridge/Symfony/DependencyInjection/Configuration.php b/src/Bridge/Symfony/DependencyInjection/Configuration.php index bdedf42..2582a29 100644 --- a/src/Bridge/Symfony/DependencyInjection/Configuration.php +++ b/src/Bridge/Symfony/DependencyInjection/Configuration.php @@ -38,8 +38,6 @@ public function getConfigTreeBuilder(): TreeBuilder /** * Returns configuration for flash messages. - * - * @psalm-suppress UndefinedInterfaceMethod */ private function addFlashMessageSection(ArrayNodeDefinition $node): void { diff --git a/src/TokenParser/TemplateBoxTokenParser.php b/src/TokenParser/TemplateBoxTokenParser.php index e92fc6f..4388c16 100644 --- a/src/TokenParser/TemplateBoxTokenParser.php +++ b/src/TokenParser/TemplateBoxTokenParser.php @@ -18,9 +18,6 @@ use Twig\Token; use Twig\TokenParser\AbstractTokenParser; -/** - * @psalm-suppress PropertyNotSetInConstructor $this->parser is set by twig using setParser. - */ final class TemplateBoxTokenParser extends AbstractTokenParser { /** @@ -36,7 +33,6 @@ public function parse(Token $token): TemplateBoxNode if (method_exists($this->parser, 'parseExpression')) { $message = $this->parser->parseExpression(); } else { - /** @psalm-suppress DeprecatedClass, DeprecatedMethod */ $message = $this->parser->getExpressionParser()->parseExpression(); } } else { diff --git a/tests/App/AppKernel.php b/tests/App/AppKernel.php index 2ba4542..fd3b190 100644 --- a/tests/App/AppKernel.php +++ b/tests/App/AppKernel.php @@ -73,7 +73,6 @@ protected function configureContainer(ContainerBuilder $containerBuilder, Loader $containerBuilder->loadFromExtension('twig', [ 'strict_variables' => '%kernel.debug%', - 'exception_controller' => null, 'paths' => ['%kernel.project_dir%/templates'], ]); }