Commando\Option::setNeeds PHP Method

setNeeds() public method

Set an option as required
public setNeeds ( string $option ) : Option
$option string Option name
return Option
    public function setNeeds($option)
    {
        if (!is_array($option)) {
            $option = array($option);
        }
        foreach ($option as $opt) {
            $this->needs[] = $opt;
        }
        return $this;
    }

Usage Example

Exemplo n.º 1
0
 /**
  * Test that the needed requirements are met
  */
 public function testOptionRequirementsMet()
 {
     $option = new Option('f');
     $option->setNeeds('foo');
     $optionSet = array('foo' => new Option('foo'));
     $this->assertTrue($option->hasNeeds($optionSet));
 }
All Usage Examples Of Commando\Option::setNeeds