• Full name: \App\Shared\Services\Registry
  • This class is marked as final and can't be subclassed
  • This class implements: ContainerInterface
  • This class is a Final class

Properties

container

protected array $container

Methods

prop

Retrieves a sub-key from the registry.

public prop(string $object, bool $key = false, mixed|null $default = null): mixed

Parameters:

Parameter Type Description
$object string name of an object to retrieve a key from.
$key bool (optional) key to retrieve from the object.
$default mixed|null (optional) default value for missing objects or keys.

Throws:


get

public get(string $id): mixed

Parameters:

Parameter Type Description
$id string

has

public has(string $id): bool

Parameters:

Parameter Type Description
$id string

set

Sets a registry parameter.

public set(string $id, mixed $value): void

If a registry parameter with the name already exists the value will be overridden.

Parameters:

Parameter Type Description
$id string A registry parameter name.
$value mixed A registry parameter value

add

Sets an array of registry parameters.

public add(array $parameters = []): void

If an existing registry parameter name matches any of the keys in the supplied array, the associated value will be overridden.

Parameters:

Parameter Type Description
$parameters array An associative array of registry parameters and their associated values.

getAll

Retrieves all configuration parameters.

public getAll(): array

Return Value:

An associative array of configuration parameters.


clear

Clears all current container parameters.

public clear(): void