diff --git a/.doctrine-project.json b/.doctrine-project.json index d26a66d6..6e5586d1 100644 --- a/.doctrine-project.json +++ b/.doctrine-project.json @@ -4,10 +4,16 @@ "slug": "data-fixtures", "docsSlug": "doctrine-data-fixtures", "versions": [ + { + "name": "2.0", + "branchName": "2.0.x", + "slug": "latest", + "upcoming": true + }, { "name": "1.8", "branchName": "1.8.x", - "slug": "latest", + "slug": "1.8", "upcoming": true }, { diff --git a/.gitattributes b/.gitattributes index 7eb9fbc2..08b4eec6 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 d1fea6c6..ccaea7ce 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 93f791c3..b54a8137 100644 --- a/composer.json +++ b/composer.json @@ -36,8 +36,7 @@ "phpunit/phpunit": "^9.6.13 || ^10.4.2", "psr/log": "^1.1 || ^2 || ^3", "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 550b9045..00000000 --- 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 1a74623d..00000000 --- a/psalm.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/src/AbstractFixture.php b/src/AbstractFixture.php index ea84e224..498f93d6 100644 --- a/src/AbstractFixture.php +++ b/src/AbstractFixture.php @@ -79,10 +79,10 @@ public function addReference(string $name, object $object) * * @see ReferenceRepository::getReference() * - * @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 */ @@ -106,7 +106,7 @@ public function getReference(string $name, ?string $class = null) * * @see ReferenceRepository::hasReference() * - * @psalm-param class-string|null $class + * @phpstan-param class-string|null $class * * @return bool */ diff --git a/src/DependentFixtureInterface.php b/src/DependentFixtureInterface.php index 5580a219..dd77e81c 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 ea406d2f..f430f47b 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 = []; @@ -171,7 +171,7 @@ public function addFixture(FixtureInterface $fixture) /** * Returns the array of data fixtures to execute. * - * @psalm-return array|int, FixtureInterface> + * @phpstan-return array|int, FixtureInterface> */ public function getFixtures() { @@ -196,7 +196,7 @@ public function getFixtures() * 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 */ @@ -258,7 +258,7 @@ private function orderFixturesByNumber(): void */ private function orderFixturesByDependencies() { - /** @psalm-var array, int> */ + /** @phpstan-var array, int> */ $sequenceForClasses = []; // If fixtures were already ordered by number then we need @@ -359,7 +359,7 @@ private function orderFixturesByDependencies() $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); @@ -377,10 +377,10 @@ private function validateDependencies(iterable $dependenciesClasses): bool } /** - * @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 { @@ -404,10 +404,10 @@ private function getUnsequencedClasses(array $sequences, ?iterable $classes = nu /** * 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 60ede99f..0165638b 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 = []; @@ -194,10 +194,10 @@ public function addReference(string $name, object $object) * Loads an object using stored reference * named by $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. * @@ -250,7 +250,7 @@ public function getReference(string $name, ?string $class = null) * Check if an object is stored using reference * named by $name * - * @psalm-param class-string $class + * @phpstan-param class-string $class * * @return bool */ @@ -314,7 +314,7 @@ public function hasIdentity(string $name, ?string $class = null) * * Get all stored identities * - * @psalm-return array + * @phpstan-return array */ public function getIdentities() { @@ -324,7 +324,7 @@ public function getIdentities() /** * Get all stored identities * - * @psalm-return array> + * @phpstan-return array> */ public function getIdentitiesByClass(): array { @@ -336,7 +336,7 @@ public function getIdentitiesByClass(): array * * Get all stored references * - * @psalm-return array + * @phpstan-return array */ public function getReferences() { @@ -346,7 +346,7 @@ public function getReferences() /** * 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 fd11cdb4..17f8241b 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. */