Spec-Zone.ru › Laravel 9

ClosureCommand

class ClosureCommand extends Команда (Просмотреть исходный код)

Трейты

ВызываетКоманды
ИмеетПараметры
ВзаимодействуетСВводомВыводом
ВзаимодействуетССигналами
ЗапрашиваетОтсутствующиеДанные
Макроспособный

Свойства

protected Фабрика внутренний $components

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

из ВзаимодействуетСВводомВыводом
protected InputInterface $input

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

из ВзаимодействуетСВводомВыводом
protected СтильВывода $output

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

из ВзаимодействуетСВводомВыводом
protected int $verbosity

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

из ВзаимодействуетСВводомВыводом
protected array $verbosityMap

Сопоставление уровней детализации с уровнями Symfony OutputInterface.

из ВзаимодействуетСВводомВыводом
protected Сигналы|null $signals

Экземпляр регистратора сигналов.

из ВзаимодействуетССигналами
static protected array $macros

Зарегистрированные макросы строк.

из Макроспособный
protected Приложение $laravel

Экземпляр приложения Laravel.

из Команда
protected string $signature

Имя и синтаксис консольной команды.

из Команда
protected string $name

Имя консольной команды.

из Команда
protected string|null $description

Описание консольной команды.

из Команда
protected string $help

Текст справки консольной команды.

из Команда
protected bool $hidden

Указывает, следует ли отображать команду в списке команд Artisan.

из Команда
protected Closure $callback

Обработчик команды.

Методы

Команда resolveCommand(Command|string $command)

Разрешить экземпляр консольной команды для заданной команды.

из CallsCommands
int call(Command|string $command, array $arguments = [])

Вызвать другую консольную команду.

из CallsCommands
int callSilent(Command|string $command, array $arguments = [])

Вызвать другую консольную команду без вывода.

из CallsCommands
int callSilently(Command|string $command, array $arguments = [])

Вызвать другую консольную команду без вывода.

из CallsCommands
int runCommand(Command|string $command, array $arguments, OutputInterface $output)

Выполнить заданную консольную команду.

из CallsCommands
ArrayInput createInputFromArguments(array $arguments)

Создать экземпляр ввода из заданных аргументов.

из CallsCommands
массив context()

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

из CallsCommands
void specifyParameters()

Указать аргументы и параметры команды.

из HasParameters
массив getArguments()

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

из HasParameters
массив getOptions()

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

из HasParameters
bool hasArgument(string|int $name)

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

из InteractsWithIO
массив|строка|bool|null argument(string|null $key = null)

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

из InteractsWithIO
массив arguments()

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

из InteractsWithIO
bool hasOption(string $name)

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

из InteractsWithIO
строка|массив|bool|null option(string|null $key = null)

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

из InteractsWithIO
массив options()

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

из InteractsWithIO
bool confirm(string $question, bool $default = false)

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

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

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

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

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

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

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

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

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

из InteractsWithIO
строка|массив choice(string $question, array $choices, string|int|null $default = null, mixed|null $attempts = null, bool $multiple = false)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

from InteractsWithIO
void alert(string $string, int|string|null $verbosity = null)

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

from InteractsWithIO
$this newLine(int $count = 1)

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

from InteractsWithIO
void setInput(InputInterface $input)

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

from InteractsWithIO
void setOutput(OutputStyle $output)

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

from InteractsWithIO
void setVerbosity(string|int $level)

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

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

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

from InteractsWithIO
OutputStyle getOutput()

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

from InteractsWithIO
void trap(iterable<array-key,int>|int $signals, $callback)

Определить обратный вызов для выполнения при возникновении заданного сигнала(ов).

from InteractsWithSignals
void untrap()

Отменить обработчики сигналов, заданные в обработчике команды.

from InteractsWithSignals
void interact(InputInterface $input, OutputInterface $output)

Взаимодействовать с пользователем до проверки входных данных.

from PromptsForMissingInput
void promptForMissingArguments(InputInterface $input, OutputInterface $output)

Запросить у пользователя отсутствующие аргументы.

from PromptsForMissingInput
array promptForMissingArgumentsUsing()

Запрашивать отсутствующие входные аргументы, используя возвращаемые вопросы.

from PromptsForMissingInput
void afterPromptingForMissingArguments(InputInterface $input, OutputInterface $output)

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

from PromptsForMissingInput
bool didReceiveOptions(InputInterface $input)

Содержит ли входные данные какие-либо параметры, отличающиеся от значений по умолчанию.

from PromptsForMissingInput
static void macro(string $name, object|callable $macro)

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

from Macroable
static void mixin(object $mixin, bool $replace = true)

Добавить другой объект в класс.

from Macroable
static bool hasMacro(string $name)

Проверяет, зарегистрирована ли макрокоманда.

from Macroable
static void flushMacros()

Очистить существующие макрокоманды.

from Macroable
static mixed __callStatic(string $method, array $parameters)

Динамически обработать вызовы к классу.

from Macroable
mixed __call(string $method, array $parameters)

Динамически обработать вызовы к классу.

from Macroable
void __construct(string $signature, Closure $callback)

Создать новый экземпляр команды.

void configureUsingFluentDefinition()

Настроить команду консоли с помощью определения fluent.

from Command
void configureIsolation()

Настроить команду консоли для изоляции.

from Command
int run(InputInterface $input, OutputInterface $output)

Запустить команду консоли.

