Skip to content

Commit 4aec108

Browse files
committed
Turn CommandList into @api to ensure backwards compatibility
1 parent 4930963 commit 4aec108

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

lib/internal/Magento/Framework/Console/CommandList.php

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
/**
1010
* Class CommandList has a list of commands, which can be extended via DI configuration.
11+
* @api
1112
*/
1213
class 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
}

0 commit comments

Comments
 (0)