LocalizationHandlerRegistry
Registry for localization handlers
Manages all available localization handlers and provides methods to retrieve them by identifier or get all available handlers
Table of Contents
Methods
- __construct() : mixed
- getAvailableHandlers() : array<string, LocalizationHandlerInterface>
- Get available handlers for the given localization context
- getHandler() : LocalizationHandlerInterface
- Get a handler by its identifier
- hasHandler() : bool
- Check if a handler with the given identifier exists
Methods
__construct()
public
__construct(iterable<string|int, LocalizationHandlerInterface> $handlers) : mixed
Parameters
- $handlers : iterable<string|int, LocalizationHandlerInterface>
getAvailableHandlers()
Get available handlers for the given localization context
public
getAvailableHandlers(LocalizationInstructions $instructions) : array<string, LocalizationHandlerInterface>
Filters handlers based on their availability for the specific context.
Parameters
- $instructions : LocalizationInstructions
Return values
array<string, LocalizationHandlerInterface> —Available handlers indexed by identifier
getHandler()
Get a handler by its identifier
public
getHandler(string $identifier) : LocalizationHandlerInterface
Parameters
- $identifier : string
Tags
Return values
LocalizationHandlerInterfacehasHandler()
Check if a handler with the given identifier exists
public
hasHandler(string $identifier) : bool
Parameters
- $identifier : string