Skip to content

Commit

Permalink
Merge pull request #511 from doctrine/2.0.x-merge-up-into-2.1.x_4CNqClcZ
Browse files Browse the repository at this point in the history
Merge release 2.0.1 into 2.1.x
  • Loading branch information
greg0ire authored Dec 10, 2024
2 parents eddc4c3 + 2ae4513 commit 85f5b7f
Show file tree
Hide file tree
Showing 10 changed files with 225 additions and 12 deletions.
20 changes: 16 additions & 4 deletions .doctrine-project.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,34 @@
"docsSlug": "doctrine-data-fixtures",
"versions": [
{
"name": "2.0",
"branchName": "2.0.x",
"name": "3.0",
"branchName": "3.0.x",
"slug": "latest",
"upcoming": true
},
{
"name": "2.1",
"branchName": "2.1.x",
"slug": "2.1",
"upcoming": true
},
{
"name": "2.0",
"branchName": "2.0.x",
"slug": "2.0",
"current": true
},
{
"name": "1.8",
"branchName": "1.8.x",
"slug": "1.8",
"upcoming": true
"maintained": true
},
{
"name": "1.7",
"branchName": "1.7.x",
"slug": "1.7",
"current": true
"maintained": false
},
{
"name": "1.6",
Expand Down
1 change: 1 addition & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ updates:
interval: "weekly"
labels:
- "CI"
target-branch: "1.8.x"
2 changes: 1 addition & 1 deletion .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ on:
jobs:
coding-standards:
name: "Coding Standards"
uses: "doctrine/.github/.github/workflows/coding-standards.yml@5.2.0"
uses: "doctrine/.github/.github/workflows/coding-standards.yml@6.0.0"
2 changes: 1 addition & 1 deletion .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
path: "reports"

- name: "Upload to Codecov"
uses: "codecov/codecov-action@v4"
uses: "codecov/codecov-action@v5"
with:
directory: "reports"
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ on:
jobs:
documentation:
name: "Documentation"
uses: "doctrine/.github/.github/workflows/documentation.yml@5.2.0"
uses: "doctrine/.github/.github/workflows/documentation.yml@6.0.0"
2 changes: 1 addition & 1 deletion .github/workflows/release-on-milestone-closed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
release:
name: "Git tag, release & create merge-up PR"
uses: "doctrine/.github/.github/workflows/release-on-milestone-closed.yml@5.2.0"
uses: "doctrine/.github/.github/workflows/release-on-milestone-closed.yml@6.0.0"
secrets:
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }}
GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ on:
jobs:
static-analysis:
name: "Static Analysis"
uses: "doctrine/.github/.github/workflows/phpstan.yml@5.2.0"
uses: "doctrine/.github/.github/workflows/phpstan.yml@6.0.0"
200 changes: 200 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
parameters:
ignoreErrors:
-
message: "#^Strict comparison using \\=\\=\\= between array\\<string\\> and false will always evaluate to false\\.$#"
count: 1
path: src/Event/Listener/MongoDBReferenceListener.php

-
message: "#^Strict comparison using \\=\\=\\= between array\\<string\\> and false will always evaluate to false\\.$#"
count: 1
path: src/Event/Listener/ORMReferenceListener.php

-
message: "#^Call to method transactional\\(\\) on an unknown class Doctrine\\\\ODM\\\\PHPCR\\\\DocumentManagerInterface\\.$#"
count: 1
Expand All @@ -10,6 +20,16 @@ parameters:
count: 1
path: src/Executor/PHPCRExecutor.php

-
message: "#^Parameter \\#1 \\$dm of method Doctrine\\\\Common\\\\DataFixtures\\\\Purger\\\\PHPCRPurger\\:\\:setDocumentManager\\(\\) expects Doctrine\\\\ODM\\\\PHPCR\\\\DocumentManager, Doctrine\\\\ODM\\\\PHPCR\\\\DocumentManagerInterface given\\.$#"
count: 1
path: src/Executor/PHPCRExecutor.php

-
message: "#^Parameter \\#1 \\$manager of method Doctrine\\\\Common\\\\DataFixtures\\\\Executor\\\\AbstractExecutor\\:\\:__construct\\(\\) expects Doctrine\\\\Persistence\\\\ObjectManager, Doctrine\\\\ODM\\\\PHPCR\\\\DocumentManagerInterface given\\.$#"
count: 1
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
Expand All @@ -25,11 +45,76 @@ parameters:
count: 1
path: src/Loader.php

-
message: "#^Method Doctrine\\\\Common\\\\DataFixtures\\\\Loader\\:\\:createFixture\\(\\) should return Doctrine\\\\Common\\\\DataFixtures\\\\FixtureInterface but returns object\\.$#"
count: 1
path: src/Loader.php

