Skip to content

YamlFormatDriver

Loads a config source written in YAML, via symfony/yaml.

Same parent/imports resolution as PhpArrayFormatDriver (see AbstractArrayFormatDriver) — a parent: key can point at a YAML file, a PHP-array file, or (for a strangler migration) an XML one.

final class YamlFormatDriver extends AbstractArrayFormatDriver implements PositionAwareFormatDriverInterface

ExtendsAbstractArrayFormatDriver
ImplementsPositionAwareFormatDriverInterface
Since1.0.0
SourceConfig/Format/YamlFormatDriver.php
MethodDescription
loadWithPositions(string $path, ?string $environment, ?string $context = null): array{data: array<string, mixed>, positions: array<string, array{file: string, line: int}>}
supports(string $path): boolWhether the path names a YAML file, matched case-insensitively.

public function loadWithPositions(string $path, ?string $environment, ?string $context = null): array{data: array<string, mixed>, positions: array<string, array{file: string, line: int}>}

ParameterTypeDescription
$pathstring
$environment?``string
$context?``string

Returns array{data: array<string, mixed>, positions: array<string, array{file: string, line: int}>}

public function supports(string $path): bool

Whether the path names a YAML file, matched case-insensitively.

Both the .yaml and .yml spellings are accepted.

ParameterTypeDescription
$pathstring

Returns bool

These come from an ancestor and are documented where they are declared.

MethodDeclared inDescription
load()AbstractArrayFormatDriver
setRegistry()AbstractArrayFormatDriverCalled by FormatDriverRegistry when this driver is registered, so parent/imports references can be resolved through any registered format, not just this driver’s own.