Merge branch '4.4' into 5.0

* 4.4:
  [DI] fix CheckTypeDeclarationsPass
This commit is contained in:
Nicolas Grekas 2020-01-31 10:49:43 +01:00
commit ecf3a53069
1 changed files with 2 additions and 2 deletions

View File

@ -233,11 +233,11 @@ final class CheckTypeDeclarationsPass extends AbstractRecursivePass
return;
}
if ('string' === $type && \is_callable([$class, '__toString'])) {
if ('string' === $type && method_exists($class, '__toString')) {
return;
}
if ('callable' === $type && (\Closure::class === $class || \is_callable([$class, '__invoke']))) {
if ('callable' === $type && (\Closure::class === $class || method_exists($class, '__invoke'))) {
return;
}