Skip to content

PhpArrayFormatDriver

Loads a config source that is itself a plain PHP file returning an array — the recommended primary format (zero parsing cost beyond opcache, full IDE support, native parent/imports path resolution via AbstractArrayFormatDriver).

final class PhpArrayFormatDriver extends AbstractArrayFormatDriver implements PositionAwareFormatDriverInterface

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

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

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

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

public function supports(string $path): bool

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

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.