From f8591f0bbb55f11406c73b5950a85c56e508f48f Mon Sep 17 00:00:00 2001 From: Vincent Langlet Date: Sun, 31 Mar 2024 18:22:11 +0200 Subject: [PATCH 1/2] Improve getClassMetadata phpdoc --- src/EntityManagerInterface.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EntityManagerInterface.php b/src/EntityManagerInterface.php index 326cb933a59..b3b5ddf9e13 100644 --- a/src/EntityManagerInterface.php +++ b/src/EntityManagerInterface.php @@ -340,7 +340,7 @@ public function hasFilters(); * @psalm-param string|class-string $className * * @return Mapping\ClassMetadata - * @psalm-return Mapping\ClassMetadata + * @psalm-return ($className is class-string ? Mapping\ClassMetadata : Mapping\ClassMetadata) * * @psalm-template T of object */ From 8c6c1f4aa2c34d5cafa322539b24de587f55da9b Mon Sep 17 00:00:00 2001 From: Vincent Langlet Date: Sun, 31 Mar 2024 18:33:35 +0200 Subject: [PATCH 2/2] Update baseline --- phpstan-baseline.neon | 5 ----- psalm-baseline.xml | 8 -------- 2 files changed, 13 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index c33099dee7a..6f0a73dd5a3 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -135,11 +135,6 @@ parameters: count: 2 path: src/EntityManager.php - - - message: "#^Template type T of method Doctrine\\\\ORM\\\\EntityManagerInterface\\:\\:getClassMetadata\\(\\) is not referenced in a parameter\\.$#" - count: 1 - path: src/EntityManagerInterface.php - - message: "#^Method Doctrine\\\\ORM\\\\EntityRepository\\:\\:matching\\(\\) should return Doctrine\\\\Common\\\\Collections\\\\AbstractLazyCollection\\&Doctrine\\\\Common\\\\Collections\\\\Selectable\\ but returns Doctrine\\\\ORM\\\\LazyCriteriaCollection\\<\\(int\\|string\\), object\\>\\.$#" count: 1 diff --git a/psalm-baseline.xml b/psalm-baseline.xml index d04835c1e85..6c70101de13 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -257,12 +257,6 @@ - - wrapped->getClassMetadata($className)]]> - - - - @@ -309,11 +303,9 @@ name ? $entity : null]]> load($sortedId, null, null, [], $lockMode)]]> loadById($sortedId)]]> - metadataFactory->getMetadataFor($className)]]> -