class AbstractValueMultiton extends AbstractMultiton implements ValueMultitonInterface

Abstract base class for Java-style enumerations with a value.

Methods

static  AbstractMultiton
memberByKey( string $key, boolean|null $isCaseSensitive = null)

Returns a single member by string key.

static  AbstractMultiton
memberByKeyWithDefault( string $key, MultitonInterface $default = null, boolean|null $isCaseSensitive = null)

Returns a single member by string key. Additionally returns a default if no associated member is found.

static  AbstractMultiton|null
memberOrNullByKey( string|null $key, boolean|null $isCaseSensitive = null)

Returns a single member by string key. Additionally returns null if the supplied key is null.

static  AbstractMultiton
memberBy( string $property, mixed $value, boolean|null $isCaseSensitive = null)

Returns a single member by comparison with the result of an accessor method.

static  AbstractMultiton|null
memberByWithDefault( string $property, mixed $value, MultitonInterface $default = null, boolean|null $isCaseSensitive = null)

Returns a single member by comparison with the result of an accessor method. Additionally returns a default if no associated member is found.

static  AbstractMultiton|null
memberOrNullBy( string $property, mixed $value, boolean|null $isCaseSensitive = null)

Returns a single member by comparison with the result of an accessor method. Additionally returns null if the supplied value is null.

static  AbstractMultiton
memberByPredicate( callable $predicate)

Returns a single member by predicate callback.

static  AbstractMultiton
memberByPredicateWithDefault( callable $predicate, MultitonInterface $default = null)

Returns a single member by predicate callback. Additionally returns a default if no associated member is found.

static  array<string,static>
members()

Returns an array of all members in this multiton.

static  array<string,static>
membersBy( string $property, mixed $value, boolean|null $isCaseSensitive = null)

Returns a set of members by comparison with the result of an accessor method.

static  array<string,static>
membersByPredicate( callable $predicate)

Returns a set of members by predicate callback.

static  AbstractMultiton
__callStatic( string $key, array $arguments)

Maps static method calls to members.

string
key()

Returns the string key of this member.

boolean
anyOf( MultitonInterface $a, MultitonInterface $b)

Check if this member is in the specified list of members.

boolean
anyOfArray( array $values)

Check if this member is in the specified list of members.

string
__toString()

Returns a string representation of this member.

memberByValue( mixed $value, boolean|null $isCaseSensitive = null)

Returns a single member by value.

memberByValueWithDefault( mixed $value, ValueMultitonInterface $default = null, boolean|null $isCaseSensitive = null)

Returns a single member by value. Additionally returns a default if no associated member is found.

static  AbstractValueMultiton|null
memberOrNullByValue( mixed|null $value, boolean|null $isCaseSensitive = null)

Returns a single member by value. Additionally returns null if the supplied value is null.

static  array<string,static>
membersByValue( mixed $value, boolean|null $isCaseSensitive = null)

Returns a set of members matching the supplied value.

mixed
value()

Returns the value of this member.

Details

in AbstractMultiton at line 38
final static AbstractMultiton memberByKey( string $key, boolean|null $isCaseSensitive = null)

Returns a single member by string key.

Parameters

string $key The string key associated with the member.
boolean|null $isCaseSensitive True if the search should be case sensitive.

Return Value

AbstractMultiton The member associated with the given string key.

Exceptions

UndefinedMemberExceptionInterface If no associated member is found.

in AbstractMultiton at line 55
final static AbstractMultiton memberByKeyWithDefault( string $key, MultitonInterface $default = null, boolean|null $isCaseSensitive = null)

Returns a single member by string key. Additionally returns a default if no associated member is found.

Parameters

string $key The string key associated with the member.
MultitonInterface $default The default value to return.
boolean|null $isCaseSensitive True if the search should be case sensitive.

Return Value

AbstractMultiton The member associated with the given string key, or the default value.

in AbstractMultiton at line 80
final static AbstractMultiton|null memberOrNullByKey( string|null $key, boolean|null $isCaseSensitive = null)

Returns a single member by string key. Additionally returns null if the supplied key is null.

Parameters

string|null $key The string key associated with the member, or null.
boolean|null $isCaseSensitive True if the search should be case sensitive.

Return Value

AbstractMultiton|null The member associated with the given string key, or null if the supplied key is null.

Exceptions

UndefinedMemberExceptionInterface If no associated member is found.

in AbstractMultiton at line 100
final static AbstractMultiton memberBy( string $property, mixed $value, boolean|null $isCaseSensitive = null)

Returns a single member by comparison with the result of an accessor method.

Parameters

string $property The name of the property (accessor method) to match.
mixed $value The value to match.
boolean|null $isCaseSensitive True if the search should be case sensitive.

Return Value

AbstractMultiton The first member for which $member->{$property}() === $value.

Exceptions

UndefinedMemberExceptionInterface If no associated member is found.

in AbstractMultiton at line 136
final static AbstractMultiton|null memberByWithDefault( string $property, mixed $value, MultitonInterface $default = null, boolean|null $isCaseSensitive = null)

Returns a single member by comparison with the result of an accessor method. Additionally returns a default if no associated member is found.

Parameters

