Spec-Zone.ru › Laravel 10

InteractsWithIO

trait InteractsWithIO (View source)

Свойства

protected Factory internal $components

Фабрика компонентов консоли.

protected InputInterface $input

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

protected OutputStyle $output

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

protected int $verbosity

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

protected array $verbosityMap

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

Методы

bool hasArgument(string|int $name)

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

array|string|bool|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|int|null $default = null, mixed|null $attempts = null, bool $multiple = false)

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

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

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

mixed|void withProgressBar(iterable|int $totalSteps, Closure $callback)

Выполнить заданный обратный вызов, продвигая полосу прогресса.

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, int|string|null $verbosity = null)

Вывести строку в поле уведомления.

$this newLine(int $count = 1)

Напечатать пустую строку.

void setInput(InputInterface $input)

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

void setOutput(OutputStyle $output)

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

void setVerbosity(string|int $level)

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

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

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

OutputStyle getOutput()

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

Factory outputComponents()

Получить реализацию фабрики компонентов вывода.

Подробное описание

bool hasArgument(string|int $name)

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

Параметры

string|int $name

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

bool

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

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

Параметры

string|null $key

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

array|string|bool|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)

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

Parameters

string $question
bool $default

Return Value

bool

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

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

Parameters

string $question
string|null $default

Return Value

mixed

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

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

Parameters

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

Return Value

mixed

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

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

Parameters

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

Return Value

mixed

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

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

Parameters

string $question
bool $fallback

Return Value

mixed

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

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

Parameters

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

Return Value

string|array

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

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

Parameters

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

Return Value

void

mixed|void withProgressBar(iterable|int $totalSteps, Closure $callback)

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

Parameters

iterable|int $totalSteps
Closure $callback

Return Value

mixed|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, int|string|null $verbosity = null)

Вывести строку в диалоговом окне.

Parameters

string $string
int|string|null $verbosity

Return Value

void

$this newLine(int $count = 1)

Написать пустую строку.

Parameters

int $count

Return Value

$this

void setInput(InputInterface $input)

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

Parameters

InputInterface $input

Return Value

void

void setOutput(OutputStyle $output)

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

Parameters

OutputStyle $output

Return Value

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

Factory outputComponents()

Получить реализацию фабрики компонентов вывода.

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

Factory

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

Spec-Zone.ru

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