From dacfbe2e372e21ea5e5daebbec81b98a0536b2a2 Mon Sep 17 00:00:00 2001 From: Lukasz Bajsarowicz Date: Wed, 26 Aug 2020 20:30:56 +0200 Subject: [PATCH 1/2] Turn CommandList into `@api` to ensure backwards compatibility --- .../Magento/Framework/Console/CommandList.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/lib/internal/Magento/Framework/Console/CommandList.php b/lib/internal/Magento/Framework/Console/CommandList.php index eddfd4e084536..f1c3c175b52b8 100644 --- a/lib/internal/Magento/Framework/Console/CommandList.php +++ b/lib/internal/Magento/Framework/Console/CommandList.php @@ -8,6 +8,7 @@ /** * Class CommandList has a list of commands, which can be extended via DI configuration. + * @api */ class CommandList implements CommandListInterface { @@ -17,7 +18,16 @@ class CommandList implements CommandListInterface protected $commands; /** - * Constructor + * CommandList constructor is being used for injecting new Commands + * + * Registration of new Commands can be done using `di.xml`: + * + * + * + * Vendor\Module\Console\Command\YourCommand + * + * + * * * @param array $commands */ @@ -27,9 +37,9 @@ public function __construct(array $commands = []) } /** - * {@inheritdoc} + * @inheritdoc */ - public function getCommands() + public function getCommands(): array { return $this->commands; } From ac753ca8e8d87fefda8e870240c09b76c7d921fc Mon Sep 17 00:00:00 2001 From: engcom-Dash Date: Tue, 6 May 2025 13:22:45 +0530 Subject: [PATCH 2/2] Fixed Static Failure & review comments --- lib/internal/Magento/Framework/Console/CommandList.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/internal/Magento/Framework/Console/CommandList.php b/lib/internal/Magento/Framework/Console/CommandList.php index f1c3c175b52b8..70236a2502b09 100644 --- a/lib/internal/Magento/Framework/Console/CommandList.php +++ b/lib/internal/Magento/Framework/Console/CommandList.php @@ -1,7 +1,7 @@ commands; }