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.
Synopsis
Section titled “Synopsis”interface IArrayConfigHandler
| Implemented by | CachingConfigHandler, CompileConfigHandler, ConfigHandlersConfigHandler, DatabaseConfigHandler, FactoryConfigHandler, MiddlewareConfigHandler, ModuleConfigHandler, OutputTypeConfigHandler, PluginConfigHandler, RbacDefinitionConfigHandler, ReturnArrayConfigHandler, SettingConfigHandler, TestSuitesConfigHandler, TranslationConfigHandler, SecurityConfigHandler |
| Since | 1.0.0 |
| Source | Config/IArrayConfigHandler.php |
Methods
Section titled “Methods”| Method | Description |
|---|---|
| [`executeArray(array | null $sourceRef = null): mixed`](#executearray) |
toCanonicalArray(XmlConfigDomDocument $document): array<mixed> |
executeArray()
Section titled “executeArray()”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).
| Parameter | Type | Description |
|---|---|---|
$config | array``<``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.
toCanonicalArray()
Section titled “toCanonicalArray()”abstract public function toCanonicalArray(XmlConfigDomDocument $document): array<mixed>
| Parameter | Type | Description |
|---|---|---|
$document | XmlConfigDomDocument |
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.