Skip to content

Commit

Permalink
Merge release 1.6.4 into 1.7.x (#434)
Browse files Browse the repository at this point in the history
  • Loading branch information
derrabus authored Apr 3, 2023
2 parents 4707424 + 91e8365 commit 4d16277
Show file tree
Hide file tree
Showing 67 changed files with 107 additions and 86 deletions.
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
},
"require-dev": {
"ext-sqlite3": "*",
"doctrine/coding-standard": "^10.0",
"doctrine/coding-standard": "^11.0",
"doctrine/dbal": "^2.13 || ^3.0",
"doctrine/deprecations": "^1.0",
"doctrine/mongodb-odm": "^1.3.0 || ^2.0.0",
"doctrine/orm": "^2.12",
"phpstan/phpstan": "^1.5",
"phpunit/phpunit": "^8.5 || ^9.5",
"phpunit/phpunit": "^8.5 || ^9.5 || ^10.0",
"symfony/cache": "^5.0 || ^6.0",
"vimeo/psalm": "^4.10"
"vimeo/psalm": "^4.10 || ^5.9"
},
"suggest": {
"alcaeus/mongo-php-adapter": "For using MongoDB ODM 1.3 with PHP 7 (deprecated)",
Expand All @@ -49,12 +49,12 @@
},
"autoload": {
"psr-4": {
"Doctrine\\Common\\DataFixtures\\": "lib/Doctrine/Common/DataFixtures"
"Doctrine\\Common\\DataFixtures\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"Doctrine\\Tests\\": "tests/Doctrine/Tests"
"Doctrine\\Tests\\": "tests"
}
}
}
1 change: 1 addition & 0 deletions docs/en/how-to/fixture-ordering.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Option 1: Controlling the order manually
----------------------------------------

.. code-block:: php
<?php
namespace MyDataFixtures;
Expand Down
8 changes: 8 additions & 0 deletions docs/en/how-to/loading-fixtures.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Fixture classes have two requirements:
without arguments.

.. code-block:: php
<?php
namespace MyDataFixtures;
Expand Down Expand Up @@ -50,6 +51,7 @@ Loading fixtures
To load a fixture, you can call ``Loader::addFixture()``:

.. code-block:: php
<?php
use Doctrine\Common\DataFixtures\Loader;
Expand All @@ -61,6 +63,7 @@ To load a fixture, you can call ``Loader::addFixture()``:
It is also possible to load a fixture by providing its path:

.. code-block:: php
<?php
$loader->loadFromFile('/path/to/MyDataFixtures/MyFixture1.php');
Expand All @@ -69,12 +72,14 @@ want to load a whole directory of fixtures instead of making one call
per fixture.

.. code-block:: php
<?php
$loader->loadFromDirectory('/path/to/MyDataFixtures');
You can get the added fixtures using the ``getFixtures()`` method:

.. code-block:: php
<?php
$fixtures = $loader->getFixtures();
Expand All @@ -87,6 +92,7 @@ store you are using. For example, if you are using ORM, you should
do the following:

.. code-block:: php
<?php
use Doctrine\Common\DataFixtures\Executor\ORMExecutor;
use Doctrine\Common\DataFixtures\Purger\ORMPurger;
Expand All @@ -104,6 +110,7 @@ If you want to append the fixtures instead of purging before loading
then pass ``append: true`` to the ``execute()`` method:

.. code-block:: php
<?php
$executor->execute($loader->getFixtures(), append: true);
Expand All @@ -114,5 +121,6 @@ want to wrap the purge and the load of every fixture in its own transaction.
To do so, you can use ``MultipleTransactionORMExecutor``.

