ModulesCreateCommand
extends Command
in package
Класс консольной команды для создания скелета модуля
Table of Contents
- $defaultDescription : mixed
- $defaultName : mixed
- $moduleNestedDirectories : array<string|int, mixed>
- configure() : void
- execute() : int
- checkShakeCase() : bool
- Проверяет соответствие строки на шаблон "змеиный_регистр"
- className() : string
- Генерирует строку с названием класса из "змеиного_регистра" в "PascalCase"
- createDirectories() : array<string|int, mixed>
- createLanguageGitIgnoreFile() : mixed
- getConfig() : array<string|int, mixed>
- getConfigFileName() : string
- getModulesDirectory() : string
- moduleClassGenerator() : string
- Возвращает текст PHP класса с содержанием кода модуля
Properties
$defaultDescription
protected
static mixed
$defaultDescription
= 'Create module skeleton'
$defaultName
protected
static mixed
$defaultName
= 'modules:create'
$moduleNestedDirectories
private
array<string|int, mixed>
$moduleNestedDirectories
= ['assets', 'languages', 'models', 'presenters', 'utils']
Methods
configure()
protected
configure() : void
Return values
void —execute()
protected
execute(InputInterface $input, OutputInterface $output) : int
Parameters
- $input : InputInterface
- $output : OutputInterface
Return values
int —checkShakeCase()
Проверяет соответствие строки на шаблон "змеиный_регистр"
private
checkShakeCase(string $str) : bool
Parameters
- $str : string
-
Строка для проверки
Return values
bool —Соответствие шаблону
className()
Генерирует строку с названием класса из "змеиного_регистра" в "PascalCase"
private
className(string $name) : string
Добавляет к окончанию слово "Module" Например: foo_bar в FooBarModule
Parameters
- $name : string
Return values
string —createDirectories()
private
createDirectories(mixed $moduleName, mixed $languages) : array<string|int, mixed>
Parameters
- $moduleName : mixed
- $languages : mixed
Return values
array<string|int, mixed> —createLanguageGitIgnoreFile()
private
createLanguageGitIgnoreFile(string $directory) : mixed
Parameters
- $directory : string
Return values
mixed —getConfig()
private
getConfig() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —getConfigFileName()
private
getConfigFileName() : string
Return values
string —getModulesDirectory()
private
getModulesDirectory() : string
Return values
string —moduleClassGenerator()
Возвращает текст PHP класса с содержанием кода модуля
private
moduleClassGenerator(string $name, string $title, bool $isConfigurable) : string
Parameters
- $name : string
-
Имя модуля
- $title : string
-
Заголовок модуля
- $isConfigurable : bool
-
Конфигурируемый модуль?