Skip to content

Commit

Permalink
Drop psalm
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet committed Jan 15, 2025
1 parent 7cbc10d commit 5036a7c
Show file tree
Hide file tree
Showing 10 changed files with 3 additions and 94 deletions.
27 changes: 1 addition & 26 deletions .github/workflows/qa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 1 addition & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
40 changes: 0 additions & 40 deletions psalm.xml

This file was deleted.

5 changes: 0 additions & 5 deletions src/Environment/StubbedEnvironment.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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));
}
}
Expand Down
1 change: 0 additions & 1 deletion src/Test/TestHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
7 changes: 0 additions & 7 deletions src/Token/Tokenizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
Expand Down Expand Up @@ -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 */
Expand Down
7 changes: 0 additions & 7 deletions tests/Console/ApplicationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
2 changes: 0 additions & 2 deletions tests/Runner/LinterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 5036a7c

Please sign in to comment.