Documentation

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'

$moduleNestedDirectories

private array<string|int, mixed> $moduleNestedDirectories = ['assets', 'languages', 'models', 'presenters', 'utils']

Methods

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
throws
Exception
Return values
array<string|int, mixed>

moduleClassGenerator()

Возвращает текст PHP класса с содержанием кода модуля

private moduleClassGenerator(string $name, string $title, bool $isConfigurable) : string
Parameters
$name : string

Имя модуля

$title : string

Заголовок модуля

$isConfigurable : bool

Конфигурируемый модуль?

Return values
string

Search results