8000 Fixing a bug where non-existent classes would cause issues · symfony/symfony@4bb9d82 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4bb9d82

Browse files
committed
Fixing a bug where non-existent classes would cause issues
1 parent e7b555e commit 4bb9d82

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,18 @@ public function filterToServiceTypes($serviceId)
238238
return false;
239239
}
240240

241-
// see if the class exists (only need to trigger autoload once)
242-
return class_exists($serviceId) || interface_exists($serviceId, false);
241+
// if the id has a \, assume it is a class
242+
if (false !== strpos($serviceId, '\\')) {
243+
return true;
244+
}
245+
246+
try {
247+
$r = new \ReflectionClass($serviceId);
248+
249+
return true;
250+
} catch (\ReflectionException $e) {
251+
// the service id is not a valid class/interface
252+
return false;
253+
}
243254
}
244255
}

0 commit comments

Comments
 (0)
0