Skip to content

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().

class OutputTypeConfigHandler extends XmlConfigHandler implements IArrayConfigHandler, IPositionAwareConfigHandler, ISchemaAwareConfigHandler

ExtendsXmlConfigHandler
ImplementsIArrayConfigHandler, IPositionAwareConfigHandler, ISchemaAwareConfigHandler
Since1.0.0
SourceConfig/OutputTypeConfigHandler.php
ConstantValueDescription
XML_NAMESPACE'http://quiote.dev/quiote/config/parts/output_types/1.1'
MethodDescription
execute(XmlConfigDomDocument $document): mixedExecute this configuration handler.
[`executeArray(array{default?: (stringnull), output_types?: array<string, array<string, mixed>>} $config, string
schema(): RuleReturns the structural rule for the output-type configuration.
[`toCanonicalArray(XmlConfigDomDocument $document): array{default: (stringnull), 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 stylesheets configured by default, so positions come back empty in practice anyway — see OutputTypeConfigHandlerPositionTest).

public function execute(XmlConfigDomDocument $document): mixed

Execute this configuration handler.

The document to parse.

ParameterTypeDescription
$documentXmlConfigDomDocumentThe document to parse.

Returns mixed — The declaration to be cached.

ThrowsWhen
UnreadableExceptionIf a requested configuration file does not exist or is not readable.
ParseExceptionIf a requested configuration file is improperly formatted.

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).

ParameterTypeDescription
$config`array{default?: (stringnull), output_types?: array<string, array<string, mixed>>}`
$sourceRef`string““null`

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

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

public function toCanonicalArray(XmlConfigDomDocument $document): array{default: (string | null), output_types: array<string, array<string, mixed>>}

ParameterTypeDescription
$documentXmlConfigDomDocument

Returns array{default: (string | null), output_types: array<string, array<string, mixed>>}

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 stylesheets configured by default, so positions come back empty in practice anyway — see OutputTypeConfigHandlerPositionTest).

ParameterTypeDescription
$documentXmlConfigDomDocument
$positionsElementPositionIndex

Returns array{data: array{default: ?string, output_types: array<string, array<string, mixed>>}, positions: array<string, array{file: string, line: int}>}

These come from an ancestor and are documented where they are declared.

MethodDeclared inDescription
appendParameter()ParameterHolderAppend a parameter.
appendParameterByRef()ParameterHolderAppend a parameter by reference.
clearParameters()ParameterHolderClear all parameters associated with this request.
getFlatParameterNames()ParameterHolderRetrieve an array of flattened parameter names.
getParameter()ParameterHolderRetrieve a parameter.
getParameterNames()ParameterHolderRetrieve an array of parameter names.
getParameters()ParameterHolderRetrieve an array of parameters.
hasParameter()ParameterHolderIndicates whether or not a parameter exists.
initialize()XmlConfigHandlerInitialize this ConfigHandler.
literalize()BaseConfigHandlerLiteralize a string value.
removeParameter()ParameterHolderRemove a parameter.
replaceConstants()BaseConfigHandlerReplace configuration directive identifiers in a string.
replacePath()BaseConfigHandlerReplace a relative filesystem path with an absolute one.
reset()ParameterHolderRemoves every parameter held, leaving the holder empty for reuse.
setParameter()ParameterHolderSet a parameter.
setParameterByRef()ParameterHolderSet a parameter by reference.
setParameters()ParameterHolderSet an array of parameters.
setParametersByRef()ParameterHolderSet an array of parameters by reference.