Skip to content

Commit fdae064

Browse files
Merge remote-tracking branch '37901/refactor/command-list-api' into commpr-21755-0511
2 parents 3219f54 + 43a9d10 commit fdae064

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

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

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2015 Adobe
4+
* All Rights Reserved.
55
*/
66

77
namespace Magento\Framework\Console;
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,7 +37,7 @@ public function __construct(array $commands = [])
2737
}
2838

2939
/**
30-
* {@inheritdoc}
40+
* @inheritdoc
3141
*/
3242
public function getCommands()
3343
{

0 commit comments

Comments
 (0)