ParameterHandlerRegistry
in package
FinalYes
Maps the int `$type` to its {@see AbstractParameterHandler}.
Handlers are stateless (no dependencies), so the registry can be shared statically through
self::shared() (presenter traits, display, filters) or created fresh through
self::createDefault() (ParameterForm, whose child may add module handlers without
affecting the shared instance).
Table of Contents
Properties
- $byType : array<int, AbstractParameterHandler>
- $shared : self|null
Methods
- createDefault() : self
- Creates a fresh registry with the default handler set (covers all `ParameterType` constants).
- get() : AbstractParameterHandler|null
- has() : bool
- register() : self
- require() : AbstractParameterHandler
- shared() : self
- Returns the shared instance with the default handler set (lazy singleton).
Properties
$byType
private
array<int, AbstractParameterHandler>
$byType
= []
$shared
private
static self|null
$shared
= null
Methods
createDefault()
Creates a fresh registry with the default handler set (covers all `ParameterType` constants).
public
static createDefault() : self
Return values
selfget()
public
get(int $type) : AbstractParameterHandler|null
Parameters
- $type : int
Return values
AbstractParameterHandler|nullhas()
public
has(int $type) : bool
Parameters
- $type : int
Return values
boolregister()
public
register(AbstractParameterHandler $handler) : self
Parameters
- $handler : AbstractParameterHandler
Return values
selfrequire()
public
require(int $type) : AbstractParameterHandler
Parameters
- $type : int
Return values
AbstractParameterHandlershared()
Returns the shared instance with the default handler set (lazy singleton).
public
static shared() : self
Use it where no ParameterForm is at hand: specification display, building filters from the URL.