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

By default, this method also includes the default values set for options with values. You can disable this behavior by passing false for $includeDefaults.
См. также: getOption()
public getOptions ( boolean $includeDefaults = true ) : array
$includeDefaults boolean Whether to return the default values for options that were not set.
Результат array The option values and `true`/`false` for options without values.
Пример #1
0
 /**
  * {@inheritdoc}
  */
 public function getOptions()
 {
     return $this->args ? $this->args->getOptions() : array();
 }
Пример #2
0
 public function testSetOptions()
 {
     $format = ArgsFormat::build()->addOption(new Option('option1', null, Option::NO_VALUE))->addOption(new Option('option2', null, Option::OPTIONAL_VALUE))->addOption(new Option('option3', null, Option::NO_VALUE))->getFormat();
     $args = new Args($format);
     $args->setOption('option1');
     $args->setOptions(array('option2' => 'value', 'option3' => true));
     $this->assertSame(array('option2' => 'value', 'option3' => true, 'option1' => false), $args->getOptions());
 }