From 103c460e4c081724612fa758ca5216e0dd89fbb6 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Fri, 31 Jan 2020 10:49:27 +0100 Subject: [PATCH] [DI] fix CheckTypeDeclarationsPass --- .../Compiler/CheckTypeDeclarationsPass.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/DependencyInjection/Compiler/CheckTypeDeclarationsPass.php b/src/Symfony/Component/DependencyInjection/Compiler/CheckTypeDeclarationsPass.php index 4e145f294f..b132174932 100644 --- a/src/Symfony/Component/DependencyInjection/Compiler/CheckTypeDeclarationsPass.php +++ b/src/Symfony/Component/DependencyInjection/Compiler/CheckTypeDeclarationsPass.php @@ -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; }