Canonical factory for constructing YAML-configured message groups. More...
Public Member Functions | |
| __construct (private readonly MessageGroupTypeRegistry $typeRegistry) | |
| createGroup (array $conf) | |
| Construct and initialise a MessageGroupBase instance from a parsed group configuration array. | |
| resolveClass (array $conf) | |
| Resolve the implementation class from the configuration selector. | |
Canonical factory for constructing YAML-configured message groups.
Centralises selector validation, type resolution, implementation validation, construction, and configuration initialisation that was previously spread across MessageGroupBase::factory() and its callers.
MessageGroupBase::factory() remains as a backwards-compatible static entry point and delegates here.
Definition at line 25 of file MessageGroupFactory.php.
| MediaWiki\Extension\Translate\MessageGroupConfiguration\MessageGroupFactory::__construct | ( | private readonly MessageGroupTypeRegistry | $typeRegistry | ) |
Definition at line 26 of file MessageGroupFactory.php.
| MediaWiki\Extension\Translate\MessageGroupConfiguration\MessageGroupFactory::createGroup | ( | array | $conf | ) |
Construct and initialise a MessageGroupBase instance from a parsed group configuration array.
Exactly one of BASIC.type or BASIC.class must be present. Providing both, or neither, throws InvalidArgumentException.
| array | $conf | Parsed group configuration. |
| InvalidArgumentException | on invalid selector or implementation. |
Definition at line 42 of file MessageGroupFactory.php.
| MediaWiki\Extension\Translate\MessageGroupConfiguration\MessageGroupFactory::resolveClass | ( | array | $conf | ) |
Resolve the implementation class from the configuration selector.
Useful for callers that need to inspect the implementation without constructing the group (e.g. schema validation, aggregate detection).
| array | $conf | Parsed group configuration. |
| InvalidArgumentException | on invalid or unknown selector. |
Definition at line 57 of file MessageGroupFactory.php.