-
message: "#^Method Doctrine\\\\Common\\\\DataFixtures\\\\Loader\\:\\:getUnsequencedClasses\\(\\) should return array\\<class\\-string\\<Doctrine\\\\Common\\\\DataFixtures\\\\FixtureInterface\\>\\> but returns array\\<int\\<0, max\\>, class\\-string\\<Doctrine\\\\Common\\\\DataFixtures\\\\DependentFixtureInterface\\>\\|class\\-string\\<Doctrine\\\\Common\\\\DataFixtures\\\\FixtureInterface\\>\\>\\.$#"
count: 1
path: src/Loader.php

-
message: "#^Method Doctrine\\\\Common\\\\DataFixtures\\\\Loader\\:\\:loadFromDirectory\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
path: src/Loader.php

-
message: "#^Method Doctrine\\\\Common\\\\DataFixtures\\\\Loader\\:\\:loadFromFile\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
path: src/Loader.php

-
message: "#^Parameter \\#1 \\$sequences of method Doctrine\\\\Common\\\\DataFixtures\\\\Loader\\:\\:getUnsequencedClasses\\(\\) expects array\\<class\\-string\\<Doctrine\\\\Common\\\\DataFixtures\\\\DependentFixtureInterface\\>, int\\>, array\\<class\\-string\\<Doctrine\\\\Common\\\\DataFixtures\\\\DependentFixtureInterface\\>\\|class\\-string\\<Doctrine\\\\Common\\\\DataFixtures\\\\FixtureInterface\\>, int\\> given\\.$#"
count: 2
path: src/Loader.php

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

-
message: "#^Expression on left side of \\?\\? is not nullable\\.$#"
count: 1
path: src/Purger/ORMPurger.php

-
message: "#^Method Doctrine\\\\Common\\\\DataFixtures\\\\Purger\\\\ORMPurger\\:\\:getAssociationTables\\(\\) has parameter \\$classes with generic class Doctrine\\\\ORM\\\\Mapping\\\\ClassMetadata but does not specify its types\\: T$#"
count: 1
path: src/Purger/ORMPurger.php

-
message: "#^Method Doctrine\\\\Common\\\\DataFixtures\\\\Purger\\\\ORMPurger\\:\\:getCommitOrder\\(\\) has parameter \\$classes with generic class Doctrine\\\\ORM\\\\Mapping\\\\ClassMetadata but does not specify its types\\: T$#"
count: 1
path: src/Purger/ORMPurger.php

-
message: "#^Method Doctrine\\\\Common\\\\DataFixtures\\\\Purger\\\\ORMPurger\\:\\:getCommitOrder\\(\\) return type with generic class Doctrine\\\\ORM\\\\Mapping\\\\ClassMetadata does not specify its types\\: T$#"
count: 1
path: src/Purger/ORMPurger.php

-
message: "#^Method Doctrine\\\\Common\\\\DataFixtures\\\\Purger\\\\ORMPurger\\:\\:getJoinTableName\\(\\) has parameter \\$class with generic class Doctrine\\\\ORM\\\\Mapping\\\\ClassMetadata but does not specify its types\\: T$#"
count: 1
path: src/Purger/ORMPurger.php

-
message: "#^Method Doctrine\\\\Common\\\\DataFixtures\\\\Purger\\\\ORMPurger\\:\\:getTableName\\(\\) has parameter \\$class with generic class Doctrine\\\\ORM\\\\Mapping\\\\ClassMetadata but does not specify its types\\: T$#"
count: 1
path: src/Purger/ORMPurger.php

-
message: "#^Parameter \\#1 \\$assoc of method Doctrine\\\\Common\\\\DataFixtures\\\\Purger\\\\ORMPurger\\:\\:getJoinTableName\\(\\) expects array\\|Doctrine\\\\ORM\\\\Mapping\\\\ManyToManyOwningSideMapping, Doctrine\\\\ORM\\\\Mapping\\\\ManyToManyInverseSideMapping\\|Doctrine\\\\ORM\\\\Mapping\\\\ManyToManyOwningSideMapping\\|Doctrine\\\\ORM\\\\Mapping\\\\ManyToOneAssociationMapping\\|Doctrine\\\\ORM\\\\Mapping\\\\OneToManyAssociationMapping\\|Doctrine\\\\ORM\\\\Mapping\\\\OneToOneInverseSideMapping\\|Doctrine\\\\ORM\\\\Mapping\\\\OneToOneOwningSideMapping given\\.$#"
count: 1
path: src/Purger/ORMPurger.php

-
message: "#^Parameter \\#1 \\$association of method Doctrine\\\\ORM\\\\Mapping\\\\QuoteStrategy\\:\\:getJoinTableName\\(\\) expects Doctrine\\\\ORM\\\\Mapping\\\\ManyToManyOwningSideMapping, array\\|Doctrine\\\\ORM\\\\Mapping\\\\ManyToManyOwningSideMapping given\\.$#"
count: 1
path: src/Purger/ORMPurger.php