from Command
int execute(InputInterface $input, OutputInterface $output)

Выполнить команду консоли.

CommandMutex commandIsolationMutex()

Получить экземпляр мьютекса изоляции команд для команды.

from Command
bool isHidden()

{@inheritdoc}

from Command
Command setHidden(bool $hidden = true)

{@inheritdoc}

from Command
Приложение getLaravel()

Получить экземпляр приложения Laravel.

из Команды
void setLaravel(Контейнер $laravel)

Установить экземпляр приложения Laravel.

из Команды
$this purpose(string $description)

Установить описание для команды.

$this describe(string $description)

Установить описание для команды.

Подробности

abstract protected Command resolveCommand(Command|string $command)

Разрешить экземпляр командной строки для заданной команды.

Параметры

Command|string $command

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

Command

int call(Command|string $command, array $arguments = [])

Вызвать другую командную строку.

Параметры

Command|string $command
array $arguments

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

int

int callSilent(Command|string $command, array $arguments = [])

Вызвать другую командную строку без вывода.

Параметры

Command|string $command
array $arguments

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

int

int callSilently(Command|string $command, array $arguments = [])

Вызвать другую командную строку без вывода.

Параметры

Command|string $command
array $arguments

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

int

protected int runCommand(Command|string $command, array $arguments, OutputInterface $output)

Выполнить заданную команду командной строки.

Параметры

Command|string $command
array $arguments
OutputInterface $output

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

int

protected ArrayInput createInputFromArguments(array $arguments)

Создать экземпляр ввода из заданных аргументов.

Параметры

array $arguments

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

ArrayInput

protected array context()

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

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

array

protected void specifyParameters()

Указать аргументы и параметры команды.

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

void

protected array getArguments()

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

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

array

protected array getOptions()

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

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

array

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)

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

Параметры

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
END_OF_DOCUMENT_MARKER

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)

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

Parameters

string|int $level

Return Value

void

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

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

Parameters

string|int|null $level

Return Value

int

OutputStyle getOutput()

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

Return Value

OutputStyle

void trap(iterable<array-key,int>|int $signals, $callback)

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

Parameters

iterable<array-key,int>|int $signals
$callback

Return Value

void

void untrap()

internal

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

Return Value

void
END_OF_DOCUMENT_MARKER

protected void interact(InputInterface $input, OutputInterface $output)

Взаимодействие с пользователем перед валидацией ввода.

Parameters

InputInterface $input
OutputInterface $output

Return Value

void

protected void promptForMissingArguments(InputInterface $input, OutputInterface $output)

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

Parameters

InputInterface $input
OutputInterface $output

Return Value

void

protected array promptForMissingArgumentsUsing()

Запрос недостающих аргументов ввода, используя возвращённые вопросы.

Return Value

array

protected void afterPromptingForMissingArguments(InputInterface $input, OutputInterface $output)

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

Parameters

InputInterface $input
OutputInterface $output

Return Value

void

protected bool didReceiveOptions(InputInterface $input)

Содержит ли ввод какие-либо параметры, отличающиеся от значений по умолчанию?

Parameters

InputInterface $input

Return Value

bool

static void macro(string $name, object|callable $macro)

Регистрация пользовательского макроса.

Parameters

string $name
object|callable $macro

Return Value

void

static void mixin(object $mixin, bool $replace = true)

Смешивание другого объекта в класс.

Parameters

object $mixin
bool $replace

Return Value

void

Exceptions

ReflectionException

static bool hasMacro(string $name)

Проверка наличия зарегистрированного макроса.

Parameters

string $name

Return Value

bool

static void flushMacros()

Очистка существующих макросов.

Return Value

void

static mixed __callStatic(string $method, array $parameters)

Динамичная обработка вызовов класса.

Parameters

string $method
array $parameters

Return Value

mixed

Exceptions

BadMethodCallException

mixed __call(string $method, array $parameters)

Динамичная обработка вызовов класса.

Parameters

string $method
array $parameters

Return Value

mixed

Exceptions

BadMethodCallException

void __construct(string $signature, Closure $callback)

Создание нового экземпляра команды.

Parameters

string $signature
Closure $callback

Return Value

void

protected void configureUsingFluentDefinition()

Настройка консольной команды с помощью определения с помощью fluent.

Return Value

void

protected void configureIsolation()

Настройка консольной команды для изоляции.

Return Value

void

int run(InputInterface $input, OutputInterface $output)

Выполнение консольной команды.

Parameters

InputInterface $input
OutputInterface $output

Return Value

int

protected int execute(InputInterface $input, OutputInterface $output)

Выполнение консольной команды.

Parameters

InputInterface $input
OutputInterface $output

Return Value

int

protected CommandMutex commandIsolationMutex()

Получение экземпляра мьютекса изоляции команды для команды.

Return Value

CommandMutex

bool isHidden()

{@inheritdoc}

Return Value

bool

Command setHidden(bool $hidden = true)

{@inheritdoc}

Parameters

bool $hidden

Return Value

Command

Application getLaravel()

Получение экземпляра приложения Laravel.

Return Value

Application

void setLaravel(Container $laravel)

Установить экземпляр приложения Laravel.

Параметры

Container $laravel

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

void

$this purpose(string $description)

Установить описание для команды.

Параметры

string $description

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

$this

$this describe(string $description)

Установить описание для команды.

Параметры

string $description

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

$this

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

Spec-Zone.ru

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