Copied!
Cloneable Instantiable
Methods
public static MyCLabs\Enum\Enum :: __callStatic ( $name , $arguments )
 

Returns a value when called statically like so: MyEnum::SOME_VALUE() given SOME_VALUE is a class constant

  • return static
  • throws BadMethodCallException
  • psalm-pure
public MyCLabs\Enum\Enum :: __construct ( $value )
 

Creates a new value of some type

  • psalm-pure
  • psalm-param T $value
  • throws UnexpectedValueException if incompatible type is given.
public MyCLabs\Enum\Enum :: __toString () : string
 
  • psalm-pure
  • psalm-suppress InvalidCast
  • return string
public MyCLabs\Enum\Enum :: __wakeup ()
public static MyCLabs\Enum\Enum :: assertValidValue ( $value ) : void
 

Asserts valid enum value

  • psalm-pure
  • psalm-assert T $value
public final MyCLabs\Enum\Enum :: equals ( $variable = NULL ) : bool
 

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 bool
public static MyCLabs\Enum\Enum :: from ( $value ) : self
 
  • return static
  • psalm-return static
public MyCLabs\Enum\Enum :: getKey ()
 

Returns the enum key (i.e. the constant name).

  • psalm-pure
  • return string
public MyCLabs\Enum\Enum :: getValue ()
 
  • psalm-pure
  • return mixed
  • psalm-return T
public static MyCLabs\Enum\Enum :: isValid ( $value )
 

Check if is valid enum value

  • psalm-param mixed $value
  • psalm-pure
  • psalm-assert-if-true T $value
  • return bool
public static MyCLabs\Enum\Enum :: isValidKey ( $key )
 

Check if is valid enum key

  • psalm-param string $key
  • psalm-pure
  • return bool
public MyCLabs\Enum\Enum :: jsonSerialize ()
 

Specify data which should be serialized to JSON. This method returns data that can be serialized by json_encode()
natively.

public static MyCLabs\Enum\Enum :: keys ()
 

Returns the names (keys) of all constants in the Enum class

  • psalm-pure
  • psalm-return list
  • return array
public static MyCLabs\Enum\Enum :: search ( $value )
 

Return key for value

  • psalm-param mixed $value
  • psalm-pure
  • return string | false
public static MyCLabs\Enum\Enum :: toArray ()
 

Returns all possible values as an array

  • psalm-pure
  • psalm-suppress ImpureStaticProperty
  • psalm-return array
  • return array Constant name in key, constant value in value
public static MyCLabs\Enum\Enum :: values ()
 

Returns instances of the Enum class of all Enum constants

  • psalm-pure
  • psalm-return array
  • return static [] Constant name in key, Enum instance in value
Properties
protected static MyCLabs\Enum\Enum :: $cache
 

Store existing constants in a static cache per object.

  • var array
  • psalm-var array>
protected static MyCLabs\Enum\Enum :: $instances
 

Cache of instances of the Enum class

  • var array
  • psalm-var array>
protected MyCLabs\Enum\Enum :: $value
 

Enum value

  • var mixed
  • psalm-var T
Constants
private PHPHtmlParser\Enum\StringToken ::ATTR = ' >'
private PHPHtmlParser\Enum\StringToken ::BLANK = ' '
private PHPHtmlParser\Enum\StringToken ::CLOSECOMMENT = '-->'
private PHPHtmlParser\Enum\StringToken ::EQUAL = ' =/>'
private PHPHtmlParser\Enum\StringToken ::SLASH = ' /> '
Properties
protected static MyCLabs\Enum\Enum :: $cache
 

Store existing constants in a static cache per object.

  • var array
  • psalm-var array>
protected static MyCLabs\Enum\Enum :: $instances
 

Cache of instances of the Enum class

  • var array
  • psalm-var array>
Methods
public static MyCLabs\Enum\Enum :: __callStatic ( $name , $arguments )
 

Returns a value when called statically like so: MyEnum::SOME_VALUE() given SOME_VALUE is a class constant

  • return static
  • throws BadMethodCallException
  • psalm-pure
public static MyCLabs\Enum\Enum :: assertValidValue ( $value ) : void
 

Asserts valid enum value

  • psalm-pure
  • psalm-assert T $value
public static MyCLabs\Enum\Enum :: from ( $value ) : self
 
  • return static
  • psalm-return static
public static MyCLabs\Enum\Enum :: isValid ( $value )
 

Check if is valid enum value

  • psalm-param mixed $value
  • psalm-pure
  • psalm-assert-if-true T $value
  • return bool
public static MyCLabs\Enum\Enum :: isValidKey ( $key )
 

Check if is valid enum key

  • psalm-param string $key
  • psalm-pure
  • return bool
public static MyCLabs\Enum\Enum :: keys ()
 

Returns the names (keys) of all constants in the Enum class

  • psalm-pure
  • psalm-return list
  • return array
public static MyCLabs\Enum\Enum :: search ( $value )
 

Return key for value

  • psalm-param mixed $value
  • psalm-pure
  • return string | false
public static MyCLabs\Enum\Enum :: toArray ()
 

Returns all possible values as an array

  • psalm-pure
  • psalm-suppress ImpureStaticProperty
  • psalm-return array
  • return array Constant name in key, constant value in value
public static MyCLabs\Enum\Enum :: values ()
 

Returns instances of the Enum class of all Enum constants

  • psalm-pure
  • psalm-return array
  • return static [] Constant name in key, Enum instance in value
© 2021 Bruce Wells
Search Namespaces \ Classes
Configuration