Documentation

EnumReflectionProperty extends ReflectionProperty
in package

PHP Enum Reflection Property - special override for backed enums.

Table of Contents

Properties

$enumType  : BackedEnum>
$originalReflectionProperty  : ReflectionProperty

Methods

__construct()  : mixed
getValue()  : int|string|array<string|int, int>|array<string|int, string>|null
{@inheritDoc}
setValue()  : void
Converts enum value to enum instance.
fromEnum()  : mixed
toEnum()  : mixed

Properties

Methods

__construct()

public __construct(ReflectionProperty $originalReflectionProperty, BackedEnum> $enumType) : mixed
Parameters
$originalReflectionProperty : ReflectionProperty
$enumType : BackedEnum>

getValue()

{@inheritDoc}

public getValue([object|null $object = null ]) : int|string|array<string|int, int>|array<string|int, string>|null

Converts enum instance to its value.

Parameters
$object : object|null = null
Return values
int|string|array<string|int, int>|array<string|int, string>|null

setValue()

Converts enum value to enum instance.

public setValue(object $object[, mixed $value = null ]) : void
Parameters
$object : object
$value : mixed = null

fromEnum()

private fromEnum(BackedEnum|array<string|int, BackedEnum$enum) : mixed
Parameters
$enum : BackedEnum|array<string|int, BackedEnum>

toEnum()

private toEnum(int|string|array<string|int, int>|array<string|int, string> $value) : mixed
Parameters
$value : int|string|array<string|int, int>|array<string|int, string>

        
On this page

Search results