Webmozart\Console\Api\Args\Format\ArgsFormat::hasOptions PHP Méthode

hasOptions() public méthode

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

Usage Example

 /**
  * Returns whether the builder contains any option.
  *
  * @param bool $includeBase Whether to include options in the base format
  *                          in the search.
  *
  * @return bool Returns `true` if the builder contains any option and
  *              `false` otherwise.
  */
 public function hasOptions($includeBase = true)
 {
     Assert::boolean($includeBase, 'The parameter $includeBase must be a boolean. Got: %s');
     if (count($this->options) > 0) {
         return true;
     }
     if ($includeBase && $this->baseFormat) {
         return $this->baseFormat->hasOptions();
     }
     return false;
 }
All Usage Examples Of Webmozart\Console\Api\Args\Format\ArgsFormat::hasOptions