mirror of
https://github.com/doctrine/data-fixtures.git
synced 2026-03-23 22:32:13 +01:00
@@ -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
|
||||
},
|
||||
{
|
||||
|
||||
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": "^10.5.3",
|
||||
"symfony/cache": "^6.4 || ^7",
|
||||
"symfony/var-exporter": "^6.4 || ^7",
|
||||
"vimeo/psalm": "^5.18"
|
||||
"symfony/var-exporter": "^6.4 || ^7"
|
||||
},
|
||||
"suggest": {
|
||||
"alcaeus/mongo-php-adapter": "For using MongoDB ODM 1.3 with PHP 7 (deprecated)",
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<files psalm-version="5.23.1@8471a896ccea3526b26d082f4461eeea467f10a4">
|
||||
<file src="src/Executor/PHPCRExecutor.php">
|
||||
<UndefinedClass>
|
||||
<code><![CDATA[DocumentManagerInterface]]></code>
|
||||
<code><![CDATA[DocumentManagerInterface]]></code>
|
||||
</UndefinedClass>
|
||||
</file>
|
||||
<file src="src/Purger/PHPCRPurger.php">
|
||||
<UndefinedClass>
|
||||
<code><![CDATA[$this->dm]]></code>
|
||||
<code><![CDATA[DocumentManager]]></code>
|
||||
<code><![CDATA[DocumentManagerInterface|null]]></code>
|
||||
<code><![CDATA[NodeHelper]]></code>
|
||||
<code><![CDATA[private]]></code>
|
||||
</UndefinedClass>
|
||||
</file>
|
||||
<file src="src/ReferenceRepository.php">
|
||||
<UndefinedClass>
|
||||
<code><![CDATA[PhpcrDocumentManager]]></code>
|
||||
<code><![CDATA[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>
|
||||
@@ -69,9 +69,9 @@ abstract class AbstractFixture implements SharedFixtureInterface
|
||||
*
|
||||
* @see ReferenceRepository::getReference()
|
||||
*
|
||||
* @psalm-param class-string<T> $class
|
||||
* @phpstan-param class-string<T> $class
|
||||
*
|
||||
* @psalm-return T
|
||||
* @phpstan-return T
|
||||
*
|
||||
* @template T of object
|
||||
*/
|
||||
@@ -86,7 +86,7 @@ abstract class AbstractFixture implements SharedFixtureInterface
|
||||
*
|
||||
* @see ReferenceRepository::hasReference()
|
||||
*
|
||||
* @psalm-param class-string $class
|
||||
* @phpstan-param class-string $class
|
||||
*/
|
||||
public function hasReference(string $name, string $class): 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(): array;
|
||||
}
|
||||
|
||||
@@ -39,14 +39,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 = [];
|
||||
|
||||
@@ -166,7 +166,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()
|
||||
{
|
||||
@@ -191,7 +191,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
|
||||
*/
|
||||
public function isTransient(string $className): bool
|
||||
{
|
||||
@@ -247,7 +247,7 @@ class Loader
|
||||
*/
|
||||
private function orderFixturesByDependencies(): void
|
||||
{
|
||||
/** @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
|
||||
@@ -348,7 +348,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);
|
||||
@@ -366,10 +366,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|null $classes = null): array
|
||||
{
|
||||
@@ -393,10 +393,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
|
||||
{
|
||||
|
||||
@@ -25,7 +25,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 = [];
|
||||
|
||||
@@ -34,7 +34,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 = [];
|
||||
|
||||
@@ -140,9 +140,9 @@ class ReferenceRepository
|
||||
* Loads an object using stored reference
|
||||
* named by $name
|
||||
*
|
||||
* @psalm-param class-string<T> $class
|
||||
* @phpstan-param class-string<T> $class
|
||||
*
|
||||
* @psalm-return T
|
||||
* @phpstan-return T
|
||||
*
|
||||
* @throws OutOfBoundsException - if repository does not exist.
|
||||
*
|
||||
@@ -172,7 +172,7 @@ class ReferenceRepository
|
||||
* Check if an object is stored using reference
|
||||
* named by $name
|
||||
*
|
||||
* @psalm-param class-string $class
|
||||
* @phpstan-param class-string $class
|
||||
*/
|
||||
public function hasReference(string $name, string $class): bool
|
||||
{
|
||||
@@ -208,7 +208,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
|
||||
{
|
||||
@@ -218,7 +218,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