Settings for specifying a chunk of a text file.
Chunk specifications are used by a \FeaturePhp\Generator\ChunkGenerator to specify a chunk of text for inclusion in a \FeaturePhp\File\ChunkFile. The chunk specification settings inside an artifact's generator settings hold a specific chunk of a chunk file and follow the structure:
The chunk specification settings in the product line's generator settings hold general settings for a chunk file and follow the structure:
package | Default |
---|---|
inherited_from | \FeaturePhp\Specification\ExtendSpecification |
__construct(array $cfg, string $directory= "."
, \FeaturePhp\Artifact\Artifact $artifact= null
)
The directory may be used to resolve relative paths in the settings.
inherited_from | \FeaturePhp\Specification\ExtendSpecification::__construct() |
---|
array
a plain settings array
string
the directory the settings apply to
\FeaturePhp\Artifact\Artifact
__construct(array $cfg, string $directory = "."
)
The directory may be used to resolve relative paths in the settings.
array
a plain settings array
string
the directory the settings apply to
fromArray(array $cfg, string $directory = "."
)
array
a plain settings array
string
the directory the settings apply to
fromArrayAndSettings(array $cfg, \FeaturePhp\Settings $settings, \FeaturePhp\Artifact\Artifact $artifact = null
) : \FeaturePhp\Specification\ChunkSpecification
The settings context is taken into consideration to generate paths relative to the settings.
array
a plain settings array
\FeaturePhp\Settings
the settings context
\FeaturePhp\Artifact\Artifact
is ignored
\FeaturePhp\Specification\ChunkSpecification
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.
array
a plain settings array
\FeaturePhp\Settings
the settings context
\FeaturePhp\Artifact\Artifact
\FeaturePhp\Specification\FileSpecification
fromFile(string $fileName) : \FeaturePhp\Settings
string
\FeaturePhp\Settings
fromString(string $json, string $directory = "."
) : \FeaturePhp\Settings
string
string
the directory the settings apply to
\FeaturePhp\Settings
get() : mixed
A setting path can be supplied variadically.
mixed
getDirectory() : string
string
getHeader() : string
string
getIn(array $cfg) : mixed
A setting path can be supplied variadically.
array
mixed
getInstance(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.
string
array
boolean
string
\FeaturePhp\$class
getNewline() : boolean
boolean
getOptional(mixed $defaultValue) : mixed
A setting path can be supplied variadically.
mixed
mixed
getPath(string $path) : string
string
string
getRelativeSource() : string
string
getSource() : string
string
getSourcePlace() : \FeaturePhp\Artifact\Place
\FeaturePhp\Artifact\Place
getTarget() : string
string
getTargetPlace() : \FeaturePhp\Artifact\Place
\FeaturePhp\Artifact\Place
getText() : string
string
getWith(string $key, callable $predicate) : mixed
Throws \FeaturePhp\InvalidSettingsException if the predicate fails.
string
callable
mixed
inDirectory(string $directory)
string
the directory the settings apply to
mayCreate() : string
string
has(string $key, array $cfg = null
) : boolean
If no settings array is given, the internal settings array is assumed.
string
array
boolean
set(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
array
a setting path followed by the setting's new value
$cfg : array