diff --git a/.github/workflows/qa.yaml b/.github/workflows/qa.yaml index 324d381a..f4cd6ff8 100644 --- a/.github/workflows/qa.yaml +++ b/.github/workflows/qa.yaml @@ -18,7 +18,7 @@ jobs: - name: Install PHP with extensions uses: shivammathur/setup-php@v2 with: - php-version: 8.3 + php-version: 8.4 coverage: none tools: composer:v2 ini-file: development @@ -31,28 +31,3 @@ jobs: - name: Run PHPStan run: vendor/bin/phpstan analyse --no-progress --error-format=github - - psalm: - name: Psalm - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install PHP with extensions - uses: shivammathur/setup-php@v2 - with: - php-version: 8.3 - coverage: none - tools: composer:v2 - ini-file: development - - - name: Install Composer dependencies - uses: ramsey/composer-install@v3 - with: - dependency-versions: highest - composer-options: --prefer-dist --prefer-stable - - - name: Run Psalm - run: vendor/bin/psalm --no-progress --output-format=github --shepherd diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php index 65862489..ed9fcab8 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.php @@ -21,7 +21,7 @@ 'no_trailing_whitespace_in_string' => false, // For string comparison in tests 'operator_linebreak' => true, // Instead of ['only_booleans' => true] 'phpdoc_to_comment' => [ - 'ignored_tags' => ['phpstan-var', 'psalm-suppress'], + 'ignored_tags' => ['phpstan-var'], ], 'single_line_throw' => false, diff --git a/README.md b/README.md index d9758af5..90a19e00 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,6 @@ [![License](https://poser.pugx.org/vincentlanglet/twig-cs-fixer/license)](https://github.com/VincentLanglet/Twig-CS-Fixer/blob/main/LICENCE) [![Actions Status](https://github.com/VincentLanglet/Twig-CS-Fixer/workflows/Test/badge.svg)](https://github.com/RobDWaller/csp-generator/actions) [![Coverage](https://codecov.io/gh/VincentLanglet/Twig-CS-Fixer/branch/main/graph/badge.svg)](https://codecov.io/gh/VincentLanglet/Twig-CS-Fixer/branch/main) -[![Type Coverage](https://shepherd.dev/github/VincentLanglet/Twig-CS-Fixer/coverage.svg)](https://shepherd.dev/github/VincentLanglet/Twig-CS-Fixer) [![Infection MSI](https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2FVincentLanglet%2FTwig-CS-Fixer%2Fmain)](https://dashboard.stryker-mutator.io/reports/github.com/VincentLanglet/Twig-CS-Fixer/main) ## Installation diff --git a/composer.json b/composer.json index a1084224..1d49b8d1 100644 --- a/composer.json +++ b/composer.json @@ -33,15 +33,12 @@ "phpstan/phpstan-symfony": "^2.0", "phpstan/phpstan-webmozart-assert": "^2.0", "phpunit/phpunit": "^9.5.26 || ^10.0.9", - "psalm/plugin-phpunit": "^0.19.0", - "psalm/plugin-symfony": "^5.0.0", "rector/rector": "^2.0.0", "shipmonk/composer-dependency-analyser": "^1.6", "symfony/process": "^5.4 || ^6.4 || ^7.0", "symfony/twig-bridge": "^5.4 || ^6.4 || ^7.0", "symfony/ux-twig-component": "^2.2.0", - "twig/cache-extra": "^3.2", - "vimeo/psalm": "^5.2.0" + "twig/cache-extra": "^3.2" }, "autoload": { "psr-4": { diff --git a/psalm.xml b/psalm.xml deleted file mode 100644 index 5565de1d..00000000 --- a/psalm.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Environment/StubbedEnvironment.php b/src/Environment/StubbedEnvironment.php index 9e9997a5..e4cbbff2 100644 --- a/src/Environment/StubbedEnvironment.php +++ b/src/Environment/StubbedEnvironment.php @@ -102,7 +102,6 @@ public static function satisfiesTwigVersion(int $major, int $minor = 0, int $pat public function getFilter($name): ?TwigFilter { if (!\array_key_exists($name, $this->stubFilters)) { - /** @psalm-suppress InternalMethod */ $existingFilter = parent::getFilter($name); $this->stubFilters[$name] = $existingFilter instanceof TwigFilter ? $existingFilter @@ -118,7 +117,6 @@ public function getFilter($name): ?TwigFilter public function getFunction($name): ?TwigFunction { if (!\array_key_exists($name, $this->stubFunctions)) { - /** @psalm-suppress InternalMethod */ $existingFunction = parent::getFunction($name); $this->stubFunctions[$name] = $existingFunction instanceof TwigFunction ? $existingFunction @@ -134,7 +132,6 @@ public function getFunction($name): ?TwigFunction public function getTest($name): ?TwigTest { if (!\array_key_exists($name, $this->stubTests)) { - /** @psalm-suppress InternalMethod */ $existingTest = parent::getTest($name); $this->stubTests[$name] = $existingTest instanceof TwigTest ? $existingTest @@ -168,11 +165,9 @@ private function handleOptionalDependencies(): void $this->addTokenParser(new ComponentTokenParser()); } if (class_exists(PropsTokenParser::class)) { - /** @psalm-suppress InternalClass */ $this->addTokenParser(new PropsTokenParser()); } if (class_exists(ComponentLexer::class)) { - /** @psalm-suppress InternalClass */ $this->setLexer(new ComponentLexer($this)); } } diff --git a/src/Test/TestHelper.php b/src/Test/TestHelper.php index c2958163..abefbf72 100644 --- a/src/Test/TestHelper.php +++ b/src/Test/TestHelper.php @@ -46,7 +46,6 @@ public static function generateDiff(string $contents, string $filePath): string $filename = escapeshellarg($filename); $cmd = "diff -u -L{$filename} -LTwigCsFixer {$filename} \"{$tempName}\""; - /** @psalm-suppress ForbiddenCode */ $diff = shell_exec($cmd); fclose($fixedFile); diff --git a/src/Token/Tokenizer.php b/src/Token/Tokenizer.php index c36a915a..8fb0c40e 100644 --- a/src/Token/Tokenizer.php +++ b/src/Token/Tokenizer.php @@ -216,11 +216,6 @@ private function pushState(int $state): void $this->state[] = [$state, []]; } - /** - * @psalm-suppress PossiblyInvalidArrayAssignment, PropertyTypeCoercion - * - * @see https://github.com/vimeo/psalm/issues/8989 - */ private function setStateParam(string $name, ?string $value): void { Assert::notEmpty($this->state, 'Cannot set state params without a current state.'); @@ -769,9 +764,7 @@ private function lexString(string $string): void */ private function getOperatorRegex(Environment $env): string { - /** @psalm-suppress InternalMethod */ $unaryOperators = array_keys($env->getUnaryOperators()); - /** @psalm-suppress InternalMethod */ $binaryOperators = array_keys($env->getBinaryOperators()); /** @var string[] $operators */ diff --git a/tests/Console/ApplicationTest.php b/tests/Console/ApplicationTest.php index f86a1890..567542be 100644 --- a/tests/Console/ApplicationTest.php +++ b/tests/Console/ApplicationTest.php @@ -26,11 +26,4 @@ public function testNotInstalledLib(): void static::assertSame('Foo', $app->getName()); static::assertSame('UNKNOWN', $app->getVersion()); } - - public function testLibWithoutVersion(): void - { - $app = new Application('Psalm', 'psalm/psalm'); - static::assertSame('Psalm', $app->getName()); - static::assertSame('dev', $app->getVersion()); - } } diff --git a/tests/Runner/LinterTest.php b/tests/Runner/LinterTest.php index e4df90f2..ef244a56 100644 --- a/tests/Runner/LinterTest.php +++ b/tests/Runner/LinterTest.php @@ -75,7 +75,6 @@ public function testUntokenizableFilesAreReported(): void $call = 0; $tokenizer->method('tokenize')->willReturnCallback( static function () use (&$call): Tokens { - /** @psalm-suppress RedundantCondition https://github.com/vimeo/psalm/issues/10513 */ if (0 === $call) { ++$call; throw CannotTokenizeException::unknownError(); @@ -179,7 +178,6 @@ public function testBuggyFixesAreReported( $fixer = static::createStub(FixerInterface::class); $fixer->method('fixFile')->willReturnCallback( static function () use (&$call, $exception): string { - /** @psalm-suppress RedundantCondition https://github.com/vimeo/psalm/issues/10513 */ if (0 === $call) { ++$call; throw $exception;