class YamlTransformer implements TransformerInterface (View source)

Constants

BEFORE_FLAG

AFTER_FLAG

ONLY_FLAG

EXCEPT_FLAG

Methods

__construct(string $baseDir, Finder $finder)

No description

static YamlTransformer
create(string $baseDir, Finder $finder)

No description

transform(MutableConfigCollectionInterface $collection)

This is responsible for parsing a single yaml file and returning it into a format that Config can understand. Config will then be responsible for turning thie output into the final merged config.

$this
addRule(string $rule, Closure $func)

This allows external rules to be added to only/except checks. Config is only supposed to be setup once, so adding rules is a one-way system. You cannot remove rules after being set. This also prevent built-in rules from being removed.

ignoreRule(string $rule)

This allows config to ignore only/except rules that have been set. This enables apps to ignore built-in rules without causing errors where a rule is undefined.

Details

__construct(string $baseDir, Finder $finder)

Parameters

string $baseDir

directory to scan for yaml files

Finder $finder

static YamlTransformer create(string $baseDir, Finder $finder)

Parameters

string $baseDir

directory to scan for yaml files

Finder $finder

Return Value

YamlTransformer

MutableConfigCollectionInterface transform(MutableConfigCollectionInterface $collection)

This is responsible for parsing a single yaml file and returning it into a format that Config can understand. Config will then be responsible for turning thie output into the final merged config.

$this addRule(string $rule, Closure $func)

This allows external rules to be added to only/except checks. Config is only supposed to be setup once, so adding rules is a one-way system. You cannot remove rules after being set. This also prevent built-in rules from being removed.

Parameters

string $rule
Closure $func

Return Value

$this

ignoreRule(string $rule)

This allows config to ignore only/except rules that have been set. This enables apps to ignore built-in rules without causing errors where a rule is undefined.

This, is a one-way system and is only meant to be configured once. When you ignore a rule, you cannot un-ignore it.

Parameters

string $rule