Skip to content

Commit 4250842

Browse files
Merge branch '3.1'
* 3.1: [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 3.1.5 updated VERSION for 3.1.4 updated CHANGELOG for 3.1.4 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 dd96652 + 88d5b80 commit 4250842

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Command/YamlLintCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ protected function configure()
2929
parent::configure();
3030

3131
$this->setHelp(
32-
$this->getHelp().<<<EOF
32+
$this->getHelp().<<<EOF
3333
3434
Or find all files in a bundle:
3535

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)