From 009277ef37a4436f74eece6d7d0b6ee850ad935b Mon Sep 17 00:00:00 2001 From: Nyholm Date: Fri, 26 Mar 2021 17:20:01 +0100 Subject: [PATCH 1/8] Adding github actions --- .github/workflows/ci.yml | 48 +++++++++++ .github/workflows/static.yml | 96 +++++++++++++++++++--- psalm.baseline.xml | 111 ++++++++++++++++++++++++++ psalm.xml | 28 +++++++ vendor-bin/php-cs-fixer/composer.json | 9 +++ vendor-bin/phpstan/composer.json | 10 +++ vendor-bin/psalm/composer.json | 9 +++ 7 files changed, 301 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 psalm.baseline.xml create mode 100644 psalm.xml create mode 100644 vendor-bin/php-cs-fixer/composer.json create mode 100644 vendor-bin/phpstan/composer.json create mode 100644 vendor-bin/psalm/composer.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..b76e5adb --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,48 @@ +name: CI + +on: + pull_request: + +jobs: + build: + name: Test + runs-on: Ubuntu-20.04 + strategy: + fail-fast: false + matrix: + php: [ '7.1', '7.2', '7.3', '7.4', '8.0' ] + strategy: [ 'highest' ] + sf_version: [''] + include: + - php: 7.4 + strategy: 'lowest' + - php: 7.3 + sf_version: '3.*' + - php: 7.3 + sf_version: '4.*' + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: none + tools: flex + + - name: Download dependencies + uses: ramsey/composer-install@v1 + env: + SYMFONY_REQUIRE: ${{ matrix.sf_version }} + with: + dependency-versions: ${{ matrix.strategy }} + composer-options: --no-interaction --prefer-dist --optimize-autoloader + + - name: Install PHPUnit + run: ./vendor/bin/simple-phpunit install + + - name: Run tests + run: ./vendor/bin/simple-phpunit + diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index 2480e638..fe54ec59 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -2,23 +2,99 @@ name: Static code analysis on: [pull_request] + jobs: phpstan: name: PHPStan - runs-on: ubuntu-latest + runs-on: Ubuntu-20.04 + steps: - - uses: actions/checkout@master - - name: Run PHPStan - uses: docker://jakzal/phpqa:php7.3-alpine + - name: Checkout code + uses: actions/checkout@v2 + + - name: Cache PHPStan + uses: actions/cache@v2 + with: + path: .github/.cache/phpstan/ + key: phpstan-${{ github.sha }} + restore-keys: phpstan- + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '7.4' + coverage: none + + - name: Download dependencies + uses: ramsey/composer-install@v1 with: - args: phpstan analyze + composer-options: --no-interaction --prefer-dist --optimize-autoloader + + - name: Download PHPStan + run: composer bin phpstan update --no-interaction --no-progress + + - name: Execute PHPStan + run: vendor/bin/phpstan analyze --no-progress php-cs-fixer: name: PHP-CS-Fixer - runs-on: ubuntu-latest + runs-on: Ubuntu-20.04 + steps: - - uses: actions/checkout@master - - name: Run PHP-CS-Fixer - uses: docker://jakzal/phpqa:php7.3-alpine + - name: Checkout code + uses: actions/checkout@v2 + + - name: Cache PhpCsFixer + uses: actions/cache@v2 with: - args: php-cs-fixer fix --dry-run --diff-format udiff -vvv + path: .github/.cache/php-cs-fixer/ + key: php-cs-fixer-${{ github.sha }} + restore-keys: php-cs-fixer- + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '7.4' + coverage: none + + - name: Download dependencies + uses: ramsey/composer-install@v1 + with: + composer-options: --no-interaction --prefer-dist --optimize-autoloader + + - name: Download PHP CS Fixer + run: composer bin php-cs-fixer update --no-interaction --no-progress + + - name: Execute PHP CS Fixer + run: vendor/bin/php-cs-fixer fix --diff-format udiff --dry-run + + psalm: + name: Psalm + runs-on: Ubuntu-20.04 + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Cache Psalm + uses: actions/cache@v2 + with: + path: .github/.cache/psalm/ + key: psalm-${{ github.sha }} + restore-keys: psalm- + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '7.4' + coverage: none + + - name: Download dependencies + uses: ramsey/composer-install@v1 + with: + composer-options: --no-interaction --prefer-dist --optimize-autoloader + + - name: Download Psalm + run: composer bin psalm update --no-interaction --no-progress + + - name: Execute Psalm + run: vendor/bin/psalm.phar --no-progress --output-format=github diff --git a/psalm.baseline.xml b/psalm.baseline.xml new file mode 100644 index 00000000..5cb0c204 --- /dev/null +++ b/psalm.baseline.xml @@ -0,0 +1,111 @@ + + + + + !\is_array($source) + !\is_array($target) + + + + + getKernel + + + + + $messages + $messages->getValue(true) + + + array + + + $messages->getValue(true) + + + $dataCollector->getMessages() + + + + + \array_keys($bundles) + + + children + fixXmlConfig + + + + + getNodeVisitors + + + + + ?MessageInterface + + + $domain + $domain + $key + $key + $locale + $locale + + + null + + + + + 5.0 + + + + + Response + + + + + Request + Response + + + + + $container + + + + + getMetadata + getMetadata + getMetadata + + + + + 5.0 + + + + + getCatalogue + + + + + getCatalogue + + + + + + + + transChoice + transChoice + + + diff --git a/psalm.xml b/psalm.xml new file mode 100644 index 00000000..1464b181 --- /dev/null +++ b/psalm.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/vendor-bin/php-cs-fixer/composer.json b/vendor-bin/php-cs-fixer/composer.json new file mode 100644 index 00000000..3adf5f5c --- /dev/null +++ b/vendor-bin/php-cs-fixer/composer.json @@ -0,0 +1,9 @@ +{ + "require": { + "php": "^7.2.5 || ^8.0", + "friendsofphp/php-cs-fixer": "2.18.3" + }, + "config": { + "preferred-install": "dist" + } +} diff --git a/vendor-bin/phpstan/composer.json b/vendor-bin/phpstan/composer.json new file mode 100644 index 00000000..bfbc7273 --- /dev/null +++ b/vendor-bin/phpstan/composer.json @@ -0,0 +1,10 @@ +{ + "require": { + "php": "^7.2.5 || ^8.0", + "phpstan/phpstan": "0.12.81", + "phpstan/phpstan-deprecation-rules": "0.12.6" + }, + "config": { + "preferred-install": "dist" + } +} diff --git a/vendor-bin/psalm/composer.json b/vendor-bin/psalm/composer.json new file mode 100644 index 00000000..535a0797 --- /dev/null +++ b/vendor-bin/psalm/composer.json @@ -0,0 +1,9 @@ +{ + "require": { + "php": "^7.2.5 || ^8.0", + "psalm/phar": "4.6.2" + }, + "config": { + "preferred-install": "dist" + } +} From a781eacacb553d7616b0dc1a17292714c2bda544 Mon Sep 17 00:00:00 2001 From: Nyholm Date: Fri, 26 Mar 2021 17:26:13 +0100 Subject: [PATCH 2/8] Remove phpunit/phpunit --- Readme.md | 4 ---- composer.json | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/Readme.md b/Readme.md index cab8dbd8..5fae742e 100644 --- a/Readme.md +++ b/Readme.md @@ -1,13 +1,9 @@ # Translation Bundle [![Latest Version](https://img.shields.io/github/release/php-translation/symfony-bundle.svg?style=flat-square)](https://github.com/php-translation/symfony-bundle/releases) -[![Build Status](https://img.shields.io/travis/php-translation/symfony-bundle.svg?style=flat-square)](https://travis-ci.org/php-translation/symfony-bundle) -[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/php-translation/symfony-bundle.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-translation/symfony-bundle) -[![Quality Score](https://img.shields.io/scrutinizer/g/php-translation/symfony-bundle.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-translation/symfony-bundle) [![SensioLabsInsight](https://insight.sensiolabs.com/projects/c289ebe2-41c4-429f-afba-de2f905b9bdb/mini.png)](https://insight.sensiolabs.com/projects/c289ebe2-41c4-429f-afba-de2f905b9bdb) [![Total Downloads](https://img.shields.io/packagist/dt/php-translation/symfony-bundle.svg?style=flat-square)](https://packagist.org/packages/php-translation/symfony-bundle) - **Symfony integration for PHP Translation** ## Install diff --git a/composer.json b/composer.json index 57309126..2f121146 100644 --- a/composer.json +++ b/composer.json @@ -25,6 +25,7 @@ }, "require-dev": { "symfony/phpunit-bridge": "^4.4 || ^5.0", + "bamarni/composer-bin-plugin": "^1.3", "php-translation/translator": "^1.0", "php-http/curl-client": "^1.7", "php-http/message": "^1.6", @@ -37,8 +38,7 @@ "matthiasnoback/symfony-dependency-injection-test": "^4.1", "matthiasnoback/symfony-config-test": "^4.1", "nyholm/psr7": "^1.1", - "nyholm/symfony-bundle-test": "^1.6.1", - "phpunit/phpunit": "^8.4" + "nyholm/symfony-bundle-test": "^1.6.1" }, "conflict": { "symfony/config": "<3.4.31" From 483f73b78945567bfda5aab4794390078d355d42 Mon Sep 17 00:00:00 2001 From: Nyholm Date: Fri, 26 Mar 2021 17:32:56 +0100 Subject: [PATCH 3/8] Update baselines --- Makefile | 31 ++++++++++++++++++++++--------- phpstan-baseline.neon | 10 ---------- psalm.baseline.xml | 39 +-------------------------------------- 3 files changed, 23 insertions(+), 57 deletions(-) diff --git a/Makefile b/Makefile index db6bcf45..08f0c498 100644 --- a/Makefile +++ b/Makefile @@ -1,20 +1,33 @@ .PHONY: ${TARGETS} -DIR := ${CURDIR} -QA_IMAGE := jakzal/phpqa:php7.3-alpine +# https://www.gnu.org/software/make/manual/html_node/Force-Targets.html +always: -cs-fix: - @docker run --rm -v $(DIR):/project -w /project $(QA_IMAGE) php-cs-fixer fix --diff-format udiff -vvv +cs-fix: vendor + vendor/bin/php-cs-fixer fix --diff-format udiff -vvv -cs-diff: - @docker run --rm -v $(DIR):/project -w /project $(QA_IMAGE) php-cs-fixer fix --diff-format udiff --dry-run -vvv +cs-diff: vendor + vendor/bin/php-cs-fixer fix --diff-format udiff --dry-run -vvv -phpstan: - @docker run --rm -v $(DIR):/project -w /project $(QA_IMAGE) phpstan analyze +phpstan: vendor + vendor/bin/phpstan analyze -phpunit: +psalm: vendor + vendor/bin/psalm.phar + +phpunit: vendor @vendor/bin/phpunit +.PHONY: baseline +baseline: vendor ## Generate baseline files + vendor/bin/phpstan analyze --generate-baseline + vendor/bin/psalm.phar --update-baseline + static: cs-diff phpstan test: static phpunit + +vendor: always + composer update --no-interaction + composer bin all install --no-interaction + vendor/bin/simple-phpunit install diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index be1f1d6d..2dd6a23d 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -50,16 +50,6 @@ parameters: count: 1 path: DependencyInjection/Configuration.php - - - message: "#^Class Symfony\\\\Component\\\\HttpKernel\\\\Event\\\\PostResponseEvent not found\\.$#" - count: 2 - path: EventListener/AutoAddMissingTranslations.php - - - - message: "#^Class Symfony\\\\Component\\\\HttpKernel\\\\Event\\\\FilterResponseEvent not found\\.$#" - count: 2 - path: EventListener/EditInPlaceResponseListener.php - - message: "#^Class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface not found\\.$#" count: 1 diff --git a/psalm.baseline.xml b/psalm.baseline.xml index 5cb0c204..5a95982a 100644 --- a/psalm.baseline.xml +++ b/psalm.baseline.xml @@ -1,5 +1,5 @@ - + !\is_array($source) @@ -22,16 +22,12 @@ $messages->getValue(true) - - $dataCollector->getMessages() - \array_keys($bundles) - children fixXmlConfig @@ -40,27 +36,6 @@ getNodeVisitors - - - ?MessageInterface - - - $domain - $domain - $key - $key - $locale - $locale - - - null - - - - - 5.0 - - Response @@ -77,18 +52,6 @@ $container - - - getMetadata - getMetadata - getMetadata - - - - - 5.0 - - getCatalogue From 39667808c550adfcf8668364c6b4f0828c2bf98b Mon Sep 17 00:00:00 2001 From: Nyholm Date: Fri, 26 Mar 2021 17:34:47 +0100 Subject: [PATCH 4/8] Drop 7.1 --- .github/workflows/ci.yml | 2 +- composer.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b76e5adb..e6411bee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - php: [ '7.1', '7.2', '7.3', '7.4', '8.0' ] + php: [ '7.2', '7.3', '7.4', '8.0' ] strategy: [ 'highest' ] sf_version: [''] include: diff --git a/composer.json b/composer.json index 2f121146..bf81fbb0 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ } ], "require": { - "php": "^7.1", + "php": "^7.2", "symfony/framework-bundle": "^3.4 || ^4.3 || ^5.0", "symfony/validator": "^3.4 || ^4.3 || ^5.0", "symfony/translation": "^3.4 || ^4.3 || ^5.0", From d2d1d63d57c94a83606d6d986cfc3464c08f8e0d Mon Sep 17 00:00:00 2001 From: Nyholm Date: Fri, 26 Mar 2021 17:37:49 +0100 Subject: [PATCH 5/8] Updated meta files --- .gitattributes | 8 +++--- .scrutinizer.yml | 9 ------- .travis.yml | 63 ------------------------------------------------ Changelog.md | 6 +++++ 4 files changed, 10 insertions(+), 76 deletions(-) delete mode 100644 .scrutinizer.yml delete mode 100644 .travis.yml diff --git a/.gitattributes b/.gitattributes index a4f0f5b1..ef49f3fc 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3,8 +3,8 @@ .github export-ignore .gitignore export-ignore .php_cs export-ignore -.scrutinizer.yml export-ignore -.styleci.yml export-ignore -.travis.yml export-ignore -phpstan.neon.dist export-ignore +phpstan.neon.dist export-ignore +phpstan-baseline.neon export-ignore +psalm.baseline.xml export-ignore +psalm.xml export-ignore Tests export-ignore diff --git a/.scrutinizer.yml b/.scrutinizer.yml deleted file mode 100644 index 28ef3ae4..00000000 --- a/.scrutinizer.yml +++ /dev/null @@ -1,9 +0,0 @@ -filter: - excluded_paths: [vendor/*, Tests/*] -checks: - php: - code_rating: true - duplication: true -tools: - external_code_coverage: - timeout: 1800 # Timeout in seconds. diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 128e366c..00000000 --- a/.travis.yml +++ /dev/null @@ -1,63 +0,0 @@ -language: php - -cache: - directories: - - $HOME/.composer/cache - -branches: - except: - - /^analysis-.*$/ - - /^patch-.*$/ - -env: - global: - - TEST_COMMAND="composer test" - - SYMFONY_PHPUNIT_VERSION="6.5" - - COMPOSER_MEMORY_LIMIT=-1 - -matrix: - fast_finish: true - include: - # Run test with code coverage - - php: 7.3 - env: COVERAGE=true TEST_COMMAND="composer test-ci" - - # Test with lowest dependencies - - php: 7.2 - env: COMPOSER_FLAGS="--prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="weak" - - # Test the latest stable release - - php: 7.3 - - php: 7.4 - - # Force some major versions of Symfony - - php: 7.3 - env: SYMFONY_VERSION="3.*" - - php: 7.3 - env: SYMFONY_VERSION="4.*" - - # Latest commit to master - - php: 7.3 - env: STABILITY="dev" - - allow_failures: - # Dev-master is allowed to fail. - - env: STABILITY="dev" - -before_install: - - if [[ $COVERAGE != true ]]; then phpenv config-rm xdebug.ini || true; fi - - if ! [ -z "$STABILITY" ]; then composer config minimum-stability ${STABILITY}; fi; - - composer require --no-update symfony/flex - - if ! [ -z "$SYMFONY_VERSION" ]; then composer config extra.symfony.require "${SYMFONY_VERSION}"; fi; - -install: - - composer update ${COMPOSER_FLAGS} --prefer-dist --prefer-stable --no-interaction - -script: - - composer validate --strict --no-check-lock - - $TEST_COMMAND - -after_success: - - if [[ $COVERAGE = true ]]; then wget https://scrutinizer-ci.com/ocular.phar; fi - - if [[ $COVERAGE = true ]]; then php ocular.phar code-coverage:upload --format=php-clover build/coverage.xml; fi - diff --git a/Changelog.md b/Changelog.md index 9e2609b6..7f72c61b 100644 --- a/Changelog.md +++ b/Changelog.md @@ -2,6 +2,12 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. +## Unreleased + +### Removed + +- Support for PHP 7.1 + ## 0.12.1 ### Fixed From 689be17eea9d5c9496a21c2db4a72cb1b0feabd9 Mon Sep 17 00:00:00 2001 From: Nyholm Date: Fri, 26 Mar 2021 17:48:48 +0100 Subject: [PATCH 6/8] minors --- Makefile | 4 +- composer.json | 2 +- psalm.baseline.xml | 96 ++++++++++++++++++++++++++++------ psalm.xml | 2 +- vendor-bin/psalm/composer.json | 2 +- 5 files changed, 84 insertions(+), 22 deletions(-) diff --git a/Makefile b/Makefile index 08f0c498..9b8cb4d5 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ phpstan: vendor vendor/bin/phpstan analyze psalm: vendor - vendor/bin/psalm.phar + vendor/bin/psalm phpunit: vendor @vendor/bin/phpunit @@ -21,7 +21,7 @@ phpunit: vendor .PHONY: baseline baseline: vendor ## Generate baseline files vendor/bin/phpstan analyze --generate-baseline - vendor/bin/psalm.phar --update-baseline + vendor/bin/psalm --set-baseline=psalm.baseline.xml static: cs-diff phpstan diff --git a/composer.json b/composer.json index bf81fbb0..65f822e1 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ "twig/twig": "^2.11 || ^3.0" }, "require-dev": { - "symfony/phpunit-bridge": "^4.4 || ^5.0", + "symfony/phpunit-bridge": "^5.2", "bamarni/composer-bin-plugin": "^1.3", "php-translation/translator": "^1.0", "php-http/curl-client": "^1.7", diff --git a/psalm.baseline.xml b/psalm.baseline.xml index 5a95982a..267f5f29 100644 --- a/psalm.baseline.xml +++ b/psalm.baseline.xml @@ -1,5 +1,5 @@ - + !\is_array($source) @@ -23,52 +23,114 @@ $messages->getValue(true) + + + Intl::getLocaleBundle() + + \array_keys($bundles) fixXmlConfig + root - - - getNodeVisitors - + + + $container->getParameter('kernel.project_dir') + - + - Response + PostResponseEvent - - - Request - Response + + + FilterResponseEvent - - - $container - + + + LegacyTranslatorInterface + + + + + getNodeVisitors + - + + $this->translator + $this->translator + + + $this->translator + $this->translator + $this->translator + $this->translator + $this->translator + LegacyTranslatorInterface|NewTranslatorInterface + LegacyTranslatorInterface|NewTranslatorInterface + + getCatalogue + getLocale + getLocale + setLocale + transChoice - + + (string) $id + + + $this->symfonyTranslator + $this->symfonyTranslator + $this->symfonyTranslator + $this->symfonyTranslator + $this->symfonyTranslator + $this->symfonyTranslator + $this->symfonyTranslator + LegacyTranslatorInterface|NewTranslatorInterface + LegacyTranslatorInterface|NewTranslatorInterface + + getCatalogue + getLocale + setLocale + transChoice + transChoice + + + [$this->extension, 'transchoice'] + + + + LegacyTranslatorInterface + transChoice transChoice + + + 0 + 0 + 0 + 0 + 0 + + diff --git a/psalm.xml b/psalm.xml index 1464b181..669678fa 100644 --- a/psalm.xml +++ b/psalm.xml @@ -17,12 +17,12 @@ - + diff --git a/vendor-bin/psalm/composer.json b/vendor-bin/psalm/composer.json index 535a0797..611c2942 100644 --- a/vendor-bin/psalm/composer.json +++ b/vendor-bin/psalm/composer.json @@ -1,7 +1,7 @@ { "require": { "php": "^7.2.5 || ^8.0", - "psalm/phar": "4.6.2" + "vimeo/psalm": "4.6.4" }, "config": { "preferred-install": "dist" From 9a739f667e31aafc1329a433513ba5ce52aa42d9 Mon Sep 17 00:00:00 2001 From: bocharsky-bw Date: Fri, 26 Mar 2021 18:49:08 +0200 Subject: [PATCH 7/8] Apply PHP CS Fixer changes --- Command/DownloadCommand.php | 2 +- Controller/WebUIController.php | 2 +- .../CompilerPass/ExternalTranslatorPassTest.php | 5 +---- .../DependencyInjection/CompilerPass/ExtractorPassTest.php | 5 +---- .../DependencyInjection/CompilerPass/StoragePassTest.php | 5 +---- Twig/Visitor/DefaultApplyingNodeVisitor.php | 2 +- 6 files changed, 6 insertions(+), 15 deletions(-) diff --git a/Command/DownloadCommand.php b/Command/DownloadCommand.php index c4532c0b..a64999d4 100644 --- a/Command/DownloadCommand.php +++ b/Command/DownloadCommand.php @@ -75,7 +75,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $message = 'The --cache option is deprecated as it\'s now the default behaviour of this command.'; $io->note($message); - @\trigger_error($message, E_USER_DEPRECATED); + @\trigger_error($message, \E_USER_DEPRECATED); } $configName = $input->getArgument('configuration'); diff --git a/Controller/WebUIController.php b/Controller/WebUIController.php index d099104b..4ef7daa7 100644 --- a/Controller/WebUIController.php +++ b/Controller/WebUIController.php @@ -271,7 +271,7 @@ private function validateMessage(MessageInterface $message, array $validationGro { $errors = $this->validator->validate($message, null, $validationGroups); if (\count($errors) > 0) { - throw MessageValidationException::create(); + throw MessageValidationException::create(); } } } diff --git a/Tests/Unit/DependencyInjection/CompilerPass/ExternalTranslatorPassTest.php b/Tests/Unit/DependencyInjection/CompilerPass/ExternalTranslatorPassTest.php index ac512577..4630de0c 100644 --- a/Tests/Unit/DependencyInjection/CompilerPass/ExternalTranslatorPassTest.php +++ b/Tests/Unit/DependencyInjection/CompilerPass/ExternalTranslatorPassTest.php @@ -24,10 +24,7 @@ protected function registerCompilerPass(ContainerBuilder $container): void $container->addCompilerPass(new ExternalTranslatorPass()); } - /** - * @test - */ - public function if_compiler_pass_collects_services_by_adding_method_calls_these_will_exist(): void + public function testIfCompilerPassCollectsServicesByAddingMethodCallsTheseWillExist(): void { $collectingService = new Definition(); $this->setDefinition('php_translation.translator_service.external_translator', $collectingService); diff --git a/Tests/Unit/DependencyInjection/CompilerPass/ExtractorPassTest.php b/Tests/Unit/DependencyInjection/CompilerPass/ExtractorPassTest.php index 6415147f..e8d19c7c 100644 --- a/Tests/Unit/DependencyInjection/CompilerPass/ExtractorPassTest.php +++ b/Tests/Unit/DependencyInjection/CompilerPass/ExtractorPassTest.php @@ -25,10 +25,7 @@ protected function registerCompilerPass(ContainerBuilder $container): void $container->addCompilerPass(new ExtractorPass()); } - /** - * @test - */ - public function if_compiler_pass_collects_services_by_adding_method_calls_these_will_exist(): void + public function testIfCompilerPassCollectsServicesByAddingMethodCallsTheseWillExist(): void { $collectingService = new Definition(); $this->setDefinition(Extractor::class, $collectingService); diff --git a/Tests/Unit/DependencyInjection/CompilerPass/StoragePassTest.php b/Tests/Unit/DependencyInjection/CompilerPass/StoragePassTest.php index b9e50ccc..0b1bd923 100644 --- a/Tests/Unit/DependencyInjection/CompilerPass/StoragePassTest.php +++ b/Tests/Unit/DependencyInjection/CompilerPass/StoragePassTest.php @@ -24,10 +24,7 @@ protected function registerCompilerPass(ContainerBuilder $container): void $container->addCompilerPass(new StoragePass()); } - /** - * @test - */ - public function if_compiler_pass_collects_services_by_adding_method_calls_these_will_exist(): void + public function testIfCompilerPassCollectsServicesByAddingMethodCallsTheseWillExist(): void { $collectingService = new Definition(); $this->setDefinition('php_translation.storage.foobar', $collectingService); diff --git a/Twig/Visitor/DefaultApplyingNodeVisitor.php b/Twig/Visitor/DefaultApplyingNodeVisitor.php index a88d01f0..9c112a7f 100644 --- a/Twig/Visitor/DefaultApplyingNodeVisitor.php +++ b/Twig/Visitor/DefaultApplyingNodeVisitor.php @@ -59,7 +59,7 @@ public function doEnterNode(Node $node, Environment $env): Node } if (!$transNode instanceof FilterExpression) { - throw new \RuntimeException(\sprintf('The "desc" filter must be applied after a "trans", or "transchoice" filter.')); + throw new \RuntimeException('The "desc" filter must be applied after a "trans", or "transchoice" filter.'); } $wrappingNode = $node->getNode('node'); From 65f6225cae5b055cc238ed6d0f03af7e2ad305db Mon Sep 17 00:00:00 2001 From: Nyholm Date: Fri, 26 Mar 2021 17:51:25 +0100 Subject: [PATCH 8/8] Bugfix --- .github/workflows/static.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index fe54ec59..a02e633e 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -97,4 +97,4 @@ jobs: run: composer bin psalm update --no-interaction --no-progress - name: Execute Psalm - run: vendor/bin/psalm.phar --no-progress --output-format=github + run: vendor/bin/psalm --no-progress --output-format=github