Settings for a generator.
The \FeaturePhp\Generator\ChunkGenerator settings follow the structure:
or, alternatively:
The \FeaturePhp\Generator\CopyGenerator, \FeaturePhp\Generator\CollaborationGenerator and \FeaturePhp\Generator\AspectGenerator settings inside an artifact's generator settings follow the structure:
The \FeaturePhp\Generator\CopyGenerator, \FeaturePhp\Generator\CollaborationGenerator and \FeaturePhp\Generator\AspectGenerator settings in the product line's generator settings follow the structure:
The \FeaturePhp\Generator\RuntimeGenerator settings inside an artifact's generator settings follow the structure:
The \FeaturePhp\Generator\RuntimeGenerator settings in the product line's generator settings follow the structure:
The \FeaturePhp\Generator\TemplateGenerator settings follow the structure:
or, alternatively:
| package | Default |
|---|---|
| inherited_from | \FeaturePhp\Settings |
__construct(array $cfg, string $directory = ".")
The directory may be used to resolve relative paths in the settings.
| inherited_from | \FeaturePhp\Settings::__construct() |
|---|
arraya plain settings array
stringthe directory the settings apply to
__construct(array $cfg, string $directory = ".")
The directory may be used to resolve relative paths in the settings.
arraya plain settings array
stringthe directory the settings apply to
emptyInstance() : \FeaturePhp\Generator\Settings
\FeaturePhp\Generator\SettingsfromArray(array $cfg, string $directory = ".")
arraya plain settings array
stringthe directory the settings apply to
fromFile(string $fileName) : \FeaturePhp\Settings
string
\FeaturePhp\SettingsfromString(string $json, string $directory = ".") : \FeaturePhp\Settings
string
stringthe directory the settings apply to
\FeaturePhp\Settingsget() : mixed
A setting path can be supplied variadically.
mixedgetDirectory() : string
stringgetIn(array $cfg) : mixed
A setting path can be supplied variadically.
array
mixedgetInstance(string|array|boolean $object, string $klass) : \FeaturePhp\$class
If a string is given, the class is instantiated from a file. If an array("data" => ...) is given, the class is instantiated from a string. If another array is given, the class is instantiated from that array. If true is given, the class is instantiated from an empty array.
stringarrayboolean
string
\FeaturePhp\$classgetOptional(mixed $defaultValue) : mixed
A setting path can be supplied variadically.
mixed
mixedgetPath(string $path) : string
string
stringgetWith(string $key, callable $predicate) : mixed
Throws \FeaturePhp\InvalidSettingsException if the predicate fails.
string
callable
mixedinDirectory(string $directory)
stringthe directory the settings apply to
has(string $key, array $cfg = null) : boolean
If no settings array is given, the internal settings array is assumed.
string
array
booleanset(string $key, mixed $value)
A setting path can be supplied variadically.
string
mixed
setOptional(string $key, mixed $value)
string
mixed
_get(array $cfg) : mixed
A setting path can be supplied variadically.
array
mixed_set(array $cfg, array $args)
array
arraya setting path followed by the setting's new value
$cfg : array