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

Compile the original spec
public compile ( array | Traversable $spec ) : pharext\Cli\Args
$spec array | Traversable
Результат pharext\Cli\Args self
Пример #1
0
 public function testValidate()
 {
     $this->args->compile([["r", "required-option", "This option is required", CliArgs::REQUIRED | CliArgs::NOARG]]);
     foreach ($this->args->parse(0, []) as $error) {
         throw new \Exception("Unexpected parse error: {$error}");
     }
     foreach ($this->args->validate() as $error) {
         $this->assertStringMatchesFormat("%srequired-option%srequired", $error);
     }
     $this->assertTrue(isset($error));
 }