.. code-block:: php
<?php
$executor = new MultipleTransactionORMExecutor($entityManager, new ORMPurger());
2 changes: 2 additions & 0 deletions docs/en/how-to/sharing-objects-between-fixtures.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ showing how to use the ``AbstractFixture`` class to do that.
<loading-fixtures>` is satisfied if you extend ``AbstractFixture``.

.. code-block:: php
<?php
namespace MyDataFixtures;
Expand Down Expand Up @@ -43,6 +44,7 @@ showing how to use the ``AbstractFixture`` class to do that.
And the ``User`` data loading fixture:

.. code-block:: php
<?php
namespace MyDataFixtures;
Expand Down
20 changes: 10 additions & 10 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<!-- Ignore warnings and show progress of the run -->
<arg value="nps"/>

<file>lib</file>
<file>src</file>
<file>tests</file>

<rule ref="Doctrine">
Expand All @@ -30,21 +30,21 @@
</rule>

<rule ref="SlevomatCodingStandard.Classes.SuperfluousAbstractClassNaming">
<exclude-pattern>lib/Doctrine/Common/DataFixtures/AbstractFixture.php</exclude-pattern>
<exclude-pattern>lib/Doctrine/Common/DataFixtures/Executor/AbstractExecutor.php</exclude-pattern>
<exclude-pattern>src/AbstractFixture.php</exclude-pattern>
<exclude-pattern>src/Executor/AbstractExecutor.php</exclude-pattern>
</rule>

<rule ref="SlevomatCodingStandard.Classes.SuperfluousExceptionNaming">
<exclude-pattern>lib/Doctrine/Common/DataFixtures/Exception/CircularReferenceException.php</exclude-pattern>
<exclude-pattern>src/Exception/CircularReferenceException.php</exclude-pattern>
</rule>

<rule ref="SlevomatCodingStandard.Classes.SuperfluousInterfaceNaming">
<exclude-pattern>lib/Doctrine/Common/DataFixtures/DependentFixtureInterface.php</exclude-pattern>
<exclude-pattern>lib/Doctrine/Common/DataFixtures/FixtureInterface.php</exclude-pattern>
<exclude-pattern>lib/Doctrine/Common/DataFixtures/Purger/ORMPurgerInterface.php</exclude-pattern>
<exclude-pattern>lib/Doctrine/Common/DataFixtures/Purger/PurgerInterface.php</exclude-pattern>
<exclude-pattern>lib/Doctrine/Common/DataFixtures/OrderedFixtureInterface.php</exclude-pattern>
<exclude-pattern>lib/Doctrine/Common/DataFixtures/SharedFixtureInterface.php</exclude-pattern>
<exclude-pattern>src/DependentFixtureInterface.php</exclude-pattern>
<exclude-pattern>src/FixtureInterface.php</exclude-pattern>
<exclude-pattern>src/Purger/ORMPurgerInterface.php</exclude-pattern>
<exclude-pattern>src/Purger/PurgerInterface.php</exclude-pattern>
<exclude-pattern>src/OrderedFixtureInterface.php</exclude-pattern>
<exclude-pattern>src/SharedFixtureInterface.php</exclude-pattern>
</rule>

<rule ref="Squiz.Classes.ClassFileName.NoMatch">
Expand Down
44 changes: 22 additions & 22 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -3,109 +3,109 @@ parameters:
-
message: "#^Call to method transactional\\(\\) on an unknown class Doctrine\\\\ODM\\\\PHPCR\\\\DocumentManagerInterface\\.$#"
count: 1
path: lib/Doctrine/Common/DataFixtures/Executor/PHPCRExecutor.php
path: src/Executor/PHPCRExecutor.php

-
message: "#^Method Doctrine\\\\Common\\\\DataFixtures\\\\Executor\\\\PHPCRExecutor\\:\\:getObjectManager\\(\\) has invalid return type Doctrine\\\\ODM\\\\PHPCR\\\\DocumentManagerInterface\\.$#"
count: 1
path: lib/Doctrine/Common/DataFixtures/Executor/PHPCRExecutor.php
path: src/Executor/PHPCRExecutor.php

-
message: "#^Parameter \\$dm of method Doctrine\\\\Common\\\\DataFixtures\\\\Executor\\\\PHPCRExecutor\\:\\:__construct\\(\\) has invalid type Doctrine\\\\ODM\\\\PHPCR\\\\DocumentManagerInterface\\.$#"
count: 2
path: lib/Doctrine/Common/DataFixtures/Executor/PHPCRExecutor.php
path: src/Executor/PHPCRExecutor.php

-
message: "#^Property Doctrine\\\\Common\\\\DataFixtures\\\\Executor\\\\PHPCRExecutor\\:\\:\\$dm has unknown class Doctrine\\\\ODM\\\\PHPCR\\\\DocumentManagerInterface as its type\\.$#"
count: 1
path: lib/Doctrine/Common/DataFixtures/Executor/PHPCRExecutor.php
path: src/Executor/PHPCRExecutor.php

-
message: "#^Call to an undefined method Doctrine\\\\Common\\\\DataFixtures\\\\FixtureInterface\\:\\:getDependencies\\(\\)\\.$#"
count: 1
path: lib/Doctrine/Common/DataFixtures/Loader.php
path: src/Loader.php

-
message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\ObjectManager\\:\\:getReference\\(\\)\\.$#"
count: 2
path: lib/Doctrine/Common/DataFixtures/ProxyReferenceRepository.php
path: src/ProxyReferenceRepository.php

-
message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\ObjectManager\\:\\:getUnitOfWork\\(\\)\\.$#"
count: 1
path: lib/Doctrine/Common/DataFixtures/ProxyReferenceRepository.php
path: src/ProxyReferenceRepository.php

-
message: "#^Call to method getPhpcrSession\\(\\) on an unknown class Doctrine\\\\ODM\\\\PHPCR\\\\DocumentManagerInterface\\.$#"
count: 1
path: lib/Doctrine/Common/DataFixtures/Purger/PHPCRPurger.php
path: src/Purger/PHPCRPurger.php

-
message: "#^Call to static method purgeWorkspace\\(\\) on an unknown class PHPCR\\\\Util\\\\NodeHelper\\.$#"
count: 1
path: lib/Doctrine/Common/DataFixtures/Purger/PHPCRPurger.php
path: src/Purger/PHPCRPurger.php

-
message: "#^Method Doctrine\\\\Common\\\\DataFixtures\\\\Purger\\\\PHPCRPurger\\:\\:getObjectManager\\(\\) has invalid return type Doctrine\\\\ODM\\\\PHPCR\\\\DocumentManagerInterface\\.$#"
count: 1
path: lib/Doctrine/Common/DataFixtures/Purger/PHPCRPurger.php
path: src/Purger/PHPCRPurger.php

-
message: "#^Parameter \\$dm of method Doctrine\\\\Common\\\\DataFixtures\\\\Purger\\\\PHPCRPurger\\:\\:__construct\\(\\) has invalid type Doctrine\\\\ODM\\\\PHPCR\\\\DocumentManagerInterface\\.$#"
count: 1
path: lib/Doctrine/Common/DataFixtures/Purger/PHPCRPurger.php
path: src/Purger/PHPCRPurger.php

-
message: "#^Parameter \\$dm of method Doctrine\\\\Common\\\\DataFixtures\\\\Purger\\\\PHPCRPurger\\:\\:setDocumentManager\\(\\) has invalid type Doctrine\\\\ODM\\\\PHPCR\\\\DocumentManager\\.$#"
count: 1
path: lib/Doctrine/Common/DataFixtures/Purger/PHPCRPurger.php
path: src/Purger/PHPCRPurger.php

-
message: "#^Property Doctrine\\\\Common\\\\DataFixtures\\\\Purger\\\\PHPCRPurger\\:\\:\\$dm \\(Doctrine\\\\ODM\\\\PHPCR\\\\DocumentManagerInterface\\|null\\) does not accept Doctrine\\\\ODM\\\\PHPCR\\\\DocumentManager\\.$#"
count: 1
path: lib/Doctrine/Common/DataFixtures/Purger/PHPCRPurger.php
path: src/Purger/PHPCRPurger.php

-
message: "#^Property Doctrine\\\\Common\\\\DataFixtures\\\\Purger\\\\PHPCRPurger\\:\\:\\$dm has unknown class Doctrine\\\\ODM\\\\PHPCR\\\\DocumentManagerInterface as its type\\.$#"
count: 1
path: lib/Doctrine/Common/DataFixtures/Purger/PHPCRPurger.php
path: src/Purger/PHPCRPurger.php

-
message: "#^Access to an undefined property Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\<object\\>\\:\\:\\$name\\.$#"
count: 1
path: lib/Doctrine/Common/DataFixtures/ReferenceRepository.php
path: src/ReferenceRepository.php

-
message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\ObjectManager\\:\\:getReference\\(\\)\\.$#"
count: 1
path: lib/Doctrine/Common/DataFixtures/ReferenceRepository.php
path: src/ReferenceRepository.php

-
message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\ObjectManager\\:\\:getUnitOfWork\\(\\)\\.$#"
count: 2
path: lib/Doctrine/Common/DataFixtures/ReferenceRepository.php
path: src/ReferenceRepository.php

-
message: "#^Class Doctrine\\\\ODM\\\\PHPCR\\\\DocumentManager not found\\.$#"
count: 2
path: lib/Doctrine/Common/DataFixtures/ReferenceRepository.php
path: src/ReferenceRepository.php

-
message: "#^Method Doctrine\\\\Tests\\\\Common\\\\DataFixtures\\\\FixtureWithUnexistentDependency\\:\\:getDependencies\\(\\) should return array\\<class\\-string\\<Doctrine\\\\Common\\\\DataFixtures\\\\FixtureInterface\\>\\> but returns array\\<int, string\\>\\.$#"
count: 1
path: tests/Doctrine/Tests/Common/DataFixtures/DependentFixtureTest.php
path: tests/Common/DataFixtures/DependentFixtureTest.php

-
message: "#^Call to method expects\\(\\) on an unknown class Doctrine\\\\ODM\\\\PHPCR\\\\DocumentManager\\.$#"
count: 5
path: tests/Doctrine/Tests/Common/DataFixtures/Executor/PHPCRExecutorTest.php
path: tests/Common/DataFixtures/Executor/PHPCRExecutorTest.php

-
message: "#^Method Doctrine\\\\Tests\\\\Common\\\\DataFixtures\\\\Executor\\\\PHPCRExecutorTest\\:\\:getDocumentManager\\(\\) has invalid return type Doctrine\\\\ODM\\\\PHPCR\\\\DocumentManager\\.$#"
count: 1
path: tests/Doctrine/Tests/Common/DataFixtures/Executor/PHPCRExecutorTest.php
path: tests/Common/DataFixtures/Executor/PHPCRExecutorTest.php

-
message: "#^Call to an undefined method Doctrine\\\\ODM\\\\MongoDB\\\\DocumentManager\\:\\:getConnection\\(\\)\\.$#"
count: 1
path: tests/Doctrine/Tests/Common/DataFixtures/Purger/MongoDBPurgerTest.php
path: tests/Common/DataFixtures/Purger/MongoDBPurgerTest.php
4 changes: 2 additions & 2 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
parameters:
phpVersion: 70100
phpVersion: 80200
level: 3
paths:
- lib
- src
- tests

includes:
Expand Down
12 changes: 6 additions & 6 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
>
<testsuites>
<testsuite name="Doctrine Data Fixtures Test Suite">
<directory>./tests/Doctrine/</directory>
<directory>./tests</directory>
</testsuite>
</testsuites>

<filter>
<whitelist>
<directory>./lib/Doctrine/</directory>
</whitelist>
</filter>
<coverage>
<include>
<directory>./src</directory>
</include>
</coverage>
</phpunit>
6 changes: 3 additions & 3 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="4.22.0@fc2c6ab4d5fa5d644d8617089f012f3bb84b8703">
<file src="lib/Doctrine/Common/DataFixtures/Executor/PHPCRExecutor.php">
<file src="src/Executor/PHPCRExecutor.php">
<UndefinedClass occurrences="1">
<code>DocumentManagerInterface</code>
</UndefinedClass>
Expand All @@ -9,7 +9,7 @@
<code>DocumentManagerInterface</code>
</UndefinedDocblockClass>
</file>
<file src="lib/Doctrine/Common/DataFixtures/Purger/PHPCRPurger.php">
<file src="src/Purger/PHPCRPurger.php">
<UndefinedClass occurrences="3">
<code>?DocumentManagerInterface</code>
<code>DocumentManager</code>
Expand All @@ -21,7 +21,7 @@
<code>DocumentManagerInterface|null</code>
</UndefinedDocblockClass>
</file>
<file src="lib/Doctrine/Common/DataFixtures/ReferenceRepository.php">
<file src="src/ReferenceRepository.php">
<UndefinedClass occurrences="2">
<code>PhpcrDocumentManager</code>
<code>PhpcrDocumentManager</code>
Expand Down
4 changes: 3 additions & 1 deletion psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
<psalm
phpVersion="7.4"
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="lib/Doctrine/Common/DataFixtures" />
<directory name="src" />
<ignoreFiles>
<directory name="vendor" />
</ignoreFiles>
Expand Down
Loading

0 comments on commit 4d16277

Please sign in to comment.