Skip to content

IArrayConfigHandler

A ConfigHandler on the array-based contract: its compilation logic (executeArray()) consumes a plain, canonical array instead of walking a DOM, so the same logic works whether that array came from XML, a PHP-array file, or YAML.

toCanonicalArray() is the one XML-specific piece every implementation needs: the DOM-walking logic that produces the canonical array. XmlConfigHandler’s execute() calls it and feeds the result into executeArray(); XmlFormatDriver calls it too, for non-legacy XML loading through a FormatDriverRegistry.

interface IArrayConfigHandler

Implemented byCachingConfigHandler, CompileConfigHandler, ConfigHandlersConfigHandler, DatabaseConfigHandler, FactoryConfigHandler, MiddlewareConfigHandler, ModuleConfigHandler, OutputTypeConfigHandler, PluginConfigHandler, RbacDefinitionConfigHandler, ReturnArrayConfigHandler, SettingConfigHandler, TestSuitesConfigHandler, TranslationConfigHandler, SecurityConfigHandler
Since1.0.0
SourceConfig/IArrayConfigHandler.php
MethodDescription
[`executeArray(array $config, stringnull $sourceRef = null): mixed`](#executearray)
toCanonicalArray(XmlConfigDomDocument $document): array<mixed>

abstract public function executeArray(array<mixed> $config, string|null $sourceRef = null): mixed

Origin reference for the compiled cache file’s header comment (a file path for any format; XML’s is $document->documentURI).

ParameterTypeDescription
$configarray``<``mixed``>The canonical config array, matching the shape returned by toCanonicalArray().
$sourceRef`string““null`

Returns mixed — The declaration to be cached, exactly as IXmlConfigHandler::execute() returns.

abstract public function toCanonicalArray(XmlConfigDomDocument $document): array<mixed>

ParameterTypeDescription
$documentXmlConfigDomDocument

Returns array``<``mixed``> — The canonical array shape this handler’s config type uses — see the concrete handler’s own docblock (e.g. SettingConfigHandler) for exactly what that shape is.