diff --git a/lib/Doctrine/ORM/EntityManagerInterface.php b/lib/Doctrine/ORM/EntityManagerInterface.php index 1358f435745..3cdc8df5025 100644 --- a/lib/Doctrine/ORM/EntityManagerInterface.php +++ b/lib/Doctrine/ORM/EntityManagerInterface.php @@ -23,7 +23,6 @@ use BadMethodCallException; use DateTimeInterface; use Doctrine\Common\EventManager; -use Doctrine\Common\Proxy\Proxy; use Doctrine\DBAL\Connection; use Doctrine\ORM\Internal\Hydration\AbstractHydrator; use Doctrine\ORM\Proxy\ProxyFactory; @@ -170,7 +169,7 @@ public function createQueryBuilder(); * @psalm-param class-string $entityName * * @return object|null The entity reference. - * @psalm-return (T&Proxy)|null + * @psalm-return T|null * * @throws ORMException * @@ -198,7 +197,7 @@ public function getReference($entityName, $id); * @psalm-param class-string $entityName * * @return object|null The (partial) entity reference - * @psalm-return (T&Proxy)|null + * @psalm-return T|null * * @template T */ diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index f54e5aba1ff..aee50bf5c69 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -161,22 +161,22 @@ parameters: path: lib/Doctrine/ORM/EntityManager.php - - message: "#^Method Doctrine\\\\ORM\\\\EntityManager\\:\\:getPartialReference\\(\\) should return \\(Doctrine\\\\Common\\\\Proxy\\\\Proxy&T\\)\\|null but returns object\\.$#" + message: "#^Method Doctrine\\\\ORM\\\\EntityManager\\:\\:getPartialReference\\(\\) should return T\\|null but returns object\\.$#" count: 1 path: lib/Doctrine/ORM/EntityManager.php - - message: "#^Method Doctrine\\\\ORM\\\\EntityManager\\:\\:getPartialReference\\(\\) should return \\(Doctrine\\\\Common\\\\Proxy\\\\Proxy&T\\)\\|null but returns object\\|null\\.$#" + message: "#^Method Doctrine\\\\ORM\\\\EntityManager\\:\\:getPartialReference\\(\\) should return T\\|null but returns object\\|null\\.$#" count: 1 path: lib/Doctrine/ORM/EntityManager.php - - message: "#^Method Doctrine\\\\ORM\\\\EntityManager\\:\\:getReference\\(\\) should return \\(Doctrine\\\\Common\\\\Proxy\\\\Proxy&T\\)\\|null but returns Doctrine\\\\Common\\\\Proxy\\\\Proxy\\.$#" + message: "#^Method Doctrine\\\\ORM\\\\EntityManager\\:\\:getReference\\(\\) should return T\\|null but returns Doctrine\\\\Common\\\\Proxy\\\\Proxy\\.$#" count: 1 path: lib/Doctrine/ORM/EntityManager.php - - message: "#^Method Doctrine\\\\ORM\\\\EntityManager\\:\\:getReference\\(\\) should return \\(Doctrine\\\\Common\\\\Proxy\\\\Proxy&T\\)\\|null but returns object\\|null\\.$#" + message: "#^Method Doctrine\\\\ORM\\\\EntityManager\\:\\:getReference\\(\\) should return T\\|null but returns object\\|null\\.$#" count: 1 path: lib/Doctrine/ORM/EntityManager.php diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 6354a33983b..f915056ed6d 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -487,7 +487,7 @@ is_object($entity) is_object($entity) - + $entity $entity $entity @@ -496,7 +496,6 @@ $entity instanceof $class->name ? $entity : null $persister->load($sortedId, null, null, [], $lockMode) $persister->loadById($sortedId) - $this->find($entityName, $sortedId) $this->metadataFactory->getMetadataFor($className)