class Generator (View source)

Traits

Methods

void
throwFailsCommand(string $message, string|null $command = null)

Throw fails command

__construct(string $base_directory, string $name)

GeneratorCommand constructor

bool
fileExists()

Check if controller exists

void
filenameIsValid(string|null $filename)

Check if filename is valid

string
getPath()

Get file path

bool
exists()

Check if controller exists

bool
write(string $type, array $data = [])

Write file

string
makeStubContent(string $type, array $data = [])

Stub render

void
setName(string $name)

Set writing filename

void
setBaseDirectory(string $base_directory)

Get the base directory

Details

protected void throwFailsCommand(string $message, string|null $command = null)

Throw fails command

Parameters

string $message
string|null $command

Return Value

void

__construct(string $base_directory, string $name)

GeneratorCommand constructor

Parameters

string $base_directory
string $name

bool fileExists()

Check if controller exists

Return Value

bool

void filenameIsValid(string|null $filename)

Check if filename is valid

Parameters

string|null $filename

Return Value

void

string getPath()

Get file path

Return Value

string

bool exists()

Check if controller exists

Return Value

bool

bool write(string $type, array $data = [])

Write file

Parameters

string $type
array $data

Return Value

bool

string makeStubContent(string $type, array $data = [])

Stub render

Parameters

string $type
array $data

Return Value

string

void setName(string $name)

Set writing filename

Parameters

string $name

Return Value

void

void setBaseDirectory(string $base_directory)

Get the base directory

Parameters

string $base_directory

Return Value

void