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 88
99/**
1010 * Class CommandList has a list of commands, which can be extended via DI configuration.
11+ * @api
1112 */
1213class CommandList implements CommandListInterface
1314{
@@ -17,7 +18,16 @@ class CommandList implements CommandListInterface
1718 protected $ commands ;
1819
1920 /**
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>
2131 *
2232 * @param array $commands
2333 */
@@ -27,9 +37,9 @@ public function __construct(array $commands = [])
2737 }
2838
2939 /**
30- * { @inheritdoc}
40+ * @inheritdoc
3141 */
32- public function getCommands ()
42+ public function getCommands (): array
3343 {
3444 return $ this ->commands ;
3545 }
You can’t perform that action at this time.
0 commit comments