Spec-Zone.ru › Laravel 11

ClearCommand

class ClearCommand extends Command (View source)

Свойства

ConfirmableTrait
CallsCommands
ConfiguresPrompts
HasParameters
InteractsWithIO
InteractsWithSignals
PromptsForMissingInput
Macroable

Свойства

protected Factory internal $components

The console components factory.

from InteractsWithIO
protected InputInterface $input

The input interface implementation.

from InteractsWithIO
protected OutputStyle $output

The output interface implementation.

from InteractsWithIO
protected int $verbosity

The default verbosity of output commands.

from InteractsWithIO
protected array $verbosityMap

The mapping between human readable verbosity levels and Symfony's OutputInterface.

from InteractsWithIO
protected Signals|null $signals

The signal registrar instance.

from InteractsWithSignals
static protected array $macros

The registered string macros.

from Macroable
protected Application $laravel

The Laravel application instance.

from Command
protected string $signature

The name and signature of the console command.

from Command
protected string $name

The console command name.

protected string $description

The console command description.

protected string $help

The console command help text.

from Command
protected bool $hidden

Indicates whether the command should be shown in the Artisan command list.

from Command
protected bool $isolated

Indicates whether only one instance of the command can run at any given time.

from Command
protected int $isolatedExitCode

The default exit code for isolated commands.

from Command
protected array $aliases

The console command name aliases.

from Command

Методы

Команда 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 configurePrompts(InputInterface $input)

Настроить резервные варианты запросов.

из ConfiguresPrompts
смешанный тип promptUntilValid(Closure $prompt, bool|string $required, Closure|null $validate)

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

из ConfiguresPrompts
?string validatePrompt(mixed $value, mixed $rules)

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

из ConfiguresPrompts
Validator getPromptValidatorInstance(mixed $field, mixed $value, mixed $rules, array $messages = [], array $attributes = [])

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

из ConfiguresPrompts
массив validationMessages()

Получить сообщения об ошибках проверки, которые следует использовать при проверке запросов.

из ConfiguresPrompts
массив validationAttributes()

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

из ConfiguresPrompts
void restorePrompts()

Восстановить вывод запросов.

из ConfiguresPrompts
void specifyParameters()

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

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

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

массив getOptions()

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

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
смешанный тип ask(string $question, string|null $default = null)

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

из InteractsWithIO
смешанный тип anticipate(string $question, array|callable $choices, string|null $default = null)

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

из InteractsWithIO
смешанный тип askWithCompletion(string $question, array|callable $choices, string|null $default = null)

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

из InteractsWithIO
смешанный тип 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)

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

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

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

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

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

из InteractsWithIO
$this newLine(int $count = 1)

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

из InteractsWithIO
void setInput(InputInterface $input)

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

из InteractsWithIO
void setOutput(OutputStyle $output)

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

из InteractsWithIO
void setVerbosity(string|int $level)

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

из InteractsWithIO
int parseVerbosity(string|int|null $level = null)

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

из InteractsWithIO
OutputStyle getOutput()

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

из InteractsWithIO
Factory outputComponents()

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

из InteractsWithIO
trap($signals, $callback)

Без описания

из InteractsWithSignals
void untrap()

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

из InteractsWithSignals
void interact(InputInterface $input, OutputInterface $output)

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

из PromptsForMissingInput
void promptForMissingArguments(InputInterface $input, OutputInterface $output)

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

из PromptsForMissingInput
array promptForMissingArgumentsUsing()

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

из PromptsForMissingInput
void afterPromptingForMissingArguments(InputInterface $input, OutputInterface $output)

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

из PromptsForMissingInput
bool didReceiveOptions(InputInterface $input)

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

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

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

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

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

из Macroable
static bool hasMacro(string $name)

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

из Macroable
static void flushMacros()

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

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

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

из Macroable
mixed __call(string $method, array $parameters)

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

из Macroable
void __construct()

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

из Command
void configureUsingFluentDefinition()

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

из Command
void configureIsolation()

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

из Command
int run(InputInterface $input, OutputInterface $output)

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

из Command
int execute(InputInterface $input, OutputInterface $output)

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

из Command
CommandMutex commandIsolationMutex()

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

из Command
void fail(Throwable|string|null $exception = null)

Принудительно завершить команду с ошибкой.

из Command
bool isHidden()

{@inheritdoc}

из Command
Command setHidden(bool $hidden = true)

{@inheritdoc}

из Command
Application getLaravel()

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

из Command
void setLaravel(Container $laravel)

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

из Command
bool confirmToProceed(string $warning = 'Application In Production', Closure|bool|null $callback = null)

Подтвердить перед продолжением действия.

из ConfirmableTrait
Closure getDefaultConfirmCallback()

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

из ConfirmableTrait
int|null handle()

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

string getQueue(string $connection)

Получить имя очереди для очистки.

Подробности

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 configurePrompts(InputInterface $input)

Настроить отступы подсказок.

Параметры

InputInterface $input

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

void

protected mixed promptUntilValid(Closure $prompt, bool|string $required, Closure|null $validate)

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

Параметры

Closure $prompt
bool|string $required
Closure|null $validate

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

mixed

protected ?string validatePrompt(mixed $value, mixed $rules)

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

Parameters

mixed $value
mixed $rules

Return Value

?string

protected Validator getPromptValidatorInstance(mixed $field, mixed $value, mixed $rules, array $messages = [], array $attributes = [])

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

Parameters

mixed $field
mixed $value
mixed $rules
array $messages
array $attributes

Return Value

Validator

protected array validationMessages()

Получить сообщения об ошибках валидации, которые следует использовать при проверке подсказок.

Return Value

array

protected array validationAttributes()

Получить атрибуты валидации, которые следует использовать при проверке подсказок.

Return Value

array

protected void restorePrompts()

Восстановить вывод подсказок.

Return Value

void

protected void specifyParameters()

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

Return Value

void

protected array getArguments()

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

Return Value

array

protected array getOptions()

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

Return Value

array

bool hasArgument(string|int $name)

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

Parameters

string|int $name

Return Value

bool

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

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

Parameters

string|null $key

Return Value

array|string|bool|null

array arguments()

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

Return Value

array

bool hasOption(string $name)

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

Parameters

string $name

Return Value

bool

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

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

Parameters

string|null $key

Return Value

string|array|bool|null

array options()

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

Return Value

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)

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

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

Factory outputComponents()

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

Return Value

Factory

trap($signals, $callback)

Без описания

Parameters

$signals
$callback

void untrap()

internal

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

Return Value

void

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()

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

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

void fail(Throwable|string|null $exception = null)

Принудительно завершить команду с ошибкой.

Parameters

Throwable|string|null $exception

Return Value

void

Exceptions

Throwable

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.

Parameters

Container $laravel

Return Value

void

bool confirmToProceed(string $warning = 'Application In Production', Closure|bool|null $callback = null)

Подтвердить перед выполнением действия.

Этот метод запрашивает подтверждение только в продакшене.

Parameters

string $warning
Closure|bool|null $callback

Return Value

bool

protected Closure getDefaultConfirmCallback()

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

Значение результата

Closure

int|null handle()

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

Значение результата

int|null

protected string getQueue(string $connection)

Получить имя очереди для очистки.

Параметры

string $connection

Значение результата

string

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

Spec-Zone.ru

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