Total Complexity | 6 |
Total Lines | 79 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 3 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
19 | trait SplTypeTrait |
||
20 | { |
||
21 | /** |
||
22 | * Internal enum value. |
||
23 | * |
||
24 | * @var mixed |
||
25 | */ |
||
26 | // phpcs:ignore PSR2.Classes.PropertyDeclaration.Underscore |
||
27 | protected $__default; |
||
28 | |||
29 | /** |
||
30 | * Specify data which should be serialized to JSON. |
||
31 | * |
||
32 | * @return mixed |
||
33 | */ |
||
34 | 5 | public function jsonSerialize() |
|
35 | { |
||
36 | 5 | return $this->__default; |
|
37 | } |
||
38 | |||
39 | /** |
||
40 | * Serialize object. |
||
41 | * |
||
42 | * @return array<string,mixed> |
||
43 | */ |
||
44 | 5 | final public function __serialize(): array |
|
45 | { |
||
46 | 5 | return [ |
|
47 | 5 | '__default' => $this->__default, |
|
48 | 5 | ]; |
|
49 | } |
||
50 | |||
51 | /** |
||
52 | * Unserialize object. |
||
53 | * |
||
54 | * @param array<string,mixed> $data |
||
55 | * @return void |
||
56 | */ |
||
57 | 5 | final public function __unserialize(array $data): void |
|
58 | { |
||
59 | 5 | $this->__default = $data['__default']; |
|
60 | } |
||
61 | |||
62 | /** |
||
63 | * Stringify object. |
||
64 | * |
||
65 | * @return string |
||
66 | */ |
||
67 | 1 | final public function __toString(): string |
|
68 | { |
||
69 | 1 | return (string) $this->__default; |
|
70 | } |
||
71 | |||
72 | /** |
||
73 | * Export object. |
||
74 | * |
||
75 | * @param array<mixed,mixed> $properties |
||
76 | * |
||
77 | * @return SplType |
||
78 | * |
||
79 | * @codeCoverageIgnore |
||
80 | * @psalm-suppress UnsafeInstantiation |
||
81 | */ |
||
82 | final public static function __set_state(array $properties): object |
||
85 | } |
||
86 | |||
87 | /** |
||
88 | * Dumping object. |
||
89 | * |
||
90 | * @return array<string,mixed> |
||
91 | * |
||
92 | * @codeCoverageIgnore |
||
93 | */ |
||
94 | final public function __debugInfo(): array |
||
98 | ]; |
||
99 | } |
||
100 | } |
||
101 |