trait ConsoleAwareTrait (View source)

A trait that provides awareness of the console to objects

Properties

protected Application|null $traitConsole
protected OutputInterface|null $traitOutput
protected InputInterface|null $traitInput

Methods

setConsole(Application $console, OutputInterface $output = null, InputInterface $input = null)

Set the console object

setOutput(OutputInterface $output)

Set the output object to use

setInput(InputInterface $input)

Set the input object to use

OutputInterface
getOutput()

Get an output object

InputInterface
getInput()

Get an input object

bool
hasConsole()

Find out if we are in console context

Details

ConsoleAwareTrait setConsole(Application $console, OutputInterface $output = null, InputInterface $input = null)

Set the console object

Parameters

Application $console
OutputInterface $output
InputInterface $input

Return Value

ConsoleAwareTrait

ConsoleAwareTrait setOutput(OutputInterface $output)

Set the output object to use

Parameters

OutputInterface $output

Return Value

ConsoleAwareTrait

ConsoleAwareTrait setInput(InputInterface $input)

Set the input object to use

Parameters

InputInterface $input

Return Value

ConsoleAwareTrait

protected OutputInterface getOutput()

Get an output object

Return Value

OutputInterface

protected InputInterface getInput()

Get an input object

Return Value

InputInterface

protected bool hasConsole()

Find out if we are in console context

Return Value

bool