mirror of
https://github.com/doctrine/data-fixtures.git
synced 2026-03-23 22:32:13 +01:00
Drop Psalm in favor of just PHPStan
This commit is contained in:
2
.gitattributes
vendored
2
.gitattributes
vendored
@@ -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
|
||||
|
||||
2
.github/workflows/static-analysis.yml
vendored
2
.github/workflows/static-analysis.yml
vendored
@@ -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"
|
||||
|
||||
@@ -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)",
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<files psalm-version="5.9.0@8b9ad1eb9e8b7d3101f949291da2b9f7767cd163">
|
||||
<file src="src/Executor/PHPCRExecutor.php">
|
||||
<UndefinedClass>
|
||||
<code>DocumentManagerInterface</code>
|
||||
<code>DocumentManagerInterface</code>
|
||||
</UndefinedClass>
|
||||
<UndefinedDocblockClass>
|
||||
<code>DocumentManagerInterface</code>
|
||||
</UndefinedDocblockClass>
|
||||
</file>
|
||||
<file src="src/Purger/PHPCRPurger.php">
|
||||
<UndefinedClass>
|
||||
<code><![CDATA[$this->dm]]></code>
|
||||
<code>?DocumentManagerInterface</code>
|
||||
<code>?DocumentManagerInterface</code>
|
||||
<code>DocumentManager</code>
|
||||
<code>NodeHelper</code>
|
||||
</UndefinedClass>
|
||||
<UndefinedDocblockClass>
|
||||
<code>DocumentManagerInterface|null</code>
|
||||
</UndefinedDocblockClass>
|
||||
</file>
|
||||
<file src="src/ReferenceRepository.php">
|
||||
<UndefinedClass>
|
||||
<code>PhpcrDocumentManager</code>
|
||||
<code>PhpcrDocumentManager</code>
|
||||
</UndefinedClass>
|
||||
</file>
|
||||
</files>
|
||||
28
psalm.xml
28
psalm.xml
@@ -1,28 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<psalm
|
||||
phpVersion="8.2"
|
||||
errorLevel="7"
|
||||
findUnusedBaselineEntry="true"
|
||||
findUnusedCode="false"
|
||||
resolveFromConfigFile="true"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="https://getpsalm.org/schema/config"
|
||||
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
|
||||
errorBaseline="psalm-baseline.xml"
|
||||
>
|
||||
<projectFiles>
|
||||
<directory name="src" />
|
||||
<ignoreFiles>
|
||||
<directory name="vendor" />
|
||||
</ignoreFiles>
|
||||
</projectFiles>
|
||||
|
||||
<issueHandlers>
|
||||
<UndefinedDocblockClass>
|
||||
<errorLevel type="suppress">
|
||||
<!-- ORM 3 forward compatibility -->
|
||||
<referencedClass name="Doctrine\ORM\Mapping\ManyToManyOwningSideMapping" />
|
||||
</errorLevel>
|
||||
</UndefinedDocblockClass>
|
||||
</issueHandlers>
|
||||
</psalm>
|
||||
@@ -82,10 +82,10 @@ abstract class AbstractFixture implements SharedFixtureInterface
|
||||
* @see ReferenceRepository::getReference()
|
||||
*
|
||||
* @param string $name
|
||||
* @psalm-param class-string<T>|null $class
|
||||
* @phpstan-param class-string<T>|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
|
||||
*/
|
||||
|
||||
@@ -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<class-string<FixtureInterface>>
|
||||
* @phpstan-return array<class-string<FixtureInterface>>
|
||||
*/
|
||||
public function getDependencies();
|
||||
}
|
||||
|
||||
@@ -40,14 +40,14 @@ class Loader
|
||||
/**
|
||||
* Array of fixture object instances to execute.
|
||||
*
|
||||
* @psalm-var array<class-string<FixtureInterface>, FixtureInterface>
|
||||
* @phpstan-var array<class-string<FixtureInterface>, FixtureInterface>
|
||||
*/
|
||||
private array $fixtures = [];
|
||||
|
||||
/**
|
||||
* Array of ordered fixture object instances.
|
||||
*
|
||||
* @psalm-var array<class-string<FixtureInterface>|int, FixtureInterface>
|
||||
* @phpstan-var array<class-string<FixtureInterface>|int, FixtureInterface>
|
||||
*/
|
||||
private array $orderedFixtures = [];
|
||||
|
||||
@@ -175,7 +175,7 @@ class Loader
|
||||
/**
|
||||
* Returns the array of data fixtures to execute.
|
||||
*
|
||||
* @psalm-return array<class-string<FixtureInterface>|int, FixtureInterface>
|
||||
* @phpstan-return array<class-string<FixtureInterface>|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<object> $className
|
||||
* @phpstan-param class-string<object> $className
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
@@ -264,7 +264,7 @@ class Loader
|
||||
*/
|
||||
private function orderFixturesByDependencies()
|
||||
{
|
||||
/** @psalm-var array<class-string<DependentFixtureInterface>, int> */
|
||||
/** @phpstan-var array<class-string<DependentFixtureInterface>, 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<class-string> $dependenciesClasses */
|
||||
/** @phpstan-param iterable<class-string> $dependenciesClasses */
|
||||
private function validateDependencies(iterable $dependenciesClasses): bool
|
||||
{
|
||||
$loadedFixtureClasses = array_keys($this->fixtures);
|
||||
@@ -383,10 +383,10 @@ class Loader
|
||||
}
|
||||
|
||||
/**
|
||||
* @psalm-param array<class-string<DependentFixtureInterface>, int> $sequences
|
||||
* @psalm-param iterable<class-string<FixtureInterface>>|null $classes
|
||||
* @phpstan-param array<class-string<DependentFixtureInterface>, int> $sequences
|
||||
* @phpstan-param iterable<class-string<FixtureInterface>>|null $classes
|
||||
*
|
||||
* @psalm-return array<class-string<FixtureInterface>>
|
||||
* @phpstan-return array<class-string<FixtureInterface>>
|
||||
*/
|
||||
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<SplFileInfo> $iterator Iterator over files from
|
||||
* @phpstan-param Iterator<SplFileInfo> $iterator Iterator over files from
|
||||
* which fixtures should be loaded.
|
||||
*
|
||||
* @psalm-return list<FixtureInterface> $fixtures Array of loaded fixture object instances.
|
||||
* @phpstan-return list<FixtureInterface> $fixtures Array of loaded fixture object instances.
|
||||
*/
|
||||
private function loadFromIterator(Iterator $iterator): array
|
||||
{
|
||||
|
||||
@@ -27,7 +27,7 @@ class ReferenceRepository
|
||||
* List of named references to the fixture objects
|
||||
* gathered during fixure loading
|
||||
*
|
||||
* @psalm-var array<string, object>
|
||||
* @phpstan-var array<string, object>
|
||||
*/
|
||||
private array $references = [];
|
||||
|
||||
@@ -35,7 +35,7 @@ class ReferenceRepository
|
||||
* List of named references to the fixture objects
|
||||
* gathered during fixure loading
|
||||
*
|
||||
* @psalm-var array<class-string, array<string, object>>
|
||||
* @phpstan-var array<class-string, array<string, object>>
|
||||
*/
|
||||
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<string, mixed>
|
||||
* @phpstan-var array<string, mixed>
|
||||
*/
|
||||
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<class-string, array<string, mixed>>
|
||||
* @phpstan-var array<class-string, array<string, mixed>>
|
||||
*/
|
||||
private array $identitiesByClass = [];
|
||||
|
||||
@@ -200,10 +200,10 @@ class ReferenceRepository
|
||||
* named by $name
|
||||
*
|
||||
* @param string $name
|
||||
* @psalm-param class-string<T>|null $class
|
||||
* @phpstan-param class-string<T>|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<string, object>
|
||||
* @phpstan-return array<string, object>
|
||||
*/
|
||||
public function getIdentities()
|
||||
{
|
||||
@@ -334,7 +334,7 @@ class ReferenceRepository
|
||||
/**
|
||||
* Get all stored identities
|
||||
*
|
||||
* @psalm-return array<class-string, array<string, object>>
|
||||
* @phpstan-return array<class-string, array<string, object>>
|
||||
*/
|
||||
public function getIdentitiesByClass(): array
|
||||
{
|
||||
@@ -346,7 +346,7 @@ class ReferenceRepository
|
||||
*
|
||||
* Get all stored references
|
||||
*
|
||||
* @psalm-return array<string, object>
|
||||
* @phpstan-return array<string, object>
|
||||
*/
|
||||
public function getReferences()
|
||||
{
|
||||
@@ -356,7 +356,7 @@ class ReferenceRepository
|
||||
/**
|
||||
* Get all stored references
|
||||
*
|
||||
* @psalm-return array<class-string, array<string, object>>
|
||||
* @phpstan-return array<class-string, array<string, object>>
|
||||
*/
|
||||
public function getReferencesByClass(): array
|
||||
{
|
||||
|
||||
@@ -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. */
|
||||
|
||||
Reference in New Issue
Block a user