Skip to content

Commit 962cda6

Browse files
Merge branch '2.7' into 2.8
* 2.7: [FrameworkBundle] Check for class existence before is_subclass_of Update GroupSequence.php Code enhancement and cleanup [DI] Add anti-regression test Revert "minor #19689 [DI] Cleanup array_key_exists (ro0NL)" [BrowserKit] Fix cookie expiration on 32 bit systems bumped Symfony version to 2.7.18 updated VERSION for 2.7.17 update CONTRIBUTORS for 2.7.17 updated CHANGELOG for 2.7.17 Update misleading comment about RFC4627
2 parents 5507388 + 0207549 commit 962cda6

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Command/YamlLintCommand.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ protected function execute(InputInterface $input, OutputInterface $output)
8787
throw new \RuntimeException(sprintf('File or directory "%s" is not readable', $filename));
8888
}
8989

90-
$files = array();
9190
if (is_file($filename)) {
9291
$files = array($filename);
9392
} elseif (is_dir($filename)) {

DependencyInjection/Compiler/AddConsoleCommandPass.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ public function process(ContainerBuilder $container)
3838

3939
$class = $container->getParameterBag()->resolveValue($definition->getClass());
4040
if (!is_subclass_of($class, 'Symfony\\Component\\Console\\Command\\Command')) {
41+
if (!class_exists($class, false)) {
42+
throw new \InvalidArgumentException(sprintf('Class "%s" used for service "%s" cannot be found.', $class, $id));
43+
}
44+
4145
throw new \InvalidArgumentException(sprintf('The service "%s" tagged "console.command" must be a subclass of "Symfony\\Component\\Console\\Command\\Command".', $id));
4246
}
4347
$container->setAlias('console.command.'.strtolower(str_replace('\\', '_', $class)), $id);

0 commit comments

Comments
 (0)