string $property The name of the property (accessor method) to match.
mixed $value The value to match.
MultitonInterface $default The default value to return.
boolean|null $isCaseSensitive True if the search should be case sensitive.

Return Value

AbstractMultiton|null The first member for which $member->{$property}() === $value, or the default value.

in AbstractMultiton at line 181
final static AbstractMultiton|null memberOrNullBy( string $property, mixed $value, boolean|null $isCaseSensitive = null)

Returns a single member by comparison with the result of an accessor method. Additionally returns null if the supplied value is null.

Parameters

string $property The name of the property (accessor method) to match.
mixed $value The value to match, or null.
boolean|null $isCaseSensitive True if the search should be case sensitive.

Return Value

AbstractMultiton|null The first member for which $member->{$property}() === $value, or null if the supplied value is null.

Exceptions

UndefinedMemberExceptionInterface If no associated member is found.

in AbstractMultiton at line 217
final static AbstractMultiton memberByPredicate( callable $predicate)

Returns a single member by predicate callback.

Parameters

callable $predicate The predicate applies to the member to find a match.

Return Value

AbstractMultiton The first member for which $predicate($member) evaluates to boolean true.

Exceptions

UndefinedMemberExceptionInterface If no associated member is found.

in AbstractMultiton at line 243
final static AbstractMultiton memberByPredicateWithDefault( callable $predicate, MultitonInterface $default = null)

Returns a single member by predicate callback. Additionally returns a default if no associated member is found.

Parameters

callable $predicate The predicate applied to the member to find a match.
MultitonInterface $default The default value to return.

Return Value

AbstractMultiton The first member for which $predicate($member) evaluates to boolean true, or the default value.

in AbstractMultiton at line 263
final static array<string,static> members()

Returns an array of all members in this multiton.

Return Value

array<string,static> All members.

in AbstractMultiton at line 287
final static array<string,static> membersBy( string $property, mixed $value, boolean|null $isCaseSensitive = null)

Returns a set of members by comparison with the result of an accessor method.

Parameters

string $property The name of the property (accessor method) to match.
mixed $value The value to match.
boolean|null $isCaseSensitive True if the search should be case sensitive.

Return Value

array<string,static> All members for which $member->{$property}() === $value.

in AbstractMultiton at line 326
final static array<string,static> membersByPredicate( callable $predicate)

Returns a set of members by predicate callback.

Parameters

callable $predicate The predicate applied to the members to find matches.

Return Value

array<string,static> All members for which $predicate($member) evaluates to boolean true.

in AbstractMultiton at line 350
final static AbstractMultiton __callStatic( string $key, array $arguments)

Maps static method calls to members.

Parameters

string $key The string key associated with the member.
array $arguments Ignored.

Return Value

AbstractMultiton The member associated with the given string key.

Exceptions

UndefinedMemberExceptionInterface If no associated member is found.

in AbstractMultiton at line 362
final string key()

Returns the string key of this member.

Return Value

string The associated string key of this member.

in AbstractMultiton at line 378
final boolean anyOf( MultitonInterface $a, MultitonInterface $b)

Check if this member is in the specified list of members.

Parameters

MultitonInterface $a
MultitonInterface $b

Return Value

boolean True if this member is in the specified list of members.

in AbstractMultiton at line 392
final boolean anyOfArray( array $values)

Check if this member is in the specified list of members.

Parameters

array $values An array of members to search.

Return Value

boolean True if this member is in the specified list of members.

in AbstractMultiton at line 406
string __toString()

Returns a string representation of this member.

Return Value

string

at line 36
final static AbstractValueMultiton memberByValue( mixed $value, boolean|null $isCaseSensitive = null)

Returns a single member by value.

Parameters

mixed $value The value associated with the member.
boolean|null $isCaseSensitive True if the search should be case sensitive.

Return Value

AbstractValueMultiton The first member with the supplied value.

Exceptions

UndefinedMemberExceptionInterface If no associated member is found.

at line 53
final static AbstractValueMultiton memberByValueWithDefault( mixed $value, ValueMultitonInterface $default = null, boolean|null $isCaseSensitive = null)

Returns a single member by value. Additionally returns a default if no associated member is found.

Parameters

mixed $value The value associated with the member.
ValueMultitonInterface $default The default value to return.
boolean|null $isCaseSensitive True if the search should be case sensitive.

Return Value

AbstractValueMultiton The first member with the supplied value, or the default value.

at line 78
final static AbstractValueMultiton|null memberOrNullByValue( mixed|null $value, boolean|null $isCaseSensitive = null)

Returns a single member by value. Additionally returns null if the supplied value is null.

Parameters

mixed|null $value The value associated with the member, or null.
boolean|null $isCaseSensitive True if the search should be case sensitive.

Return Value

AbstractValueMultiton|null The first member with the supplied value, or null if the supplied value is null.

Exceptions

UndefinedMemberExceptionInterface If no associated member is found.

at line 95
final static array<string,static> membersByValue( mixed $value, boolean|null $isCaseSensitive = null)

Returns a set of members matching the supplied value.

Parameters

mixed $value The value associated with the members.
boolean|null $isCaseSensitive True if the search should be case sensitive.

Return Value

array<string,static> All members with the supplied value.

at line 107
final mixed value()

Returns the value of this member.

Return Value

mixed The value of this member.