class FakeOutputStyle extends OutputStyle (View source)

internal  
 

Properties

protected int $newLinesWritten

The number of trailing new lines written by the last output.

from  OutputStyle
protected bool deprecated $newLineWritten

If the last output written wrote a new line.

from  OutputStyle
protected array<int, array{0: string, 1: mixed}> $questions

The expected questions that have not been asked yet, as [question, answer] pairs.

protected Question> $asked

The questions that were asked, keyed by their expected question text.

protected string|null $failure

The failure from a question that should not have been asked.

Methods

__construct(InputInterface $input, OutputInterface $output, array $questions = [], array $choices = [])

Create a new fake output style instance.

mixed
askQuestion(Question $question)

Answer the next expected question.

void
write(string|iterable $messages, bool $newline = false, int $options = 0)

{@inheritdoc}

void
writeln(string|iterable $messages, int $type = self::OUTPUT_NORMAL)

{@inheritdoc}

void
newLine(int $count = 1)

{@inheritdoc}

int
newLinesWritten()

How many trailing newlines were written.

bool
newLineWritten() deprecated

Whether a newline has already been written.

int
trailingNewLineCount(string|iterable<string> $messages)

Count the number of trailing new lines in a string.

bool
isQuiet()

Returns whether verbosity is quiet (-q).

bool
isVerbose()

Returns whether verbosity is verbose (-v).

bool
isVeryVerbose()

Returns whether verbosity is very verbose (-vv).

bool
isDebug()

Returns whether verbosity is debug (-vvv).

OutputInterface
getOutput()

Get the underlying Symfony output implementation.

string|null
failure()

Get the message for the first unmet question expectation.

array<string, array{expected: array, strict: bool, actual: array|null}>
choices()

Get the expected choices with the choices that were actually offered.

Details

__construct(InputInterface $input, OutputInterface $output, array $questions = [], array $choices = [])

Create a new fake output style instance.

Parameters

InputInterface $input
OutputInterface $output
array $questions
array $choices

mixed askQuestion(Question $question)

Answer the next expected question.

Parameters

Question $question

Return Value

mixed

void write(string|iterable $messages, bool $newline = false, int $options = 0)

{@inheritdoc}

Parameters

string|iterable $messages
bool $newline
int $options

Return Value

void

void writeln(string|iterable $messages, int $type = self::OUTPUT_NORMAL)

{@inheritdoc}

Parameters

string|iterable $messages
int $type

Return Value

void

void newLine(int $count = 1)

{@inheritdoc}

Parameters

int $count

Return Value

void

int newLinesWritten()

How many trailing newlines were written.

Return Value

int

bool newLineWritten() deprecated

deprecated use newLinesWritten

Whether a newline has already been written.

Return Value

bool

protected int trailingNewLineCount(string|iterable<string> $messages)

Count the number of trailing new lines in a string.

Parameters

string|iterable<string> $messages

Return Value

int

bool isQuiet()

Returns whether verbosity is quiet (-q).

Return Value

bool

bool isVerbose()

Returns whether verbosity is verbose (-v).

Return Value

bool

bool isVeryVerbose()

Returns whether verbosity is very verbose (-vv).

Return Value

bool

bool isDebug()

Returns whether verbosity is debug (-vvv).

Return Value

bool

OutputInterface getOutput()

Get the underlying Symfony output implementation.

Return Value

OutputInterface

string|null failure()

Get the message for the first unmet question expectation.

Return Value

string|null

array<string, array{expected: array, strict: bool, actual: array|null}> choices()

Get the expected choices with the choices that were actually offered.

Return Value

array<string, array{expected: array, strict: bool, actual: array|null}>