Skip to content

MakeCommand


Properties

name

protected string $name

description

protected string $description

presets

protected \Codefy\Framework\Console\PresetRegistry $presets

generator

protected \Codefy\Framework\Console\ClassGenerator $generator

codefy

protected \Codefy\Framework\Application $codefy

Methods

__construct

public __construct(\Codefy\Framework\Console\PresetRegistry $presets, \Codefy\Framework\Console\ClassGenerator $generator, \Codefy\Framework\Application $codefy): mixed

Parameters:

Parameter Type Description
$presets \Codefy\Framework\Console\PresetRegistry
$generator \Codefy\Framework\Console\ClassGenerator
$codefy \Codefy\Framework\Application

handle

protected handle(): int

Throws:


scanDirectories

private scanDirectories(string $root): array

Parameters:

Parameter Type Description
$root string

buildClassPath

Build final valid class path (NO automatic namespace-derived directories).

private buildClassPath(string $namespaceRootPath, string $selectedDirectory, string $className): string

Parameters:

Parameter Type Description
$namespaceRootPath string
$selectedDirectory string
$className string

buildNamespace

private buildNamespace(string $baseNamespace, string $directory): string

Parameters:

Parameter Type Description
$baseNamespace string
$directory string

Inherited methods

__construct

public __construct(\Codefy\Framework\Application $codefy): mixed

Parameters:

Parameter Type Description
$codefy \Codefy\Framework\Application

configure

Configure commands.

protected configure(): void

execute

protected execute(\Symfony\Component\Console\Input\InputInterface $input, \Symfony\Component\Console\Output\OutputInterface $output): int

Parameters:

Parameter Type Description
$input \Symfony\Component\Console\Input\InputInterface
$output \Symfony\Component\Console\Output\OutputInterface

Throws:


getArgument

Returns the argument value for the given argument name.

protected getArgument(string|null $key = null): mixed

Parameters:

Parameter Type Description
$key string|null

getOptions

Returns the option value for the given option name.

protected getOptions(string|null $key = null): bool|string|string[]|null

Parameters:

Parameter Type Description
$key string|null

terminalRaw

Outputs the string to the console without any tag.

protected terminalRaw(string $string): void

Parameters:

Parameter Type Description
$string string

terminalInfo

Output to the terminal wrap in info tags.

protected terminalInfo(string $string): void

Parameters:

Parameter Type Description
$string string

terminalComment

Output to the terminal wrap in comment tags.

protected terminalComment(string $string): void

Parameters:

Parameter Type Description
$string string

terminalQuestion

Output to the terminal wrap in question tags.

protected terminalQuestion(string $string): void

Parameters:

Parameter Type Description
$string string

terminalError

Output to the terminal wrap in error tags.

protected terminalError(string $string): void

Parameters:

Parameter Type Description
$string string

terminalNewLine

Output to the terminal with a blank line.

protected terminalNewLine(int $count = 1): void

Parameters:

Parameter Type Description
$count int

confirm

protected confirm(string $question): mixed

Parameters:

Parameter Type Description
$question string

ask

protected ask(string $question, bool|float|int|string|null $default = null): mixed

Parameters:

Parameter Type Description
$question string
$default bool|float|int|string|null

choice

protected choice(string $question, (string|bool|int|float|\Stringable)[] $choices, bool|float|int|string|null $default = null, string|null $message = null): mixed

Parameters:

Parameter Type Description
$question string
$choices (string|bool|int|float|\Stringable)[]
$default bool|float|int|string|null
$message string|null

multiChoice

protected multiChoice(string $question, (string|bool|int|float|\Stringable)[] $choices, bool|float|int|string|null $default = null, string|null $message = null): mixed

Parameters:

Parameter Type Description
$question string
$choices (string|bool|int|float|\Stringable)[]
$default bool|float|int|string|null
$message string|null

resolveCommand

Resolve the console command instance for the given command.

protected resolveCommand(\Symfony\Component\Console\Command\Command|string $command): \Symfony\Component\Console\Command\Command

Parameters:

Parameter Type Description
$command \Symfony\Component\Console\Command\Command|string

call

Call another console command.

public call(\Symfony\Component\Console\Command\Command|string $command, array $arguments = []): int

Parameters:

Parameter Type Description
$command \Symfony\Component\Console\Command\Command|string
$arguments array

Throws:


option

Get the value of a command option.

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

Parameters:

Parameter Type Description
$key string|null

options

Get all the options passed to the command.

public options(): bool|array|string|null

runCommand

Run the given console command.

protected runCommand(\Symfony\Component\Console\Command\Command|string $command, array $arguments, \Symfony\Component\Console\Output\OutputInterface $output): int

Parameters:

Parameter Type Description
$command \Symfony\Component\Console\Command\Command|string
$arguments array
$output \Symfony\Component\Console\Output\OutputInterface

Throws:


createInputFromArguments

Create an input instance from the given arguments.

protected createInputFromArguments(array $arguments): \Symfony\Component\Console\Input\ArrayInput

Parameters:

Parameter Type Description
$arguments array

context

Get all the context passed to the command.

protected context(): array