ConnectionTypeRegistry
in package
FinalYes
All connection types known to the code, indexed by their code.
Table of Contents
Properties
- $types : array<string, ConnectionTypeInterface>
Methods
- __construct() : mixed
- all() : array<string, ConnectionTypeInterface>
- get() : ConnectionTypeInterface|null
- Null for a row whose type the code does not know (installed by a newer/removed extension).
- normalize() : array<string, scalar|null>
- Keeps only the values the type declares, cast to their kind. Unknown keys are dropped, so a stored JSON can never smuggle an undeclared value to a consumer.
Properties
$types
private
array<string, ConnectionTypeInterface>
$types
= []
Methods
__construct()
public
__construct(array<int, ConnectionTypeInterface> $types) : mixed
Parameters
- $types : array<int, ConnectionTypeInterface>
all()
public
all() : array<string, ConnectionTypeInterface>
Return values
array<string, ConnectionTypeInterface>get()
Null for a row whose type the code does not know (installed by a newer/removed extension).
public
get(string $code) : ConnectionTypeInterface|null
Parameters
- $code : string
Return values
ConnectionTypeInterface|nullnormalize()
Keeps only the values the type declares, cast to their kind. Unknown keys are dropped, so a stored JSON can never smuggle an undeclared value to a consumer.
public
normalize(ConnectionTypeInterface $type, array<string|int, mixed> $values) : array<string, scalar|null>
Parameters
- $type : ConnectionTypeInterface
- $values : array<string|int, mixed>