Settings for specifying a single file.
File specifications are used by a \FeaturePhp\Generator\CopyGenerator to specify a single file (in contrast to a \FeaturePhp\Specification\DirectorySpecification). The file specification settings follow the structure:
or, alternatively:
If either source or target is omitted, they share the same value.
| package | Default |
|---|---|
| inherited_from | \FeaturePhp\Specification\Specification |
__construct(array $cfg, string $directory = ".")
The directory may be used to resolve relative paths in the settings.
| inherited_from | \FeaturePhp\Specification\Specification::__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
fromArray(array $cfg, string $directory = ".")
arraya plain settings array
stringthe directory the settings apply to
fromArrayAndSettings(array $cfg, \FeaturePhp\Settings $settings, \FeaturePhp\Artifact\Artifact $artifact = null) : \FeaturePhp\Specification\FileSpecification
The settings context is taken into consideration to generate paths relative to the settings.
arraya plain settings array
\FeaturePhp\Settingsthe settings context
\FeaturePhp\Artifact\Artifact
\FeaturePhp\Specification\FileSpecificationfromFile(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
stringgetRelativeSource() : string
stringgetSource() : string
stringgetSourcePlace() : \FeaturePhp\Artifact\Place
\FeaturePhp\Artifact\PlacegetTarget() : string
stringgetTargetPlace() : \FeaturePhp\Artifact\Place
\FeaturePhp\Artifact\PlacegetWith(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