getArgumentDefinitions() public method

If the command does not expect any arguments, an empty array is returned
public getArgumentDefinitions ( ) : array
return array
 /**
  * @test
  */
 public function getArgumentDefinitionsReturnsArrayOfArgumentDefinitionIfCommandExpectsArguments()
 {
     $parameterReflection = $this->createMock(ParameterReflection::class, [], [[__CLASS__, 'dummyMethod'], 'arg']);
     $mockReflectionService = $this->createMock(ReflectionService::class);
     $mockMethodParameters = ['argument1' => ['optional' => false], 'argument2' => ['optional' => true]];
     $mockReflectionService->expects($this->atLeastOnce())->method('getMethodParameters')->will($this->returnValue($mockMethodParameters));
     $this->command->injectReflectionService($mockReflectionService);
     $this->methodReflection->expects($this->atLeastOnce())->method('getParameters')->will($this->returnValue([$parameterReflection]));
     $this->methodReflection->expects($this->atLeastOnce())->method('getTagsValues')->will($this->returnValue(['param' => ['@param $argument1 argument1 description', '@param $argument2 argument2 description']]));
     $expectedResult = [new Cli\CommandArgumentDefinition('argument1', true, 'argument1 description'), new Cli\CommandArgumentDefinition('argument2', false, 'argument2 description')];
     $actualResult = $this->command->getArgumentDefinitions();
     $this->assertEquals($expectedResult, $actualResult);
 }
 /**
  * Render help text for a single command
  *
  * @param Command $command
  * @return void
  */
 protected function displayHelpForCommand(Command $command)
 {
     $this->outputLine();
     $this->outputLine('<u>' . $command->getShortDescription() . '</u>');
     $this->outputLine();
     $this->outputLine('<b>COMMAND:</b>');
     $name = '<i>' . $command->getCommandIdentifier() . '</i>';
     $this->outputLine('%-2s%s', [' ', $name]);
     $commandArgumentDefinitions = $command->getArgumentDefinitions();
     $usage = '';
     $hasOptions = false;
     /** @var CommandArgumentDefinition $commandArgumentDefinition */
     foreach ($commandArgumentDefinitions as $commandArgumentDefinition) {
         if (!$commandArgumentDefinition->isRequired()) {
             $hasOptions = true;
         } else {
             $usage .= sprintf(' <%s>', strtolower(preg_replace('/([A-Z])/', ' $1', $commandArgumentDefinition->getName())));
         }
     }
     $usage = $this->commandManager->getShortestIdentifierForCommand($command) . ($hasOptions ? ' [<options>]' : '') . $usage;
     $this->outputLine();
     $this->outputLine('<b>USAGE:</b>');
     $this->outputLine('  %s %s', [$this->getFlowInvocationString(), $usage]);
     $argumentDescriptions = [];
     $optionDescriptions = [];
     if ($command->hasArguments()) {
         foreach ($commandArgumentDefinitions as $commandArgumentDefinition) {
             $argumentDescription = $commandArgumentDefinition->getDescription();
             $argumentDescription = wordwrap($argumentDescription, $this->output->getMaximumLineLength() - 23, PHP_EOL . str_repeat(' ', 23), true);
             if ($commandArgumentDefinition->isRequired()) {
                 $argumentDescriptions[] = vsprintf('  %-20s %s', [$commandArgumentDefinition->getDashedName(), $argumentDescription]);
             } else {
                 $optionDescriptions[] = vsprintf('  %-20s %s', [$commandArgumentDefinition->getDashedName(), $argumentDescription]);
             }
         }
     }
     if (count($argumentDescriptions) > 0) {
         $this->outputLine();
         $this->outputLine('<b>ARGUMENTS:</b>');
         foreach ($argumentDescriptions as $argumentDescription) {
             $this->outputLine($argumentDescription);
         }
     }
     if (count($optionDescriptions) > 0) {
         $this->outputLine();
         $this->outputLine('<b>OPTIONS:</b>');
         foreach ($optionDescriptions as $optionDescription) {
             $this->outputLine($optionDescription);
         }
     }
     if ($command->getDescription() !== '') {
         $this->outputLine();
         $this->outputLine('<b>DESCRIPTION:</b>');
         $descriptionLines = explode(chr(10), $command->getDescription());
         foreach ($descriptionLines as $descriptionLine) {
             $this->outputLine('%-2s%s', [' ', $descriptionLine]);
         }
     }
     $relatedCommandIdentifiers = $command->getRelatedCommandIdentifiers();
     if ($relatedCommandIdentifiers !== []) {
         $this->outputLine();
         $this->outputLine('<b>SEE ALSO:</b>');
         foreach ($relatedCommandIdentifiers as $commandIdentifier) {
             try {
                 $command = $this->commandManager->getCommandByIdentifier($commandIdentifier);
                 $this->outputLine('%-2s%s (%s)', [' ', $commandIdentifier, $command->getShortDescription()]);
             } catch (CommandException $exception) {
                 $this->outputLine('%-2s%s (%s)', [' ', $commandIdentifier, '<i>Command not available</i>']);
             }
         }
     }
     $this->outputLine();
 }