Skip to content

Commit 86338f4

Browse files
Merge branch '4.4' into 5.0
* 4.4: [DI] fix CheckTypeDeclarationsPass
2 parents ab3f9d4 + ec60a7d commit 86338f4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Compiler/CheckTypeDeclarationsPass.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,11 +233,11 @@ private function checkType(Definition $checkedDefinition, $value, \ReflectionPar
233233
return;
234234
}
235235

236-
if ('string' === $type && \is_callable([$class, '__toString'])) {
236+
if ('string' === $type && method_exists($class, '__toString')) {
237237
return;
238238
}
239239

240-
if ('callable' === $type && (\Closure::class === $class || \is_callable([$class, '__invoke']))) {
240+
if ('callable' === $type && (\Closure::class === $class || method_exists($class, '__invoke'))) {
241241
return;
242242
}
243243

0 commit comments

Comments
 (0)