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

Properties

data

Holds the registry data

private static array $data
  • This property is static.

Methods

prop

Retrieves a sub-key from the registry.

public static prop(string $object, string|bool $key = false, mixed|null $default = null): mixed|null
  • This method is static. Parameters:
Parameter Type Description
$object string Name of an object to retrieve a key from.
$key string|bool (Optional) key to retrieve from the object.
$default mixed|null (Optional) default value for missing objects or keys.

get

Retrieves a key from the registry.

public static get(string $key, mixed|null $default = null): mixed|null
  • This method is static. Parameters:
Parameter Type Description
$key string Name of the key to retrieve
$default mixed|null (Optional) fallback value for missing keys.

Return Value:

Key value if found, fallback if given, or null otherwise.


set

Sets a value to the registry.

public static set(string $key, mixed $value): void
  • This method is static. Parameters:
Parameter Type Description
$key string Name of the key to set.
$value mixed Value to set.

has

Checks whether the registry has a key.

public static has(string $key): bool
  • This method is static. Parameters:
Parameter Type Description
$key string Name of the key to check for.