File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
src/Symfony/Component/HttpKernel
Tests/Fixtures/ExtensionPresentBundle/Command Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -189,7 +189,7 @@ public function registerCommands(Application $application)
189
189
$ ns .= '\\' .strtr ($ relativePath , '/ ' , '\\' );
190
190
}
191
191
$ r = new \ReflectionClass ($ ns .'\\' .$ file ->getBasename ('.php ' ));
192
- if ($ r ->isSubclassOf ('Symfony \\Component \\Console \\Command \\Command ' ) && !$ r ->isAbstract ()) {
192
+ if ($ r ->isSubclassOf ('Symfony \\Component \\Console \\Command \\Command ' ) && !$ r ->isAbstract () && ! $ r -> getConstructor ()-> getNumberOfRequiredParameters () ) {
193
193
$ application ->add ($ r ->newInstance ());
194
194
}
195
195
}
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Symfony \Component \HttpKernel \Tests \Fixtures \ExtensionPresentBundle \Command ;
4
+
5
+ use Symfony \Component \Console \Command \Command ;
6
+
7
+ /**
8
+ * This command has a required parameter on the constructor and will be ignored by the default Bundle implementation.
9
+ *
10
+ * @see Symfony\Component\HttpKernel\Bundle\Bundle::registerCommands
11
+ */
12
+ class BarCommand extends Command
13
+ {
14
+ public function __construct ($ example , $ name = 'bar ' )
15
+ {
16
+
17
+ }
18
+ }
You can’t perform that action at this time.
0 commit comments