|
| __toString () |
| @psalm-pure @psalm-suppress InvalidCast
|
|
| __wakeup () |
| This method exists only for the compatibility reason when deserializing a previously serialized version that didn't had the key property.
|
|
| equals ($variable=null) |
| Determines if Enum should be considered equal with the variable passed as a parameter.
|
|
| getKey () |
| Returns the enum key (i.e.
|
|
| getValue () |
| @psalm-pure
|
|
| jsonSerialize () |
| Specify data which should be serialized to JSON.
|
|
|
static | __callStatic ($name, $arguments) |
| Returns a value when called statically like so: MyEnum\SOME_VALUE() given SOME_VALUE is a class constant.
|
|
static | assertValidValue ($value) |
| Asserts valid enum value.
|
|
static | from ($value) |
|
static | isValid ($value) |
| Check if is valid enum value.
|
|
static | isValidKey ($key) |
| Check if is valid enum key.
|
|
static | keys () |
| Returns the names (keys) of all constants in the Enum class.
|
|
static | search ($value) |
| Return key for value.
|
|
static | toArray () |
| Returns all possible values as an array.
|
|
static | values () |
| Returns instances of the Enum class of all Enum constants.
|
|
|
const | DEFLATE = 0x08 |
|
const | STORE = 0x00 |
|
|
static array | $cache = [] |
| Store existing constants in a static cache per object.
|
|
static array | $instances = [] |
| Cache of instances of the Enum class.
|
|
◆ __callStatic()
static MyCLabs\Enum\Enum::__callStatic |
( |
| $name, |
|
|
| $arguments ) |
|
staticinherited |
Returns a value when called statically like so: MyEnum\SOME_VALUE() given SOME_VALUE is a class constant.
- Parameters
-
string | $name | |
array | $arguments | |
- Return values
-
- Exceptions
-
@psalm-pure
◆ __toString()
MyCLabs\Enum\Enum::__toString |
( |
| ) |
|
|
inherited |
@psalm-pure @psalm-suppress InvalidCast
- Return values
-
◆ assertValidValue()
static MyCLabs\Enum\Enum::assertValidValue |
( |
| $value | ) |
|
|
staticinherited |
Asserts valid enum value.
@psalm-pure @psalm-assert T $value
- Parameters
-
◆ equals()
MyCLabs\Enum\Enum::equals |
( |
| $variable = null | ) |
|
|
finalinherited |
Determines if Enum should be considered equal with the variable passed as a parameter.
Returns false if an argument is an object of different class or not an object.
This method is final, for more information read https://github.com/myclabs/php-enum/issues/4
@psalm-pure @psalm-param mixed $variable
- Return values
-
◆ from()
static MyCLabs\Enum\Enum::from |
( |
| $value | ) |
|
|
staticinherited |
◆ getKey()
MyCLabs\Enum\Enum::getKey |
( |
| ) |
|
|
inherited |
Returns the enum key (i.e.
the constant name).
@psalm-pure
- Return values
-
◆ getValue()
MyCLabs\Enum\Enum::getValue |
( |
| ) |
|
|
inherited |
@psalm-pure
- Return values
-
◆ isValid()
static MyCLabs\Enum\Enum::isValid |
( |
| $value | ) |
|
|
staticinherited |
Check if is valid enum value.
- Parameters
-
$value | @psalm-param mixed $value @psalm-pure @psalm-assert-if-true T $value |
- Return values
-
◆ isValidKey()
static MyCLabs\Enum\Enum::isValidKey |
( |
| $key | ) |
|
|
staticinherited |
Check if is valid enum key.
- Parameters
-
$key | @psalm-param string $key @psalm-pure |
- Return values
-
◆ jsonSerialize()
MyCLabs\Enum\Enum::jsonSerialize |
( |
| ) |
|
|
inherited |
Specify data which should be serialized to JSON.
This method returns data that can be serialized by json_encode() natively.
- Return values
-
◆ keys()
static MyCLabs\Enum\Enum::keys |
( |
| ) |
|
|
staticinherited |
Returns the names (keys) of all constants in the Enum class.
@psalm-pure @psalm-return list<string>
- Return values
-
◆ search()
static MyCLabs\Enum\Enum::search |
( |
| $value | ) |
|
|
staticinherited |
Return key for value.
- Parameters
-
@psalm-param mixed $value @psalm-pure
- Return values
-
◆ toArray()
static MyCLabs\Enum\Enum::toArray |
( |
| ) |
|
|
staticinherited |
Returns all possible values as an array.
@psalm-pure @psalm-suppress ImpureStaticProperty
@psalm-return array<string, mixed>
- Return values
-
array | Constant name in key, constant value in value |
◆ values()
static MyCLabs\Enum\Enum::values |
( |
| ) |
|
|
staticinherited |
Returns instances of the Enum class of all Enum constants.
@psalm-pure @psalm-return array<string, static>
- Return values
-
static[] | Constant name in key, Enum instance in value |
◆ $cache
array MyCLabs\Enum\Enum::$cache = [] |
|
staticprotectedinherited |
Store existing constants in a static cache per object.
@psalm-var array<class-string, array<string, mixed>>
◆ $instances
array MyCLabs\Enum\Enum::$instances = [] |
|
staticprotectedinherited |
Cache of instances of the Enum class.
@psalm-var array<class-string, array<string, static>>
◆ $value
mixed MyCLabs\Enum\Enum::$value |
|
protectedinherited |
The documentation for this class was generated from the following file:
- lib/zipstream/src/Option/Method.php