-
message: "#^Call to method getPhpcrSession\\(\\) on an unknown class Doctrine\\\\ODM\\\\PHPCR\\\\DocumentManagerInterface\\.$#"
count: 1
Expand Down Expand Up @@ -85,11 +170,66 @@ parameters:
count: 2
path: src/ReferenceRepository.php

-
message: "#^Call to an undefined method object\\:\\:getDocumentId\\(\\)\\.$#"
count: 1
path: src/ReferenceRepository.php

-
message: "#^Call to an undefined method object\\:\\:getDocumentIdentifier\\(\\)\\.$#"
count: 1
path: src/ReferenceRepository.php

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

-
message: "#^Parameter \\#1 \\$className of method Doctrine\\\\Persistence\\\\ObjectManager\\:\\:getClassMetadata\\(\\) expects class\\-string\\<object\\>, string given\\.$#"
count: 1
path: src/ReferenceRepository.php

-
message: "#^Property Doctrine\\\\Common\\\\DataFixtures\\\\ReferenceRepository\\:\\:\\$identitiesByClass \\(array\\<class\\-string, array\\<string, mixed\\>\\>\\) does not accept array\\<string, array\\<string, mixed\\>\\>\\.$#"
count: 1
path: src/ReferenceRepository.php

-
message: "#^Property Doctrine\\\\Common\\\\DataFixtures\\\\ReferenceRepository\\:\\:\\$referencesByClass \\(array\\<class\\-string, array\\<string, object\\>\\>\\) does not accept array\\<string, array\\<string, object\\>\\>\\.$#"
count: 1
path: src/ReferenceRepository.php

-
message: "#^Unable to resolve the template type T in call to method Doctrine\\\\Persistence\\\\ObjectManager\\:\\:getClassMetadata\\(\\)$#"
count: 1
path: src/ReferenceRepository.php

-
message: "#^Method Doctrine\\\\Common\\\\DataFixtures\\\\Sorter\\\\TopologicalSorter\\:\\:addNode\\(\\) has parameter \\$node with generic class Doctrine\\\\ORM\\\\Mapping\\\\ClassMetadata but does not specify its types\\: T$#"
count: 1
path: src/Sorter/TopologicalSorter.php

-
message: "#^Method Doctrine\\\\Common\\\\DataFixtures\\\\Sorter\\\\TopologicalSorter\\:\\:sort\\(\\) return type with generic class Doctrine\\\\ORM\\\\Mapping\\\\ClassMetadata does not specify its types\\: T$#"
count: 1
path: src/Sorter/TopologicalSorter.php

-
message: "#^Property Doctrine\\\\Common\\\\DataFixtures\\\\Sorter\\\\TopologicalSorter\\:\\:\\$sortedNodeList with generic class Doctrine\\\\ORM\\\\Mapping\\\\ClassMetadata does not specify its types\\: T$#"
count: 1
path: src/Sorter/TopologicalSorter.php

-
message: "#^Method Doctrine\\\\Common\\\\DataFixtures\\\\Sorter\\\\Vertex\\:\\:__construct\\(\\) has parameter \\$value with generic class Doctrine\\\\ORM\\\\Mapping\\\\ClassMetadata but does not specify its types\\: T$#"
count: 1
path: src/Sorter/Vertex.php

-
message: "#^Property Doctrine\\\\Common\\\\DataFixtures\\\\Sorter\\\\Vertex\\:\\:\\$value with generic class Doctrine\\\\ORM\\\\Mapping\\\\ClassMetadata does not specify its types\\: T$#"
count: 1
path: src/Sorter/Vertex.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
Expand All @@ -105,7 +245,67 @@ parameters:
count: 1
path: tests/Common/DataFixtures/Executor/PHPCRExecutorTest.php

-
message: "#^Parameter \\#1 \\$dm of class Doctrine\\\\Common\\\\DataFixtures\\\\Executor\\\\PHPCRExecutor constructor expects Doctrine\\\\ODM\\\\PHPCR\\\\DocumentManagerInterface, Doctrine\\\\ODM\\\\PHPCR\\\\DocumentManager&PHPUnit\\\\Framework\\\\MockObject\\\\MockObject given\\.$#"
count: 5
path: tests/Common/DataFixtures/Executor/PHPCRExecutorTest.php

