8000 Use is_subclass_of instead of reflection · symfony/symfony@5af5d06 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5af5d06

Browse files
committed
Use is_subclass_of instead of reflection
1 parent 8d7b19f commit 5af5d06

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddConsoleCommandPass.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ public function process(ContainerBuilder $container)
3737
}
3838

3939
$cl 5E75 ass = $container->getParameterBag()->resolveValue($definition->getClass());
40-
$r = new \ReflectionClass($class);
41-
if (!$r->isSubclassOf('Symfony\\Component\\Console\\Command\\Command')) {
40+
if (!is_subclass_of($class, 'Symfony\\Component\\Console\\Command\\Command')) {
4241
throw new \InvalidArgumentException(sprintf('The service "%s" tagged "console.command" must be a subclass of "Symfony\\Component\\Console\\Command\\Command".', $id));
4342
}
4443
$container->setAlias('console.command.'.strtolower(str_replace('\\', '_', $class)), $id);

0 commit comments

Comments
 (0)
0