Webmozart\Console\Api\Args\Format\ArgsFormatBuilder::hasCommandOptions PHP Method

hasCommandOptions() public method

Returns whether the builder contains any command options.
public hasCommandOptions ( boolean $includeBase = true ) : boolean
$includeBase boolean Whether to include command options in the base format in the search.
return boolean Returns `true` if the builder contains command options and `false` otherwise.
    public function hasCommandOptions($includeBase = true)
    {
        Assert::boolean($includeBase, 'The parameter $includeBase must be a boolean. Got: %s');
        if (count($this->commandOptions) > 0) {
            return true;
        }
        if ($includeBase && $this->baseFormat) {
            return $this->baseFormat->hasCommandOptions();
        }
        return false;
    }

Usage Example

 /**
  * @expectedException \InvalidArgumentException
  */
 public function testHasCommandOptionsFailsIfIncludeBaseNoBoolean()
 {
     $this->builder->hasCommandOptions(1234);
 }