Skip to content

FormatDriverInterface

A FormatDriver turns one config source file, in whatever format it understands, into a normalized PHP array — the same canonical shape a given config handler’s array-based execute() method consumes regardless of which driver produced it (see Quiote\Config\IArrayConfigHandler).

interface FormatDriverInterface

Implemented byAbstractArrayFormatDriver, XmlFormatDriver
Since1.0.0
SourceConfig/Format/FormatDriverInterface.php
MethodDescription
[`load(string $path, string $environment, stringnull $context = null): array<string, mixed>`](#load)
supports(string $path): boolWhether this driver can handle the given path, based on its extension.

abstract public function load(string $path, string $environment, string|null $context = null): array<string, mixed>

The active context name, if any.

ParameterTypeDescription
$pathstring
$environmentstringThe active environment name (only meaningful to drivers whose format has a native environment-filtering concept, e.g. XmlFormatDriver; array/YAML drivers ignore it today — see class docs).
$context`string““null`

Returns array``<``string``, ``mixed``> — The resolved, parent-chain-merged, directive-expanded config data.

abstract public function supports(string $path): bool

Whether this driver can handle the given path, based on its extension.

Used by FormatDriverRegistry to pick a driver.

ParameterTypeDescription
$pathstring

Returns bool