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

Returns whether the format contains a required argument.
public hasRequiredArgument ( boolean $includeBase = true ) : boolean
$includeBase boolean Whether to include arguments in the base format in the search.
Результат boolean Returns `true` if the format contains a required argument and `false` otherwise.
Пример #1
0
 /**
  * Returns whether the builder contains a required argument.
  *
  * @param bool $includeBase Whether to include arguments in the base format
  *                          in the search.
  *
  * @return bool Returns `true` if the builder contains a required argument
  *              and `false` otherwise.
  */
 public function hasRequiredArgument($includeBase = true)
 {
     Assert::boolean($includeBase, 'The parameter $includeBase must be a boolean. Got: %s');
     if (!$this->hasOptionalArg && count($this->arguments) > 0) {
         return true;
     }
     if ($includeBase && $this->baseFormat) {
         return $this->baseFormat->hasRequiredArgument();
     }
     return false;
 }
Пример #2
0
 /**
  * @expectedException \InvalidArgumentException
  */
 public function testHasRequiredArgumentFailsIfIncludeBaseNoBoolean()
 {
     $format = new ArgsFormat();
     $format->hasRequiredArgument(1234);
 }