Skip to content

Commit

Permalink
Console commands should be consistent when using required flag
Browse files Browse the repository at this point in the history
  • Loading branch information
bajb committed Oct 30, 2014
1 parent 6d1020a commit 41632a4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
10 changes: 0 additions & 10 deletions src/Console/ConsoleCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,16 +184,6 @@ protected function createOptionsFromPublic(
)->getDescription();
}

if($propBlock->hasTag('required') && $argsAdded !== true)
{
$this->addArgument(
$property->getName(),
InputArgument::REQUIRED,
$description
);
continue;
}

if($propBlock->hasTag('valuerequired'))
{
$mode = InputOption::VALUE_REQUIRED;
Expand Down
2 changes: 1 addition & 1 deletion tests/Cubex/Console/ConsoleCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function testClassDocBlocks()
$def = $command->getDefinition();
$this->assertEquals(
'This should become a named parameter',
$def->getArgument('demand')->getDescription()
$def->getOption('demand')->getDescription()
);
$this->assertFalse($def->getOption('on')->acceptValue());

Expand Down

0 comments on commit 41632a4

Please sign in to comment.