Avoid returning null from EntityManager::getReference()
and getPartialReference()
#7921
static-analysis.yml
on: pull_request
Matrix: Static Analysis with PHPStan
Matrix: Static Analysis with Psalm
Annotations
13 errors
InvalidReturnType:
src/EntityManager.php#L367
src/EntityManager.php:367:66: InvalidReturnType: The declared return type 'T:fn-doctrine\orm\entitymanagerinterface::getreference as object' for Doctrine\ORM\EntityManager::getReference is incorrect, got 'Doctrine\ORM\Proxy\InternalProxy<object>|(T:fn-doctrine\orm\entitymanagerinterface::getreference as object)|null|object' (see https://psalm.dev/011)
|
UndefinedClass:
src/EntityManager.php#L395
src/EntityManager.php:395:23: UndefinedClass: Class, interface or enum named Doctrine\ORM\Exception\InstanceOfTheWrongTypeEncountered does not exist (see https://psalm.dev/019)
|
Static Analysis with Psalm (3.8.2)
Process completed with exit code 2.
|
Static Analysis with Psalm (default)
The job was canceled because "_3_8_2" failed.
|
InvalidReturnType:
src/EntityManager.php#L367
src/EntityManager.php:367:66: InvalidReturnType: The declared return type 'T:fn-doctrine\orm\entitymanagerinterface::getreference as object' for Doctrine\ORM\EntityManager::getReference is incorrect, got 'Doctrine\ORM\Proxy\InternalProxy<object>|(T:fn-doctrine\orm\entitymanagerinterface::getreference as object)|null|object' (see https://psalm.dev/011)
|
UndefinedClass:
src/EntityManager.php#L395
src/EntityManager.php:395:23: UndefinedClass: Class, interface or enum named Doctrine\ORM\Exception\InstanceOfTheWrongTypeEncountered does not exist (see https://psalm.dev/019)
|
Static Analysis with Psalm (default)
The operation was canceled.
|
Static Analysis with PHPStan (3.8.2, phpstan-dbal3.neon):
src/EntityManager.php#L395
Call to static method forInstance() on an unknown class Doctrine\ORM\Exception\InstanceOfTheWrongTypeEncountered.
|
Static Analysis with PHPStan (3.8.2, phpstan-dbal3.neon):
src/EntityManager.php#L398
Method Doctrine\ORM\EntityManager::getReference() should return T of object but returns object.
|
Static Analysis with PHPStan (3.8.2, phpstan-dbal3.neon):
src/EntityManager.php#L409
Method Doctrine\ORM\EntityManager::getReference() should return T of object but returns Doctrine\ORM\Proxy\InternalProxy.
|
Static Analysis with PHPStan (3.8.2, phpstan-dbal3.neon)
Process completed with exit code 1.
|
Static Analysis with PHPStan (default, phpstan.neon)
The job was canceled because "_3_8_2_phpstan-dbal3_neon" failed.
|
Static Analysis with PHPStan (default, phpstan.neon)
The operation was canceled.
|