diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 6f0a73dd5a..3905f4fc1f 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -165,6 +165,11 @@ parameters: count: 2 path: src/Mapping/ClassMetadataFactory.php + - + message: "#^Call to an undefined method ReflectionProperty\\:\\:getHooks\\(\\)\\.$#" + count: 1 + path: src/Mapping/ClassMetadataInfo.php + - message: "#^Method Doctrine\\\\ORM\\\\Mapping\\\\NamingStrategy\\:\\:joinColumnName\\(\\) invoked with 2 parameters, 1 required\\.$#" count: 2 diff --git a/psalm-baseline.xml b/psalm-baseline.xml index b9473bebb6..0d2d23f6ae 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -713,6 +713,9 @@ + + + diff --git a/src/Mapping/ClassMetadataInfo.php b/src/Mapping/ClassMetadataInfo.php index 3780a5d44a..881fabe28d 100644 --- a/src/Mapping/ClassMetadataInfo.php +++ b/src/Mapping/ClassMetadataInfo.php @@ -3890,6 +3890,10 @@ private function getAccessibleProperty(ReflectionService $reflService, string $c } } + if (PHP_VERSION_ID >= 80400 && $reflectionProperty !== null && count($reflectionProperty->getHooks()) > 0) { + throw new LogicException('Doctrine ORM does not support property hooks in this version. Check https://github.com/doctrine/orm/issues/11624 for details of versions that support property hooks.'); + } + return $reflectionProperty; } }