Spec-Zone.ru › Laravel 9

TestMakeCommand

class TestMakeCommand extends GeneratorCommand (View source)

Свойства

CallsCommands
HasParameters
InteractsWithIO
InteractsWithSignals
PromptsForMissingInput
Macroable

Свойства

protected Factory internal $components

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

from InteractsWithIO
protected InputInterface $input

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

from InteractsWithIO
protected OutputStyle $output

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

from InteractsWithIO
protected int $verbosity

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

from InteractsWithIO
protected array $verbosityMap

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

from InteractsWithIO
protected Signals|null $signals

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

from InteractsWithSignals
static protected array $macros

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

from Macroable
protected Application $laravel

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

from Command
protected string $signature

Имя и сигнатура команды консоли.

from Command
protected string $name

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

protected string $description

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

protected string $help

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

from Command
protected bool $hidden

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

from Command
protected Filesystem $files

Экземпляр файловой системы.

from GeneratorCommand
protected string $type

Тип генерируемого класса.

protected string[] $reservedNames

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

from GeneratorCommand
static protected string|null deprecated $defaultName

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

Методы

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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(Filesystem $files)

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

from GeneratorCommand
void configureUsingFluentDefinition()

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

from Command
void configureIsolation()

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

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

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

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

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

from Command
CommandMutex commandIsolationMutex()

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

from Command
bool isHidden()

{@inheritdoc}

from Command
Команда setHidden(bool $hidden = true)

{@inheritdoc}

из Команды
Приложение getLaravel()

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

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

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

из Команды
string getStub()

Получить шаблонный файл для генератора.

bool|null handle()

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

из GeneratorCommand
string qualifyClass(string $name)

Обработать имя класса и отформатировать его в соответствии с корневым пространством имен.

из GeneratorCommand
string qualifyModel(string $model)

Отформатировать заданный базовый класс модели.

из GeneratorCommand
array<int,string> possibleModels()

Получить список возможных имён моделей.

из GeneratorCommand
array<int,string> possibleEvents()

Получить список возможных имён событий.

из GeneratorCommand
string getDefaultNamespace(string $rootNamespace)

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

bool alreadyExists(string $rawName)

Определить, существует ли класс.

из GeneratorCommand
string getPath(string $name)

Получить путь к классу назначения.

string makeDirectory(string $path)

Создать директорию для класса, если необходимо.

из GeneratorCommand
string buildClass(string $name)

Создать класс с заданным именем.

из GeneratorCommand
$this replaceNamespace(string $stub, string $name)

Заменить пространство имён для данного шаблона.

из GeneratorCommand
string getNamespace(string $name)

Получить полное пространство имён для заданного класса без имени класса.

из GeneratorCommand
string replaceClass(string $stub, string $name)

Заменить имя класса для данного фрагмента.

из GeneratorCommand
string sortImports(string $stub)

Сортирует импорты для данного фрагмента по алфавиту.

из GeneratorCommand
string getNameInput()

Получить желаемое имя класса из входных данных.

из GeneratorCommand
string rootNamespace()

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

string|null userProviderModel()

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

из GeneratorCommand
bool isReservedName(string $name)

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

из GeneratorCommand
string viewPath(string $path = '')

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

из GeneratorCommand
string resolveStubPath(string $stub)

Получить полностью квалифицированный путь к шаблону.

Подробности

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)

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

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.

Параметры

string|int|null $level

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

int

OutputStyle getOutput()

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

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

OutputStyle

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

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

Параметры

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

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

void

void untrap()

internal

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

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

void

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

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

Параметры

InputInterface $input
OutputInterface $output

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

void

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

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

Параметры

InputInterface $input
OutputInterface $output

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

void

protected array promptForMissingArgumentsUsing()

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

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

array

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

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

Параметры

InputInterface $input
OutputInterface $output

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

void

protected bool didReceiveOptions(InputInterface $input)

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

Параметры

InputInterface $input

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

bool

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

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

Параметры

string $name
object|callable $macro

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

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(Filesystem $files)

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

Parameters

Filesystem $files

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

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

Значение возврата

CommandMutex

bool isHidden()

{@inheritdoc}

Значение возврата

bool

Command setHidden(bool $hidden = true)

{@inheritdoc}

Параметры

bool $hidden

Значение возврата

Command

Application getLaravel()

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

Значение возврата

Application

void setLaravel(Container $laravel)

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

Параметры

Container $laravel

Значение возврата

void

protected string getStub()

Получить шаблонный файл для генератора.

Значение возврата

string

bool|null handle()

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

Значение возврата

bool|null

Исключения

FileNotFoundException

protected string qualifyClass(string $name)

Разбор имени класса и форматирование в соответствии с корневым именем пространства.

Параметры

string $name

Значение возврата

string

protected string qualifyModel(string $model)

Уточнение имени заданной модели, основываясь на имени пространства.

Параметры

string $model

Значение возврата

string

protected array<int,string> possibleModels()

Получить список возможных имен моделей.

Значение возврата

array<int,string>

protected array<int,string> possibleEvents()

Получить список возможных имен событий.

Значение возврата

array<int,string>

protected string getDefaultNamespace(string $rootNamespace)

Получить имя пространства имён по умолчанию для класса.

Parameters

string $rootNamespace

Return Value

string

protected bool alreadyExists(string $rawName)

Определить, существует ли класс.

Parameters

string $rawName

Return Value

bool

protected string getPath(string $name)

Получить путь к целевому классу.

Parameters

string $name

Return Value

string

protected string makeDirectory(string $path)

Создать директорию для класса, если необходимо.

Parameters

string $path

Return Value

string

protected string buildClass(string $name)

Создать класс с заданным именем.

Parameters

string $name

Return Value

string

Exceptions

FileNotFoundException

protected $this replaceNamespace(string $stub, string $name)

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

Parameters

string $stub
string $name

Return Value

$this

protected string getNamespace(string $name)

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

Parameters

string $name

Return Value

string

protected string replaceClass(string $stub, string $name)

Заменить имя класса в заданном шаблоне.

Parameters

string $stub
string $name

Return Value

string

protected string sortImports(string $stub)

Отсортировать импорты в заданном шаблоне по алфавиту.

Parameters

string $stub

Return Value

string

protected string getNameInput()

Получить желаемое имя класса из ввода.

Return Value

string

protected string rootNamespace()

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

Return Value

string

protected string|null userProviderModel()

Получить модель для провайдера пользователей по умолчанию.

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

string|null

protected bool isReservedName(string $name)

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

Параметры

string $name

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

bool

protected string viewPath(string $path = '')

Получить путь к первому каталогу представления из конфигурации приложения.

Параметры

string $path

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

string

protected string resolveStubPath(string $stub)

Получить полное квалифицированное имя пути к псевдониму.

Параметры

string $stub

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

string

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

Spec-Zone.ru

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