chore: Suppress psalm error

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
Côme Chilliet 2025-04-29 16:11:02 +02:00
parent 06c062bebd
commit 1bf41550d0
No known key found for this signature in database
GPG key ID: A3E2F658B28C760A

View file

@ -58,6 +58,7 @@ class SimpleContainer implements ArrayAccess, ContainerInterface, IContainer {
return $class->newInstance();
}
return $class->newLazyGhost(function (object $object) use ($constructor): void {
/** @psalm-suppress DirectConstructorCall For lazy ghosts we have to call the constructor directly */
$object->__construct(...array_map(function (ReflectionParameter $parameter) {
$parameterType = $parameter->getType();
@ -69,8 +70,8 @@ class SimpleContainer implements ArrayAccess, ContainerInterface, IContainer {
}
try {
$builtIn = $parameter->hasType() && ($parameter->getType() instanceof ReflectionNamedType)
&& $parameter->getType()->isBuiltin();
$builtIn = $parameterType !== null && ($parameterType instanceof ReflectionNamedType)
&& $parameterType->isBuiltin();
return $this->query($resolveName, !$builtIn);
} catch (QueryException $e) {
// Service not found, use the default value when available