Spec-Zone.ru › Laravel 7

InteractsWithIO

trait InteractsWithIO (View source)

Свойства

protected InputInterface $input

Реализация интерфейса ввода.

protected OutputStyle $output

Реализация интерфейса вывода.

protected int $verbosity

Уровень подробности вывода по умолчанию для команд.

protected array $verbosityMap

Сопоставление удобочитаемых уровней подробности с уровнями OutputInterface Symfony.

Методы

bool hasArgument(string|int $name)

Определить, присутствует ли заданный аргумент.

string|array|null argument(string|null $key = null)

Получить значение аргумента команды.

array arguments()

Получить все аргументы, переданные команде.

bool hasOption(string $name)

Определить, присутствует ли заданный параметр.

string|array|bool|null option(string|null $key = null)

Получить значение параметра команды.

array options()

Получить все параметры, переданные команде.

bool confirm(string $question, bool $default = false)

Подтвердить вопрос у пользователя.

mixed ask(string $question, string|null $default = null)

Задать вопрос пользователю и получить ответ.

mixed anticipate(string $question, array|callable $choices, string|null $default = null)

Задать вопрос пользователю с автозаполнением.

mixed askWithCompletion(string $question, array|callable $choices, string|null $default = null)

Задать вопрос пользователю с автозаполнением.

mixed secret(string $question, bool $fallback = true)

Задать вопрос пользователю, скрывая ответ в консоли.

string|array choice(string $question, array $choices, string|null $default = null, mixed|null $attempts = null, bool $multiple = false)

Предложить пользователю один вариант из набора ответов.

void table(array $headers, Arrayable|array $rows, string $tableStyle = 'default', array $columnStyles = [])

Форматировать ввод в текстовую таблицу.

void info(string $string, int|string|null $verbosity = null)

Вывести строку как информационное сообщение.

void line(string $string, string|null $style = null, int|string|null $verbosity = null)

Вывести строку в стандартный вывод.

void comment(string $string, int|string|null $verbosity = null)

Вывести строку как комментарий.

void question(string $string, int|string|null $verbosity = null)

Вывести строку как вопрос.

void error(string $string, int|string|null $verbosity = null)

Вывести строку как сообщение об ошибке.

void warn(string $string, int|string|null $verbosity = null)

Вывести строку как предупреждение.

void alert(string $string)

Вывести строку в окне оповещения.

void setInput(InputInterface $input)

Установить реализацию интерфейса ввода.

void setOutput(OutputStyle $output)

Установить реализацию интерфейса вывода.

void setVerbosity(string|int $level)

Установить уровень подробности.

int parseVerbosity(string|int|null $level = null)

Получить уровень подробности в терминах уровня OutputInterface Symfony.

OutputStyle getOutput()

Получить реализацию вывода.

Подробности

bool hasArgument(string|int $name)

Определить, присутствует ли указанный аргумент.

Параметры

string|int $name

Возвращаемое значение

bool

string|array|null argument(string|null $key = null)

Получить значение аргумента команды.

Параметры

string|null $key

Возвращаемое значение

string|array|null

array arguments()

Получить все аргументы, переданные команде.

Возвращаемое значение

array

bool hasOption(string $name)

Определить, присутствует ли данный параметр.

Параметры

string $name

Возвращаемое значение

bool

string|array|bool|null option(string|null $key = null)

Получить значение параметра команды.

Параметры

string|null $key

Возвращаемое значение

string|array|bool|null

array options()

Получить все параметры, переданные команде.

Возвращаемое значение

array

bool confirm(string $question, bool $default = false)

Подтвердить вопрос у пользователя.

Параметры

string $question
bool $default

Возвращаемое значение

bool

mixed ask(string $question, string|null $default = null)

Запросить у пользователя ввод.

Параметры

string $question
string|null $default

Возвращаемое значение

mixed

mixed anticipate(string $question, array|callable $choices, string|null $default = null)

Запросить у пользователя ввод с автозавершением.

Параметры

string $question
array|callable $choices
string|null $default

Возвращаемое значение

mixed

mixed askWithCompletion(string $question, array|callable $choices, string|null $default = null)

Запросить у пользователя ввод с автозавершением.

Параметры

string $question
array|callable $choices
string|null $default

Возвращаемое значение

mixed

mixed secret(string $question, bool $fallback = true)

Запросить у пользователя данные, но скрыть ответ в консоли.

Parameters

string $question
bool $fallback

Return Value

mixed

string|array choice(string $question, array $choices, string|null $default = null, mixed|null $attempts = null, bool $multiple = false)

Предложить пользователю единственный выбор из массива ответов.

Parameters

string $question
array $choices
string|null $default
mixed|null $attempts
bool $multiple

Return Value

string|array

void table(array $headers, Arrayable|array $rows, string $tableStyle = 'default', array $columnStyles = [])

Форматировать входные данные в текстовую таблицу.

Parameters

array $headers
Arrayable|array $rows
string $tableStyle
array $columnStyles

Return Value

void

void info(string $string, int|string|null $verbosity = null)

Вывести строку как информацию.

Parameters

string $string
int|string|null $verbosity

Return Value

void

void line(string $string, string|null $style = null, int|string|null $verbosity = null)

Вывести строку как стандартный вывод.

Parameters

string $string
string|null $style
int|string|null $verbosity

Return Value

void

void comment(string $string, int|string|null $verbosity = null)

Вывести строку как комментарий.

Parameters

string $string
int|string|null $verbosity

Return Value

void

void question(string $string, int|string|null $verbosity = null)

Вывести строку как вопрос.

Parameters

string $string
int|string|null $verbosity

Return Value

void

void error(string $string, int|string|null $verbosity = null)

Вывести строку как ошибку.

Parameters

string $string
int|string|null $verbosity

Return Value

void

void warn(string $string, int|string|null $verbosity = null)

Вывести строку как предупреждение.

Parameters

string $string
int|string|null $verbosity

Return Value

void

void alert(string $string)

Вывести строку в всплывающем окне.

Параметры

string $string

Возвращаемое значение

void

void setInput(InputInterface $input)

Установить реализацию интерфейса ввода.

Параметры

InputInterface $input

Возвращаемое значение

void

void setOutput(OutputStyle $output)

Установить реализацию интерфейса вывода.

Параметры

OutputStyle $output

Возвращаемое значение

void

protected void setVerbosity(string|int $level)

Установить уровень подробности.

Параметры

string|int $level

Возвращаемое значение

void

protected int parseVerbosity(string|int|null $level = null)

Получить уровень подробности в терминах уровня OutputInterface Symfony.

Параметры

string|int|null $level

Возвращаемое значение

int

OutputStyle getOutput()

Получить реализацию вывода.

Возвращаемое значение

OutputStyle

© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/7.x/Illuminate/Console/Concerns/InteractsWithIO.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API