From 23c35d7a28c848902e928a8a258c16f8b08a108a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Mon, 4 Nov 2024 22:48:17 +0100 Subject: [PATCH] Drop Psalm in favor of just PHPStan --- .gitattributes | 2 -- .github/workflows/static-analysis.yml | 2 +- composer.json | 3 +-- psalm-baseline.xml | 30 --------------------------- psalm.xml | 28 ------------------------- src/AbstractFixture.php | 6 +++--- src/DependentFixtureInterface.php | 2 +- src/Loader.php | 22 ++++++++++---------- src/ReferenceRepository.php | 22 ++++++++++---------- src/Sorter/Vertex.php | 2 +- 10 files changed, 29 insertions(+), 90 deletions(-) delete mode 100644 psalm-baseline.xml delete mode 100644 psalm.xml diff --git a/.gitattributes b/.gitattributes index 7eb9fbc..08b4eec 100644 --- a/.gitattributes +++ b/.gitattributes @@ -12,5 +12,3 @@ /phpcs.xml.dist export-ignore /phpstan.neon.dist export-ignore /phpstan-baseline.neon export-ignore -/psalm.xml export-ignore -/psalm-baseline.xml export-ignore diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index d1fea6c..ccaea7c 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -11,4 +11,4 @@ on: jobs: static-analysis: name: "Static Analysis" - uses: "doctrine/.github/.github/workflows/static-analysis.yml@5.2.0" + uses: "doctrine/.github/.github/workflows/phpstan.yml@5.2.0" diff --git a/composer.json b/composer.json index 41f271f..923abed 100644 --- a/composer.json +++ b/composer.json @@ -33,8 +33,7 @@ "phpstan/phpstan": "^1.10", "phpunit/phpunit": "^9.6.13 || ^10.4.2", "symfony/cache": "^5.4 || ^6.3 || ^7", - "symfony/var-exporter": "^5.4 || ^6.3 || ^7", - "vimeo/psalm": "^5.9" + "symfony/var-exporter": "^5.4 || ^6.3 || ^7" }, "suggest": { "alcaeus/mongo-php-adapter": "For using MongoDB ODM 1.3 with PHP 7 (deprecated)", diff --git a/psalm-baseline.xml b/psalm-baseline.xml deleted file mode 100644 index 550b904..0000000 --- a/psalm-baseline.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - DocumentManagerInterface - DocumentManagerInterface - - - DocumentManagerInterface - - - - - dm]]> - ?DocumentManagerInterface - ?DocumentManagerInterface - DocumentManager - NodeHelper - - - DocumentManagerInterface|null - - - - - PhpcrDocumentManager - PhpcrDocumentManager - - - diff --git a/psalm.xml b/psalm.xml deleted file mode 100644 index 1a74623..0000000 --- a/psalm.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/src/AbstractFixture.php b/src/AbstractFixture.php index 4e71600..5f2ded0 100644 --- a/src/AbstractFixture.php +++ b/src/AbstractFixture.php @@ -82,10 +82,10 @@ abstract class AbstractFixture implements SharedFixtureInterface * @see ReferenceRepository::getReference() * * @param string $name - * @psalm-param class-string|null $class + * @phpstan-param class-string|null $class * * @return object - * @psalm-return ($class is null ? object : T) + * @phpstan-return ($class is null ? object : T) * * @template T of object */ @@ -110,7 +110,7 @@ abstract class AbstractFixture implements SharedFixtureInterface * @see ReferenceRepository::hasReference() * * @param string $name - * @psalm-param class-string $class + * @phpstan-param class-string $class * * @return bool */ diff --git a/src/DependentFixtureInterface.php b/src/DependentFixtureInterface.php index 5580a21..dd77e81 100644 --- a/src/DependentFixtureInterface.php +++ b/src/DependentFixtureInterface.php @@ -13,7 +13,7 @@ interface DependentFixtureInterface * This method must return an array of fixtures classes * on which the implementing class depends on * - * @psalm-return array> + * @phpstan-return array> */ public function getDependencies(); } diff --git a/src/Loader.php b/src/Loader.php index 5006a9b..471a9f2 100644 --- a/src/Loader.php +++ b/src/Loader.php @@ -40,14 +40,14 @@ class Loader /** * Array of fixture object instances to execute. * - * @psalm-var array, FixtureInterface> + * @phpstan-var array, FixtureInterface> */ private array $fixtures = []; /** * Array of ordered fixture object instances. * - * @psalm-var array|int, FixtureInterface> + * @phpstan-var array|int, FixtureInterface> */ private array $orderedFixtures = []; @@ -175,7 +175,7 @@ class Loader /** * Returns the array of data fixtures to execute. * - * @psalm-return array|int, FixtureInterface> + * @phpstan-return array|int, FixtureInterface> */ public function getFixtures() { @@ -200,7 +200,7 @@ class Loader * Check if a given fixture is transient and should not be considered a data fixtures * class. * - * @psalm-param class-string $className + * @phpstan-param class-string $className * * @return bool */ @@ -264,7 +264,7 @@ class Loader */ private function orderFixturesByDependencies() { - /** @psalm-var array, int> */ + /** @phpstan-var array, int> */ $sequenceForClasses = []; // If fixtures were already ordered by number then we need @@ -365,7 +365,7 @@ class Loader $this->orderedFixtures = array_merge($this->orderedFixtures, $orderedFixtures); } - /** @psalm-param iterable $dependenciesClasses */ + /** @phpstan-param iterable $dependenciesClasses */ private function validateDependencies(iterable $dependenciesClasses): bool { $loadedFixtureClasses = array_keys($this->fixtures); @@ -383,10 +383,10 @@ class Loader } /** - * @psalm-param array, int> $sequences - * @psalm-param iterable>|null $classes + * @phpstan-param array, int> $sequences + * @phpstan-param iterable>|null $classes * - * @psalm-return array> + * @phpstan-return array> */ private function getUnsequencedClasses(array $sequences, ?iterable $classes = null): array { @@ -410,10 +410,10 @@ class Loader /** * Load fixtures from files contained in iterator. * - * @psalm-param Iterator $iterator Iterator over files from + * @phpstan-param Iterator $iterator Iterator over files from * which fixtures should be loaded. * - * @psalm-return list $fixtures Array of loaded fixture object instances. + * @phpstan-return list $fixtures Array of loaded fixture object instances. */ private function loadFromIterator(Iterator $iterator): array { diff --git a/src/ReferenceRepository.php b/src/ReferenceRepository.php index 23adec1..0d18e1f 100644 --- a/src/ReferenceRepository.php +++ b/src/ReferenceRepository.php @@ -27,7 +27,7 @@ class ReferenceRepository * List of named references to the fixture objects * gathered during fixure loading * - * @psalm-var array + * @phpstan-var array */ private array $references = []; @@ -35,7 +35,7 @@ class ReferenceRepository * List of named references to the fixture objects * gathered during fixure loading * - * @psalm-var array> + * @phpstan-var array> */ private array $referencesByClass = []; @@ -44,7 +44,7 @@ class ReferenceRepository * in case a reference gets no longer managed, it will * use a proxy referenced by this identity * - * @psalm-var array + * @phpstan-var array */ private array $identities = []; @@ -53,7 +53,7 @@ class ReferenceRepository * in case a reference gets no longer managed, it will * use a proxy referenced by this identity * - * @psalm-var array> + * @phpstan-var array> */ private array $identitiesByClass = []; @@ -200,10 +200,10 @@ class ReferenceRepository * named by $name * * @param string $name - * @psalm-param class-string|null $class + * @phpstan-param class-string|null $class * * @return object - * @psalm-return ($class is null ? object : T) + * @phpstan-return ($class is null ? object : T) * * @throws OutOfBoundsException - if repository does not exist. * @@ -257,7 +257,7 @@ class ReferenceRepository * named by $name * * @param string $name - * @psalm-param class-string $class + * @phpstan-param class-string $class * * @return bool */ @@ -324,7 +324,7 @@ class ReferenceRepository * * Get all stored identities * - * @psalm-return array + * @phpstan-return array */ public function getIdentities() { @@ -334,7 +334,7 @@ class ReferenceRepository /** * Get all stored identities * - * @psalm-return array> + * @phpstan-return array> */ public function getIdentitiesByClass(): array { @@ -346,7 +346,7 @@ class ReferenceRepository * * Get all stored references * - * @psalm-return array + * @phpstan-return array */ public function getReferences() { @@ -356,7 +356,7 @@ class ReferenceRepository /** * Get all stored references * - * @psalm-return array> + * @phpstan-return array> */ public function getReferencesByClass(): array { diff --git a/src/Sorter/Vertex.php b/src/Sorter/Vertex.php index fd11cdb..17f8241 100644 --- a/src/Sorter/Vertex.php +++ b/src/Sorter/Vertex.php @@ -18,7 +18,7 @@ class Vertex public const IN_PROGRESS = 1; public const VISITED = 2; - /** @psalm-var self::* */ + /** @phpstan-var self::* */ public int $state = self::NOT_VISITED; /** Actual node value. */