Maker
in package
Table of Contents
Properties
- $generators : array<string, GeneratorInterface>
Methods
- applyChanges() : void
- Applies the given code changes
- bind() : void
- Binds a maker generator
- buildChanges() : array<string|int, CodeChange>
- evaluateParamters() : void
- Pass parameters that will be used for change generation.
- getAvailableGeneratorTypes() : array<string|int, string>
- Returns an array of currently bound generator type
- getExpectedArguments() : array<string, array<string, mixed>>
- Returns the expected arguments for given generator
- hasGenerator() : bool
- Check if a generator of type is bound
- getGeneratorSafe() : GeneratorInterface
- Returns the corresponding generator or throws an exception
Properties
$generators
private
array<string, GeneratorInterface>
$generators
= []
Methods
applyChanges()
Applies the given code changes
public
applyChanges(array<string|int, CodeChange> $changes[, bool $force = false ][, Climate|null $cli = null ]) : void
Parameters
- $changes : array<string|int, CodeChange>
- $force : bool = false
-
Force the changes, means override existing data if necessary
- $cli : Climate|null = null
-
Command line interface to ask the user if changes shall be applied
bind()
Binds a maker generator
public
bind(GeneratorInterface $generator) : void
Parameters
- $generator : GeneratorInterface
buildChanges()
public
buildChanges(string $generatorType, array<string, mixed> $parameters) : array<string|int, CodeChange>
Parameters
- $generatorType : string
- $parameters : array<string, mixed>
Return values
array<string|int, CodeChange>evaluateParamters()
Pass parameters that will be used for change generation.
public
evaluateParamters(string $generatorType, array<string, mixed> &$parameters[, CLImate|null $cli = null ]) : void
The generator can then validate and complete them by promting the user
Parameters
- $generatorType : string
- $parameters : array<string, mixed>
- $cli : CLImate|null = null
getAvailableGeneratorTypes()
Returns an array of currently bound generator type
public
getAvailableGeneratorTypes() : array<string|int, string>
Return values
array<string|int, string>getExpectedArguments()
Returns the expected arguments for given generator
public
getExpectedArguments(string $generatorType) : array<string, array<string, mixed>>
Parameters
- $generatorType : string
Return values
array<string, array<string, mixed>>hasGenerator()
Check if a generator of type is bound
public
hasGenerator(string $generatorType) : bool
Parameters
- $generatorType : string
Return values
boolgetGeneratorSafe()
Returns the corresponding generator or throws an exception
private
getGeneratorSafe(string $generatorType) : GeneratorInterface
Parameters
- $generatorType : string