From e0abe83a676a9df8704e41874473ee51d234a00f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Mon, 2 Dec 2024 21:26:28 +0100 Subject: [PATCH] Drop Psalm (#129) As per our decision during the Hackathon --- .gitattributes | 1 - .github/workflows/static-analysis.yml | 4 +- composer.json | 4 +- psalm.xml | 73 --------------------------- src/AbstractLexer.php | 6 +-- tests/AbstractLexerTest.php | 14 ++--- 6 files changed, 12 insertions(+), 90 deletions(-) delete mode 100644 psalm.xml diff --git a/.gitattributes b/.gitattributes index 80efc0b..502b624 100644 --- a/.gitattributes +++ b/.gitattributes @@ -11,4 +11,3 @@ /phpcs.xml.dist export-ignore /phpstan.neon.dist export-ignore /phpunit.xml.dist export-ignore -/psalm.xml export-ignore diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index fa731c8..3b16a0e 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -10,7 +10,6 @@ on: - composer.* - src/** - phpstan* - - psalm* - tests/** push: branches: @@ -20,10 +19,9 @@ on: - composer.* - src/** - phpstan* - - psalm* - tests/** jobs: static-analysis: name: "Static Analysis" - uses: "doctrine/.github/.github/workflows/static-analysis.yml@5.3.0" + uses: "doctrine/.github/.github/workflows/phpstan.yml@5.3.0" diff --git a/composer.json b/composer.json index 995dafa..0fef2b8 100644 --- a/composer.json +++ b/composer.json @@ -31,9 +31,7 @@ "require-dev": { "doctrine/coding-standard": "^12", "phpstan/phpstan": "^1.10", - "phpunit/phpunit": "^10.5", - "psalm/plugin-phpunit": "^0.18.3", - "vimeo/psalm": "^5.21" + "phpunit/phpunit": "^10.5" }, "autoload": { "psr-4": { diff --git a/psalm.xml b/psalm.xml deleted file mode 100644 index 3f09cd7..0000000 --- a/psalm.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/AbstractLexer.php b/src/AbstractLexer.php index 2436885..8735a8b 100644 --- a/src/AbstractLexer.php +++ b/src/AbstractLexer.php @@ -138,7 +138,7 @@ public function getInputUntilPosition(int $position) * * @return bool * - * @psalm-assert-if-true !=null $this->lookahead + * @phpstan-assert-if-true !=null $this->lookahead */ public function isNextToken(int|string|UnitEnum $type) { @@ -152,7 +152,7 @@ public function isNextToken(int|string|UnitEnum $type) * * @return bool * - * @psalm-assert-if-true !=null $this->lookahead + * @phpstan-assert-if-true !=null $this->lookahead */ public function isNextTokenAny(array $types) { @@ -164,7 +164,7 @@ public function isNextTokenAny(array $types) * * @return bool * - * @psalm-assert-if-true !null $this->lookahead + * @phpstan-assert-if-true !null $this->lookahead */ public function moveNext() { diff --git a/tests/AbstractLexerTest.php b/tests/AbstractLexerTest.php index ea88754..7646ad7 100644 --- a/tests/AbstractLexerTest.php +++ b/tests/AbstractLexerTest.php @@ -29,7 +29,7 @@ public function tearDown(): void setlocale(LC_ALL, null); } - /** @psalm-return list>}> */ + /** @phpstan-return list>}> */ public static function dataProvider(): array { return [ @@ -83,7 +83,7 @@ public function testResetPosition(): void $this->assertEquals($expectedTokens[0], $this->concreteLexer->lookahead); } - /** @psalm-param list> $expectedTokens */ + /** @phpstan-param list> $expectedTokens */ #[DataProvider('dataProvider')] public function testMoveNext(string $input, array $expectedTokens): void { @@ -124,7 +124,7 @@ public function testUtf8Mismatch(): void ); } - /** @psalm-param list> $expectedTokens */ + /** @phpstan-param list> $expectedTokens */ #[DataProvider('dataProvider')] public function testPeek(string $input, array $expectedTokens): void { @@ -141,7 +141,7 @@ public function testPeek(string $input, array $expectedTokens): void $this->assertNull($this->concreteLexer->peek()); } - /** @psalm-param list> $expectedTokens */ + /** @phpstan-param list> $expectedTokens */ #[DataProvider('dataProvider')] public function testGlimpse(string $input, array $expectedTokens): void { @@ -161,7 +161,7 @@ public function testGlimpse(string $input, array $expectedTokens): void $this->assertNull($this->concreteLexer->peek()); } - /** @psalm-return list */ + /** @phpstan-return list */ public static function inputUntilPositionDataProvider(): array { return [ @@ -180,7 +180,7 @@ public function testGetInputUntilPosition( $this->assertSame($expectedInput, $this->concreteLexer->getInputUntilPosition($position)); } - /** @psalm-param list> $expectedTokens */ + /** @phpstan-param list> $expectedTokens */ #[DataProvider('dataProvider')] public function testIsNextToken(string $input, array $expectedTokens): void { @@ -194,7 +194,7 @@ public function testIsNextToken(string $input, array $expectedTokens): void } } - /** @psalm-param list> $expectedTokens */ + /** @phpstan-param list> $expectedTokens */ #[DataProvider('dataProvider')] public function testIsNextTokenAny(string $input, array $expectedTokens): void {