diff --git a/Build/phpstan/phpstan-baseline.neon b/Build/phpstan/phpstan-baseline.neon index cc5b93e3882e..e687132c7f95 100644 --- a/Build/phpstan/phpstan-baseline.neon +++ b/Build/phpstan/phpstan-baseline.neon @@ -1380,11 +1380,6 @@ parameters: count: 5 path: ../../typo3/sysext/core/Classes/Database/SoftReferenceIndex.php - - - message: "#^Call to an undefined method ReflectionType\\:\\:getName\\(\\)\\.$#" - count: 1 - path: ../../typo3/sysext/core/Classes/DependencyInjection/ListenerProviderPass.php - - message: "#^Call to an undefined method ReflectionClass\\:\\:getAttributes\\(\\)\\.$#" count: 1 diff --git a/typo3/sysext/core/Classes/DependencyInjection/ListenerProviderPass.php b/typo3/sysext/core/Classes/DependencyInjection/ListenerProviderPass.php index 5228ab075a0f..ca5f63656458 100644 --- a/typo3/sysext/core/Classes/DependencyInjection/ListenerProviderPass.php +++ b/typo3/sysext/core/Classes/DependencyInjection/ListenerProviderPass.php @@ -117,7 +117,7 @@ protected function getParameterType(string $serviceName, Definition $definition, } $params = $this->getReflectionMethod($serviceName, $definition, $method)->getParameters(); $rType = count($params) ? $params[0]->getType() : null; - if ($rType === null) { + if (!$rType instanceof \ReflectionNamedType) { throw new \InvalidArgumentException( sprintf('Service "%s" registers method "%s" as an event listener, but does not specify an event type and the method does not type a parameter. Declare a class type for the method parameter or specify an event class explicitly', $serviceName, $method), 1623881315,