Runner

Runs the generator

class Runner
Copyright
2016 Appertly
License
Apache-2.0

Constructors / Destructors

Public
ReturnsSignature and Description
void

Creates a new Runner.

Instance Methods

Public
ReturnsSignature and Description
void
run(Traversable<string> $args)

Runs the program.

Protected
ReturnsSignature and Description
Command
getCommand(Traversable<string> $args)

Gets the command.

Set<string>
getExcludes(ImmMap<string,mixed> $options)

Gets the list of excluded paths

LoggerInterface
getLogger(ImmMap<string,mixed> $options)

Creates a new Logger based on passed options.

void

Prints the help information

noreturn
unknownOption(UnexpectedValueException $e)

Handles an unknown option exception.

void

Prints the version information

Method Details

__construct

public function __construct()

Creates a new Runner.

getCommand

protected function getCommand(Traversable<string> $args)

Gets the command.

Parameters
NameTypeDescription
$argsTraversable<string>

The command line arguments

Returns
TypeDescription
Command

The parsed command to execute

getExcludes

protected function getExcludes(ImmMap<string,mixed> $options)

Gets the list of excluded paths

Parameters
NameTypeDescription
$optionsImmMap<string,mixed>

The options

Returns
TypeDescription
Set<string>

The excluded paths

getLogger

protected function getLogger(ImmMap<string,mixed> $options)

Creates a new Logger based on passed options.

Parameters
NameTypeDescription
$optionsImmMap<string,mixed>

The options

Returns
TypeDescription
LoggerInterface

The created logger

help

protected function help()

Prints the help information

run

public function run(Traversable<string> $args)

Runs the program.

Parameters
NameTypeDescription
$argsTraversable<string>

The command line arguments

unknownOption

protected function unknownOption(UnexpectedValueException $e)

Handles an unknown option exception.

Parameters
NameTypeDescription
$eUnexpectedValueException

The exception

Returns
TypeDescription
noreturn

version

protected function version()

Prints the version information