FactoryConfigHandler
FactoryConfigHandler allows you to specify which factory implementation the system will use.
The factory ordering/startup-sequence/must_implement logic in getFactoryDefinitions() is pure PHP with no XML-specific content at all, so it lives in code rather than in the configuration. The canonical array is exactly the per-factory class/params pairs declared in the source (XML, PHP, or YAML): [ ‘validation_manager’ => [‘class’ => ‘Some\Class’, ‘params’ => […]], ‘response’ => [‘class’ => ’…’, ‘params’ => […]], // one entry per return ['database_manager' => ['class' => ..., 'params' => [...]], ...];.
Synopsis
Section titled “Synopsis”class FactoryConfigHandler extends XmlConfigHandler implements IArrayConfigHandler, IPositionAwareConfigHandler, ISchemaAwareConfigHandler
| Extends | XmlConfigHandler |
| Implements | IArrayConfigHandler, IPositionAwareConfigHandler, ISchemaAwareConfigHandler |
| Since | 1.0.0 |
| Source | Config/FactoryConfigHandler.php |
Constants
Section titled “Constants”| Constant | Value | Description |
|---|---|---|
XML_NAMESPACE | 'http://quiote.dev/quiote/config/parts/factories/1.1' |
Methods
Section titled “Methods”| Method | Description |
|---|---|
execute(XmlConfigDomDocument $document): mixed | Execute this configuration handler. |
| [`executeArray(array<string, array{class: (string | null), params: array |
schema(): Rule | No required list: which factories must be present depends on runtime settings (translation_manager on core.use_translation), so that is a semantic check in executeArray() rather than a static array shape. |
| [`toCanonicalArray(XmlConfigDomDocument $document): array<string, array{class: (string | null), params: array |
| [`toCanonicalArrayWithPositions(XmlConfigDomDocument $document, ElementPositionIndex $positions): array{data: array<string, array{class: (string | null), params: array |
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 |
|---|---|
ParseException | If a requested configuration file is improperly formatted. |
executeArray()
Section titled “executeArray()”public function executeArray(array<string, array{class: (string | null), params: 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<string, array{class: (string | null), params: array |
$sourceRef | `string“ | “null` |
Returns mixed — The declaration to be cached, exactly as IXmlConfigHandler::execute() returns.
schema()
Section titled “schema()”public function schema(): Rule
No required list: which factories must be present depends on runtime settings (translation_manager on core.use_translation), so that is a semantic check in executeArray() rather than a static array shape.
Returns Rule
toCanonicalArray()
Section titled “toCanonicalArray()”public function toCanonicalArray(XmlConfigDomDocument $document): array<string, array{class: (string | null), params: array<mixed>}>
| Parameter | Type | Description |
|---|---|---|
$document | XmlConfigDomDocument |
Returns array``<``string``, ``array{class: (string | null), params: array<mixed>}``>
toCanonicalArrayWithPositions()
Section titled “toCanonicalArrayWithPositions()”public function toCanonicalArrayWithPositions(XmlConfigDomDocument $document, ElementPositionIndex $positions): array{data: array<string, array{class: (string | null), params: array<mixed>}>, positions: array<string, array{file: string, line: int}>}
| Parameter | Type | Description |
|---|---|---|
$document | XmlConfigDomDocument | |
$positions | ElementPositionIndex |
Returns array{data: array<string, array{class: (string | null), params: array<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. |