Webmozart\Console\Api\Args\Format\ArgsFormat::build PHP Метод

build() публичный статический Метод

You can optionally pass a base format. The built format inherits all the arguments and options defined in the base format.
public static build ( ArgsFormat $baseFormat = null ) : ArgsFormatBuilder
$baseFormat ArgsFormat The base format.
Результат ArgsFormatBuilder The created builder.
    public static function build(ArgsFormat $baseFormat = null)
    {
        return new ArgsFormatBuilder($baseFormat);
    }

Usage Example

Пример #1
0
 public function testBuild()
 {
     $format = ArgsFormat::build()->addCommandName($server = new CommandName('server'))->addCommandOption($add = new CommandOption('add', 'a'))->addArgument($host = new Argument('host'))->addOption($port = new Option('port', 'p'))->getFormat();
     $this->assertSame(array($server), $format->getCommandNames());
     $this->assertSame(array($add), $format->getCommandOptions());
     $this->assertSame(array('host' => $host), $format->getArguments());
     $this->assertSame(array('port' => $port), $format->getOptions());
     $this->assertSame(1, $format->getNumberOfArguments());
     $this->assertSame(0, $format->getNumberOfRequiredArguments());
 }
All Usage Examples Of Webmozart\Console\Api\Args\Format\ArgsFormat::build