-
message: "#^Parameter \\#2 \\$purger of class Doctrine\\\\Common\\\\DataFixtures\\\\Executor\\\\PHPCRExecutor constructor expects Doctrine\\\\Common\\\\DataFixtures\\\\Purger\\\\PHPCRPurger\\|null, Doctrine\\\\Common\\\\DataFixtures\\\\Purger\\\\PHPCRPurgerInterface&PHPUnit\\\\Framework\\\\MockObject\\\\MockObject given\\.$#"
count: 3
path: tests/Common/DataFixtures/Executor/PHPCRExecutorTest.php

-
message: "#^Call to an undefined method Doctrine\\\\ODM\\\\MongoDB\\\\DocumentManager\\:\\:getConnection\\(\\)\\.$#"
count: 1
path: tests/Common/DataFixtures/Purger/MongoDBPurgerTest.php

-
message: "#^Parameter \\#1 \\$name of class Doctrine\\\\ORM\\\\Mapping\\\\ClassMetadata constructor expects class\\-string\\<1\\>, string given\\.$#"
count: 6
path: tests/Common/DataFixtures/Sorter/TopologicalSorterTest.php

-
message: "#^Parameter \\#1 \\$name of class Doctrine\\\\ORM\\\\Mapping\\\\ClassMetadata constructor expects class\\-string\\<2\\>, string given\\.$#"
count: 5
path: tests/Common/DataFixtures/Sorter/TopologicalSorterTest.php

-
message: "#^Parameter \\#1 \\$name of class Doctrine\\\\ORM\\\\Mapping\\\\ClassMetadata constructor expects class\\-string\\<3\\>, string given\\.$#"
count: 5
path: tests/Common/DataFixtures/Sorter/TopologicalSorterTest.php

-
message: "#^Parameter \\#1 \\$name of class Doctrine\\\\ORM\\\\Mapping\\\\ClassMetadata constructor expects class\\-string\\<4\\>, string given\\.$#"
count: 3
path: tests/Common/DataFixtures/Sorter/TopologicalSorterTest.php

-
message: "#^Parameter \\#1 \\$name of class Doctrine\\\\ORM\\\\Mapping\\\\ClassMetadata constructor expects class\\-string\\<5\\>, string given\\.$#"
count: 3
path: tests/Common/DataFixtures/Sorter/TopologicalSorterTest.php

-
message: "#^Parameter \\#1 \\$name of class Doctrine\\\\ORM\\\\Mapping\\\\ClassMetadata constructor expects class\\-string\\<\\\\Sample\\\\Entity\\>, string given\\.$#"
count: 1
path: tests/Common/DataFixtures/Sorter/VertexTest.php

-
message: "#^Method Doctrine\\\\Tests\\\\Common\\\\DataFixtures\\\\TestEntity\\\\Quoted\\:\\:getSelects\\(\\) return type with generic interface Doctrine\\\\Common\\\\Collections\\\\Collection does not specify its types\\: TKey, T$#"
count: 1
path: tests/Common/DataFixtures/TestEntity/Quoted.php

-
message: "#^Method Doctrine\\\\Tests\\\\Common\\\\DataFixtures\\\\TestEntity\\\\Quoted\\:\\:setSelects\\(\\) has parameter \\$selects with generic interface Doctrine\\\\Common\\\\Collections\\\\Collection but does not specify its types\\: TKey, T$#"
count: 1
path: tests/Common/DataFixtures/TestEntity/Quoted.php

-
message: "#^Property Doctrine\\\\Tests\\\\Common\\\\DataFixtures\\\\TestEntity\\\\Quoted\\:\\:\\$selects with generic interface Doctrine\\\\Common\\\\Collections\\\\Collection does not specify its types\\: TKey, T$#"
count: 1
path: tests/Common/DataFixtures/TestEntity/Quoted.php

-
message: "#^Method Doctrine\\\\Tests\\\\Common\\\\DataFixtures\\\\TestValueObjects\\\\Uuid\\:\\:__unserialize\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#"
count: 1
path: tests/Common/DataFixtures/TestValueObjects/Uuid.php
2 changes: 1 addition & 1 deletion phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
parameters:
phpVersion: 80200
level: 3
level: 7
paths:
- src
- tests
Expand Down
4 changes: 2 additions & 2 deletions src/ReferenceRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function __construct(ObjectManager $manager)
* @param object $reference Reference object
* @param object $uow Unit of work
*/
protected function getIdentifier(object $reference, object $uow): array
protected function getIdentifier(object $reference, object $uow): mixed
{
// In case Reference is not yet managed in UnitOfWork
if (! $this->hasIdentifier($reference)) {
Expand Down Expand Up @@ -208,7 +208,7 @@ public function hasIdentity(string $name, string $class): bool
/**
* Get all stored identities
*
* @phpstan-return array<class-string, array<string, object>>
* @phpstan-return array<class-string, array<string, mixed>>
*/
public function getIdentitiesByClass(): array
{
Expand Down

0 comments on commit 85f5b7f

Please sign in to comment.