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

hasArguments() public method

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

Usage Example

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