AbstractStaticContainer
namespace |
bhenk\doc2rst\globals |
predicates |
Abstract |
implements |
|
known subclasses |
Base class for static container classes that load their values from an Array
Implementations of this abstract static container use a UnitEnum to correlate their properties to keys in the array in a way that
property name == enum->name == key
method name == [get|set] + camelcase(property name)
@inheritdoc
Describes the interface of a container that exposes methods to read its entries
@inheritdoc from interface ContainerInterface
Methods
AbstractStaticContainer::enumForName
predicates |
public | static | abstract |
Returns the enum case for the given $id or null if it does not exist
public static abstract function enumForName(
Parameter #0 [ <required> string $id ]
): ?UnitEnum
AbstractStaticContainer::get
predicates |
public |
implements |
@inheritdoc
Finds an entry of the container by its identifier and returns it
@inheritdoc from method ContainerInterface::get
public function get(
Parameter #0 [ <required> string $id ]
): mixed
AbstractStaticContainer::has
predicates |
public |
implements |
@inheritdoc
Returns true if the container can return an entry for the given identifier
Returns false otherwise.
has($id) returning true does not mean that get($id) will not throw an exception. It does however mean that get($id) will not throw a NotFoundExceptionInterface.
@inheritdoc from method ContainerInterface::has
public function has(
Parameter #0 [ <required> string $id ]
): bool
AbstractStaticContainer::__toString
predicates |
public |
implements |
Returns a string representation of this container
public function __toString(): string
AbstractStaticContainer::load
predicates |
public | static |
Load the container with the given configuration
Keys in the array configuration should correspond to the names of cases in the UnitEnum given by AbstractStaticContainer::enumForName.
public static function load(
Parameter #0 [ <required> array $configuration ]
): void
AbstractStaticContainer::toArray
predicates |
public | static |
Returns an array representing the container
public static function toArray(): array
AbstractStaticContainer::reset
predicates |
public | static |
Reset the container to a neutral state (not necessarily to its original state)
public static function reset(): array
AbstractStaticContainer::getMethodName
predicates |
public | static |
Return the method name part corresponding to the given $id
Input of snake_like_name, output CamelCaseName:
foo_bar_name -> FooBarName
public static function getMethodName(
Parameter #0 [ <required> string $id ]
): string
Fri, 31 Mar 2023 13:22:46 +0000