class Runner implements ContainerAwareInterface (View source)

Traits

IO
ContainerAwareTrait

Constants

ROBOCLASS

ROBOFILE

Properties

protected InputInterface $input from  InputAwareTrait
protected OutputInterface $output from  OutputAwareTrait
protected $io from  IO
protected $obj from  IO
protected string $roboClass
protected string $roboFile
protected string $dir

Working dir of Robo.

protected string[] $errorConditions
protected string $selfUpdateRepository

GitHub Repo for SelfUpdate.

protected string $configFilename

Filename to load configuration from (set to 'robo.yml' for RoboFiles).

protected string $envConfigPrefix
protected null|ClassLoader $classLoader
protected string $relativePluginNamespace

Methods

$this
setInput(InputInterface $input)

No description

InputInterface
input()

No description

InputInterface
getInput() deprecated

Backwards compatibility.

$this
setOutput(OutputInterface $output)

No description

OutputInterface
output()

No description

OutputInterface
stderr()

No description

OutputInterface
getOutput() deprecated

Backwards compatibility

currentState()

No description

from  IO
__construct(null|string $roboClass = null, null|string $roboFile = null)

Class Constructor

restore()

No description

from  IO
errorCondition(string $msg, string $errorType)

No description

bool
loadRoboFile(OutputInterface $output)

No description

int
execute(array $argv, null|string $appName = null, null|string $appVersion = null, null|OutputInterface $output = null)

No description

getAppForTesting(string|null $appName = null, string|null $appVersion = null, string|array|null $commandFile = null, Config|null $config = null, ClassLoader|null $classLoader = null)

Return an initialized application loaded with specified commands and configuration.

string[]
getConfigFilePaths(string $userConfig)

Get a list of locations where config files may be loaded

int
run(null|array|InputInterface $input = null, null|OutputInterface $output = null, null|Application $app = null, array[] $commandFiles = [], null|ClassLoader $classLoader = null)

No description

null|string
getRoboFileCommands(OutputInterface $output)

No description

registerCommandClasses(Application $app, array $commandClasses)

No description

string[]
discoverCommandClasses(string $relativeNamespace)

No description

null|object
registerCommandClass(Application $app, string|BuilderAwareInterface|ContainerAwareInterface $commandClass)

No description

null|object
instantiateCommandClass(string|BuilderAwareInterface|ContainerAwareInterface $commandClass)

No description

installRoboHandlers()

No description

array
shebang(array $args)

Process a shebang script, if one was used to launch this Runner.

bool
isShebangFile(string $filepath)

Determine if the specified argument is a path to a shebang script.

bool
isShebangLine(string $line)

Test to see if the provided line is a robo 'shebang' line.

array
processRoboOptions(array $argv)

Check for Robo-specific arguments such as --load-from, process them, and remove them from the array. We have to process --load-from before we set up Symfony Console.

bool|int
arraySearchBeginsWith(string $needle, string[] $haystack)

No description

shutdown()

No description

bool
handleError()

This is just a proxy error handler that checks the current error_reporting level.

string
getSelfUpdateRepository()

No description

$this
setSelfUpdateRepository($selfUpdateRepository)

No description

$this
setConfigurationFilename(string $configFilename)

No description

$this
setEnvConfigPrefix(string $envConfigPrefix)

No description

$this
setClassLoader(ClassLoader $classLoader)

No description

$this
setRelativePluginNamespace(string $relativeNamespace)

No description

Details

$this setInput(InputInterface $input)

No description

Parameters

InputInterface $input

Return Value

$this

See also

\Symfony\Component\Console\Input\InputAwareInterface::setInput()

protected InputInterface input()

No description

Return Value

InputInterface

protected InputInterface getInput() deprecated

deprecated

Backwards compatibility.

Return Value

InputInterface

$this setOutput(OutputInterface $output)

No description

Parameters

OutputInterface $output

Return Value

$this

See also

\Robo\Contract\OutputAwareInterface::setOutput()

protected OutputInterface output()

No description

Return Value

OutputInterface

protected OutputInterface stderr()

No description

Return Value

OutputInterface

protected OutputInterface getOutput() deprecated

deprecated

Backwards compatibility

Return Value

OutputInterface

currentState()

No description

__construct(null|string $roboClass = null, null|string $roboFile = null)

Class Constructor

Parameters

null|string $roboClass
null|string $roboFile

restore()

