Skip to content

Commit 88d5b80

Browse files
Merge branch '2.8' into 3.1
* 2.8: [FrameworkBundle] Check for class existence before is_subclass_of Update GroupSequence.php Code enhancement and cleanup [Form] Fix transformer tests after the ICU update [DI] Add anti-regression test Revert "minor #19689 [DI] Cleanup array_key_exists (ro0NL)" bumped Symfony version to 2.8.11 updated VERSION for 2.8.10 updated CHANGELOG for 2.8.10 [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 5767d6a + 962cda6 commit 88d5b80

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
@@ -82,7 +82,6 @@ protected function execute(InputInterface $input, OutputInterface $output)
8282
throw new \RuntimeException(sprintf('File or directory "%s" is not readable', $filename));
8383
}
8484

85-
$files = array();
8685
if (is_file($filename)) {
8786
$files = array($filename);
8887
} elseif (is_dir($filename)) {

DependencyInjection/Compiler/AddConsoleCommandPass.php

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

3636
$class = $container->getParameterBag()->resolveValue($definition->getClass());
3737
if (!is_subclass_of($class, 'Symfony\\Component\\Console\\Command\\Command')) {
38+
if (!class_exists($class, false)) {
39+
throw new \InvalidArgumentException(sprintf('Class "%s" used for service "%s" cannot be found.', $class, $id));
40+
}
41+
3842
throw new \InvalidArgumentException(sprintf('The service "%s" tagged "console.command" must be a subclass of "Symfony\\Component\\Console\\Command\\Command".', $id));
3943
}
4044
$container->setAlias($serviceId = 'console.command.'.strtolower(str_replace('\\', '_', $class)), $id);

0 commit comments

Comments
 (0)