File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
lib/internal/Magento/Framework/Console Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change 8
8
9
9
/**
10
10
* Class CommandList has a list of commands, which can be extended via DI configuration.
11
+ * @api
11
12
*/
12
13
class CommandList implements CommandListInterface
13
14
{
@@ -17,7 +18,16 @@ class CommandList implements CommandListInterface
17
18
protected $ commands ;
18
19
19
20
/**
20
- * Constructor
21
+ * CommandList constructor is being used for injecting new Commands
22
+ *
23
+ * Registration of new Commands can be done using `di.xml`:
24
+ * <type name="Magento\Framework\Console\CommandList">
25
+ * <arguments>
26
+ * <argument name="commands" xsi:type="array">
27
+ * <item name="your-command-name" xsi:type="object">Vendor\Module\Console\Command\YourCommand</item>
28
+ * </argument>
29
+ * </arguments>
30
+ * </type>
21
31
*
22
32
* @param array $commands
23
33
*/
@@ -27,9 +37,9 @@ public function __construct(array $commands = [])
27
37
}
28
38
29
39
/**
30
- * { @inheritdoc}
40
+ * @inheritdoc
31
41
*/
32
- public function getCommands ()
42
+ public function getCommands (): array
33
43
{
34
44
return $ this ->commands ;
35
45
}
You can’t perform that action at this time.
0 commit comments