No description

protected errorCondition(string $msg, string $errorType)

No description

Parameters

string $msg
string $errorType

protected bool loadRoboFile(OutputInterface $output)

No description

Parameters

OutputInterface $output

Return Value

bool

int execute(array $argv, null|string $appName = null, null|string $appVersion = null, null|OutputInterface $output = null)

No description

Parameters

array $argv
null|string $appName
null|string $appVersion
null|OutputInterface $output

Return Value

int

Application getAppForTesting(string|null $appName = null, string|null $appVersion = null, string|array|null $commandFile = null, Config|null $config = null, ClassLoader|null $classLoader = null)

Return an initialized application loaded with specified commands and configuration.

This should ONLY be used for testing purposes. Works well in conjunction with Symfony's CommandTester.

Parameters

string|null $appName

Name of the application.

string|null $appVersion

Version of the application.

string|array|null $commandFile

Name of the specific command file, or array of commands, that should be included with the application.

Config|null $config

Robo configuration to be used with the application.

ClassLoader|null $classLoader

Class loader to use.

Return Value

Application

Initialized application based on passed configuration and command classes.

See also

https://symfony.com/doc/current/console.html#testing-commands
CommandTestertTest
CommandTesterTrait

protected string[] getConfigFilePaths(string $userConfig)

Get a list of locations where config files may be loaded

Parameters

string $userConfig

Return Value

string[]

int run(null|array|InputInterface $input = null, null|OutputInterface $output = null, null|Application $app = null, array[] $commandFiles = [], null|ClassLoader $classLoader = null)

No description

Parameters

null|array|InputInterface $input
null|OutputInterface $output
null|Application $app
array[] $commandFiles
null|ClassLoader $classLoader

Return Value

int

protected null|string getRoboFileCommands(OutputInterface $output)

No description

Parameters

OutputInterface $output

Return Value

null|string

registerCommandClasses(Application $app, array $commandClasses)

No description

Parameters

Application $app
array $commandClasses

protected string[] discoverCommandClasses(string $relativeNamespace)

No description

Parameters

string $relativeNamespace

Return Value

string[]

null|object registerCommandClass(Application $app, string|BuilderAwareInterface|ContainerAwareInterface $commandClass)

No description

Parameters

Application $app
string|BuilderAwareInterface|ContainerAwareInterface $commandClass

Return Value

null|object

protected null|object instantiateCommandClass(string|BuilderAwareInterface|ContainerAwareInterface $commandClass)

No description

Parameters

string|BuilderAwareInterface|ContainerAwareInterface $commandClass

Return Value

null|object

installRoboHandlers()

No description

protected array shebang(array $args)

Process a shebang script, if one was used to launch this Runner.

Parameters

array $args

Return Value

array

$args With shebang script removed.

protected bool isShebangFile(string $filepath)

Determine if the specified argument is a path to a shebang script.

If so, load it.

Parameters

string $filepath

File to check.

Return Value

bool

Returns TRUE if shebang script was processed.

protected bool isShebangLine(string $line)

Test to see if the provided line is a robo 'shebang' line.

Parameters

string $line

Return Value

bool

protected array processRoboOptions(array $argv)

Check for Robo-specific arguments such as --load-from, process them, and remove them from the array. We have to process --load-from before we set up Symfony Console.

Parameters

array $argv

Return Value

array

protected bool|int arraySearchBeginsWith(string $needle, string[] $haystack)

No description

Parameters

string $needle
string[] $haystack

Return Value

bool|int

shutdown()

No description

bool handleError()

This is just a proxy error handler that checks the current error_reporting level.

In case error_reporting is disabled the error is marked as handled, otherwise the normal internal error handling resumes.

Return Value

bool

string getSelfUpdateRepository()

No description

Return Value

string

$this setSelfUpdateRepository($selfUpdateRepository)

No description

Parameters

$selfUpdateRepository

Return Value

$this

$this setConfigurationFilename(string $configFilename)

No description

Parameters

string $configFilename

Return Value

$this

$this setEnvConfigPrefix(string $envConfigPrefix)

No description

Parameters

string $envConfigPrefix

Return Value

$this

$this setClassLoader(ClassLoader $classLoader)

No description

Parameters

ClassLoader $classLoader

Return Value

$this

$this setRelativePluginNamespace(string $relativeNamespace)

No description

Parameters

string $relativeNamespace

Return Value

$this