Returns whether the format contains command options.
public hasCommandOptions ( boolean $includeBase = true ) : boolean | ||
$includeBase | boolean | Whether to include options in the base format in the search. |
리턴 | boolean | Returns `true` if the format contains command options and `false` otherwise. |
/** * Returns whether the builder contains any command options. * * @param bool $includeBase Whether to include command options in the base * format in the search. * * @return bool 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; }
/** * @expectedException \InvalidArgumentException */ public function testHasCommandOptionsFailsIfIncludeBaseNoBoolean() { $format = new ArgsFormat(); $format->hasCommandOptions(1234); }