hasCommandOptions() публичный Метод

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.
Пример #1
0
 /**
  * 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;
 }
Пример #2
0
 /**
  * @expectedException \InvalidArgumentException
  */
 public function testHasCommandOptionsFailsIfIncludeBaseNoBoolean()
 {
     $format = new ArgsFormat();
     $format->hasCommandOptions(1234);
 }