[DI] fix CheckTypeDeclarationsPass
This commit is contained in:
parent
f24320dd10
commit
103c460e4c
@ -233,11 +233,11 @@ final class CheckTypeDeclarationsPass extends AbstractRecursivePass
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ('string' === $type && \is_callable([$class, '__toString'])) {
|
if ('string' === $type && method_exists($class, '__toString')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ('callable' === $type && (\Closure::class === $class || \is_callable([$class, '__invoke']))) {
|
if ('callable' === $type && (\Closure::class === $class || method_exists($class, '__invoke'))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user