OutputTypeConfigHandler
OutputTypeConfigHandler handles output type configuration files.
Migrated to IArrayConfigHandler (phase 2). Canonical schema: [‘default’ => ‘output_type_name’, ‘output_types’ => [‘name’ => [‘parameters’ => […], ‘default_renderer’ => …, ‘renderers’ => […], ‘layouts’ => […], ‘default_layout’ => …, ‘exception_template’ => …|null]]] All keys in the output-type, renderer, layout, layer, and slot sub-arrays are optional when using PHP/YAML format — executeArray() applies the same defaults that XML provides via getAttribute($name, $default), so terse configs work. The duplicate-name and missing-default checks are inherently tied to the order ae:configuration blocks are walked in (the last block’s default attribute wins), so they stay in toCanonicalArray() exactly as before; only the final “undefined default output type” check — a pure function of the finished canonical array — moved to executeArray().
Synopsis
Section titled “Synopsis”class OutputTypeConfigHandler extends XmlConfigHandler implements IArrayConfigHandler, IPositionAwareConfigHandler, ISchemaAwareConfigHandler
| Extends | XmlConfigHandler |
| Implements | IArrayConfigHandler, IPositionAwareConfigHandler, ISchemaAwareConfigHandler |
| Since | 1.0.0 |
| Source | Config/OutputTypeConfigHandler.php |
Constants
Section titled “Constants”| Constant | Value | Description |
|---|---|---|
XML_NAMESPACE | 'http://quiote.dev/quiote/config/parts/output_types/1.1' |
Methods
Section titled “Methods”| Method | Description |
|---|---|
execute(XmlConfigDomDocument $document): mixed | Execute this configuration handler. |
| [`executeArray(array{default?: (string | null), output_types?: array<string, array<string, mixed>>} $config, string |
schema(): Rule | Returns the structural rule for the output-type configuration. |
| [`toCanonicalArray(XmlConfigDomDocument $document): array{default: (string | null), output_types: array<string, array<string, mixed>>}`](#tocanonicalarray) |
toCanonicalArrayWithPositions(XmlConfigDomDocument $document, ElementPositionIndex $positions): array{data: array{default: ?string, output_types: array<string, array<string, mixed>>}, positions: array<string, array{file: string, line: int}>} | Positions are only tracked for each output type’s own line (via its “parameters” key, always present) — a reasonable top-level anchor without mirroring the full recursive renderers/layouts/layers/slots walk above (output_types.xml also has legacy-upgrade |
execute()
Section titled “execute()”public function execute(XmlConfigDomDocument $document): mixed
Execute this configuration handler.
The document to parse.
| Parameter | Type | Description |
|---|---|---|
$document | XmlConfigDomDocument | The document to parse. |
Returns mixed — The declaration to be cached.
| Throws | When |
|---|---|
UnreadableException | If a requested configuration file does not exist or is not readable. |
ParseException | If a requested configuration file is improperly formatted. |
executeArray()
Section titled “executeArray()”public function executeArray(array{default?: (string | null), output_types?: array<string, array<string, 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{default?: (string | null), output_types?: array<string, array<string, mixed>>}` |
$sourceRef | `string“ | “null` |
Returns mixed — The declaration to be cached, exactly as IXmlConfigHandler::execute() returns.
schema()
Section titled “schema()”public function schema(): Rule
Returns the structural rule for the output-type configuration.
Describes a top-level default output-type name plus an output_types map, each entry carrying its parameters, renderers, layouts and their layers and slots. Every key inside those sub-structures is required in the canonical array because the compilation step fills in the same defaults XML attributes supply, so a terse PHP or YAML source still arrives here complete.
Returns Rule
toCanonicalArray()
Section titled “toCanonicalArray()”public function toCanonicalArray(XmlConfigDomDocument $document): array{default: (string | null), output_types: array<string, array<string, mixed>>}
| Parameter | Type | Description |
|---|---|---|
$document | XmlConfigDomDocument |
Returns array{default: (string | null), output_types: array<string, array<string, mixed>>}
toCanonicalArrayWithPositions()
Section titled “toCanonicalArrayWithPositions()”public function toCanonicalArrayWithPositions(XmlConfigDomDocument $document, ElementPositionIndex $positions): array{data: array{default: ?string, output_types: array<string, array<string, mixed>>}, positions: array<string, array{file: string, line: int}>}
Positions are only tracked for each output type’s own line (via its “parameters” key, always present) — a reasonable top-level anchor without mirroring the full recursive renderers/layouts/layers/slots walk above (output_types.xml also has legacy-upgrade
| Parameter | Type | Description |
|---|---|---|
$document | XmlConfigDomDocument | |
$positions | ElementPositionIndex |
Returns array{data: array{default: ?string, output_types: array<string, array<string, mixed>>}, positions: array<string, array{file: string, line: int}>}
Inherited methods
Section titled “Inherited methods”These come from an ancestor and are documented where they are declared.
| Method | Declared in | Description |
|---|---|---|
appendParameter() | ParameterHolder | Append a parameter. |
appendParameterByRef() | ParameterHolder | Append a parameter by reference. |
clearParameters() | ParameterHolder | Clear all parameters associated with this request. |
getFlatParameterNames() | ParameterHolder | Retrieve an array of flattened parameter names. |
getParameter() | ParameterHolder | Retrieve a parameter. |
getParameterNames() | ParameterHolder | Retrieve an array of parameter names. |
getParameters() | ParameterHolder | Retrieve an array of parameters. |
hasParameter() | ParameterHolder | Indicates whether or not a parameter exists. |
initialize() | XmlConfigHandler | Initialize this ConfigHandler. |
literalize() | BaseConfigHandler | Literalize a string value. |
removeParameter() | ParameterHolder | Remove a parameter. |
replaceConstants() | BaseConfigHandler | Replace configuration directive identifiers in a string. |
replacePath() | BaseConfigHandler | Replace a relative filesystem path with an absolute one. |
reset() | ParameterHolder | Removes every parameter held, leaving the holder empty for reuse. |
setParameter() | ParameterHolder | Set a parameter. |
setParameterByRef() | ParameterHolder | Set a parameter by reference. |
setParameters() | ParameterHolder | Set an array of parameters. |
setParametersByRef() | ParameterHolder | Set an array of parameters by reference. |