Moodle PHP Documentation 4.3
Moodle 4.3.5 (Build: 20240610) (7dcfaa79f78)
ZipStream\Option\Version Class Reference
Inheritance diagram for ZipStream\Option\Version:
MyCLabs\Enum\Enum

Public Member Functions

 __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 Public Member Functions

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.
 

Public Attributes

const DEFLATE = 0x0014
 
const STORE = 0x000A
 
const ZIP64 = 0x002D
 

Protected Attributes

mixed $value
 Enum value.
 

Static Protected Attributes

static array $cache = []
 Store existing constants in a static cache per object.
 
static array $instances = []
 Cache of instances of the Enum class.
 

Member Function Documentation

◆ __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
static
Exceptions
BadMethodCallException

@psalm-pure

◆ __toString()

MyCLabs\Enum\Enum::__toString ( )
inherited

@psalm-pure @psalm-suppress InvalidCast

Return values
string

◆ assertValidValue()

static MyCLabs\Enum\Enum::assertValidValue ( $value)
staticinherited

Asserts valid enum value.

@psalm-pure @psalm-assert T $value

Parameters
mixed$value

◆ 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
bool

◆ from()

static MyCLabs\Enum\Enum::from ( $value)
staticinherited
Parameters
mixed$value
Return values
static

◆ getKey()

MyCLabs\Enum\Enum::getKey ( )
inherited

Returns the enum key (i.e.

the constant name).

@psalm-pure

Return values
string

◆ getValue()

MyCLabs\Enum\Enum::getValue ( )
inherited

@psalm-pure

Return values
mixed@psalm-return T

◆ 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
bool

◆ isValidKey()

static MyCLabs\Enum\Enum::isValidKey ( $key)
staticinherited

Check if is valid enum key.

Parameters
$key@psalm-param string $key @psalm-pure
Return values
bool

◆ 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
mixed@externalurl http://php.net/manual/en/jsonserializable.jsonserialize.php @psalm-pure

◆ 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
array

◆ search()

static MyCLabs\Enum\Enum::search ( $value)
staticinherited

Return key for value.

Parameters
mixed$value

@psalm-param mixed $value @psalm-pure

Return values
string|false

◆ 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
arrayConstant 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

Member Data Documentation

◆ $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

Enum value.

@psalm-var T


The documentation for this class was generated from the following file: