From 5bfddc6403447b069a6331a3a1722d99c0201eb2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 07:47:59 +0000 Subject: [PATCH 1/3] Bump doctrine/.github from 5.2.0 to 5.3.0 Bumps [doctrine/.github](https://github.com/doctrine/.github) from 5.2.0 to 5.3.0. - [Release notes](https://github.com/doctrine/.github/releases) - [Commits](https://github.com/doctrine/.github/compare/5.2.0...5.3.0) --- updated-dependencies: - dependency-name: doctrine/.github dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/coding-standards.yml | 2 +- .github/workflows/documentation.yml | 2 +- .github/workflows/release-on-milestone-closed.yml | 2 +- .github/workflows/static-analysis.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index dd7f14f7..6eab7ae4 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -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@5.3.0" diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index bf2ba69d..6ef2b0bb 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -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@5.3.0" diff --git a/.github/workflows/release-on-milestone-closed.yml b/.github/workflows/release-on-milestone-closed.yml index 67a81bf8..429cc0b1 100644 --- a/.github/workflows/release-on-milestone-closed.yml +++ b/.github/workflows/release-on-milestone-closed.yml @@ -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@5.3.0" secrets: GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }} GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }} diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index ccaea7ce..b51b14ad 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/phpstan.yml@5.2.0" + uses: "doctrine/.github/.github/workflows/phpstan.yml@5.3.0" From 2597a89bfc6e08542052b3f56185173422a3bd3f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Dec 2024 08:07:42 +0000 Subject: [PATCH 2/3] Bump doctrine/.github from 5.3.0 to 6.0.0 Bumps [doctrine/.github](https://github.com/doctrine/.github) from 5.3.0 to 6.0.0. - [Release notes](https://github.com/doctrine/.github/releases) - [Commits](https://github.com/doctrine/.github/compare/5.3.0...6.0.0) --- updated-dependencies: - dependency-name: doctrine/.github dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/coding-standards.yml | 2 +- .github/workflows/documentation.yml | 2 +- .github/workflows/release-on-milestone-closed.yml | 2 +- .github/workflows/static-analysis.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index 6eab7ae4..56dfa4e8 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -11,4 +11,4 @@ on: jobs: coding-standards: name: "Coding Standards" - uses: "doctrine/.github/.github/workflows/coding-standards.yml@5.3.0" + uses: "doctrine/.github/.github/workflows/coding-standards.yml@6.0.0" diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 6ef2b0bb..84bf616c 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -17,4 +17,4 @@ on: jobs: documentation: name: "Documentation" - uses: "doctrine/.github/.github/workflows/documentation.yml@5.3.0" + uses: "doctrine/.github/.github/workflows/documentation.yml@6.0.0" diff --git a/.github/workflows/release-on-milestone-closed.yml b/.github/workflows/release-on-milestone-closed.yml index 429cc0b1..af9efcda 100644 --- a/.github/workflows/release-on-milestone-closed.yml +++ b/.github/workflows/release-on-milestone-closed.yml @@ -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.3.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 }} diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index b51b14ad..02c95256 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/phpstan.yml@5.3.0" + uses: "doctrine/.github/.github/workflows/phpstan.yml@6.0.0" From 33b858aa13a346076f6a2629e45e5b603f0f613d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Mon, 2 Dec 2024 13:09:42 +0100 Subject: [PATCH 3/3] Bump PHPStan to level 7 While working on a static analysis improvement on another PR, I was surprised not to have any baseline to modify. Here is a big baseline we could work on. --- phpstan-baseline.neon | 230 ++++++++++++++++++++++++++++++++++++++++++ phpstan.neon.dist | 2 +- 2 files changed, 231 insertions(+), 1 deletion(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 5cda74c7..789cda34 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,5 +1,30 @@ parameters: ignoreErrors: + - + message: "#^Strict comparison using \\=\\=\\= between array\\ and false will always evaluate to false\\.$#" + count: 1 + path: src/Event/Listener/MongoDBReferenceListener.php + + - + message: "#^Strict comparison using \\=\\=\\= between array\\ and false will always evaluate to false\\.$#" + count: 1 + path: src/Event/Listener/ORMReferenceListener.php + + - + message: "#^Method class@anonymous/src/Executor/AbstractExecutor\\.php\\:131\\:\\:log\\(\\) has parameter \\$message with no type specified\\.$#" + count: 1 + path: src/Executor/AbstractExecutor.php + + - + message: "#^Method class@anonymous/src/Executor/AbstractExecutor\\.php\\:95\\:\\:log\\(\\) has parameter \\$message with no type specified\\.$#" + count: 1 + path: src/Executor/AbstractExecutor.php + + - + message: "#^Strict comparison using \\!\\=\\= between null and null will always evaluate to false\\.$#" + count: 1 + path: src/Executor/AbstractExecutor.php + - message: "#^Call to method transactional\\(\\) on an unknown class Doctrine\\\\ODM\\\\PHPCR\\\\DocumentManagerInterface\\.$#" count: 1 @@ -10,6 +35,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 @@ -25,6 +60,36 @@ parameters: count: 1 path: src/Loader.php + - + message: "#^Method Doctrine\\\\Common\\\\DataFixtures\\\\Loader\\:\\:addFixture\\(\\) has no return type specified\\.$#" + 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\\\\> but returns array\\, class\\-string\\\\|class\\-string\\\\>\\.$#" + 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\\, int\\>, array\\\\|class\\-string\\, int\\> given\\.$#" + count: 2 + path: src/Loader.php + - message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\ObjectManager\\:\\:getReference\\(\\)\\.$#" count: 2 @@ -35,6 +100,46 @@ parameters: 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 @@ -50,6 +155,11 @@ parameters: count: 1 path: src/Purger/PHPCRPurger.php + - + message: "#^Method Doctrine\\\\Common\\\\DataFixtures\\\\Purger\\\\PHPCRPurger\\:\\:setDocumentManager\\(\\) has no return type specified\\.$#" + count: 1 + 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 @@ -85,11 +195,76 @@ 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: "#^Method Doctrine\\\\Common\\\\DataFixtures\\\\ReferenceRepository\\:\\:getIdentifier\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/ReferenceRepository.php + + - + message: "#^Parameter \\#1 \\$className of method Doctrine\\\\Persistence\\\\ObjectManager\\:\\:getClassMetadata\\(\\) expects class\\-string\\, string given\\.$#" + count: 2 + path: src/ReferenceRepository.php + + - + message: "#^Property Doctrine\\\\Common\\\\DataFixtures\\\\ReferenceRepository\\:\\:\\$identitiesByClass \\(array\\\\>\\) does not accept array\\\\>\\.$#" + count: 2 + path: src/ReferenceRepository.php + + - + message: "#^Property Doctrine\\\\Common\\\\DataFixtures\\\\ReferenceRepository\\:\\:\\$referencesByClass \\(array\\\\>\\) does not accept array\\\\>\\.$#" + count: 1 + path: src/ReferenceRepository.php + + - + message: "#^Property Doctrine\\\\Common\\\\DataFixtures\\\\ReferenceRepository\\:\\:\\$referencesByClass \\(array\\\\>\\) does not accept array\\\\>\\.$#" + count: 1 + path: src/ReferenceRepository.php + + - + message: "#^Unable to resolve the template type T in call to method Doctrine\\\\Persistence\\\\ObjectManager\\:\\:getClassMetadata\\(\\)$#" + count: 2 + 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\\\\> but returns array\\\\.$#" count: 1 @@ -105,7 +280,62 @@ parameters: count: 2 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: "#^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 diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 20b0dc06..b8c2369b 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -1,6 +1,6 @@ parameters: phpVersion: 80200 - level: 3 + level: 7 paths: - src - tests