-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
SplEnumBacked.php
45 lines (40 loc) · 1021 Bytes
/
SplEnumBacked.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
/**
* Part of SplTypes package.
*
* (c) Adrien Loyant <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Ducks\Component\SplTypes;
/**
* SplEnumBacked gives the ability to emulate and create backed enumeration objects natively in PHP.
*
* @property mixed $value
*
* @template T
* @extends SplEnumUnit<T>
* @implements SplBackedEnum<T>
*
* @psalm-api
*/
#[\AllowDynamicProperties]
abstract class SplEnumBacked extends SplEnumUnit implements SplBackedEnum
{
/** @use SplBackedEnumTrait<T> */
use SplBackedEnumTrait;
/** @use SplEnumBackedTrait<T> */
use SplEnumBackedTrait;
/**
* {@inheritdoc}
*
* @psalm-suppress UnsupportedPropertyReferenceUsage
*/
protected function __construct()
{
// Value can be undeclare because typed definition can change.
$this->value = &$this->__default;
}
}