Skip to content

PositionAwareFormatDriverInterface

Opt-in “locating” parse mode (see VSCODE_EXTENSION_INTEGRATION.md’s config validator work item 3): same canonical array a plain load() would produce, plus a key-path -> {file, line} index for whichever keys the driver could trace back to a source position.

Formalizes the shape XmlFormatDriver::loadWithPositions() already has, so a caller (e.g. a future validate_config probe capability) can use it generically regardless of which format actually produced the config.

interface PositionAwareFormatDriverInterface

Implemented byPhpArrayFormatDriver, XmlFormatDriver, YamlFormatDriver
Since1.0.0
SourceConfig/Format/PositionAwareFormatDriverInterface.php
MethodDescription
loadWithPositions(string $path, ?string $environment, ?string $context = null): array{data: array<string, mixed>, positions: array<string, array{file: string, line: int}>}

abstract 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}>}