Skip to content

Commit

Permalink
feat: graphql area for observer list
Browse files Browse the repository at this point in the history
  • Loading branch information
cmuench committed Dec 19, 2024
1 parent 01a97d3 commit 1bcc4b2
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace N98\Magento\Command\Developer\Module\Observer;

use Exception;
use InvalidArgumentException;
use N98\Magento\Command\AbstractMagentoCommand;
use N98\Util\Console\Helper\Table\Renderer\RendererFactory;
use Symfony\Component\Console\Input\InputArgument;
Expand All @@ -25,6 +27,7 @@ class ListCommand extends AbstractMagentoCommand
'crontab',
'webapi_rest',
'webapi_soap',
'graphql',
'doc',

// 'admin' has been declared deprecated since 5448233
Expand Down Expand Up @@ -63,7 +66,7 @@ protected function configure()

/**
* {@inheritdoc}
* @throws \Exception
* @throws Exception
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
Expand All @@ -82,7 +85,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$question = new ChoiceQuestion('<question>Please select an area:</question>', $choices);
$question->setValidator(function ($areaIndex) {
if (!in_array($areaIndex - 1, range(0, count($this->areas) - 1), true)) {
throw new \InvalidArgumentException('Invalid selection.' . $areaIndex);
throw new InvalidArgumentException('Invalid selection.' . $areaIndex);
}

return $this->areas[$areaIndex - 1];
Expand Down

0 comments on commit 1bcc4b2

Please sign in to comment.