Total Complexity | 2 |
Total Lines | 28 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | final class TypeRestriction |
||
16 | { |
||
17 | /** |
||
18 | * @param mixed[]|mixed $value |
||
19 | * |
||
20 | * @return mixed[] |
||
21 | * |
||
22 | * @psalm-template ArrayishParameterType of array |
||
23 | * @psalm-param ArrayishParameterType|mixed $value |
||
24 | * @psalm-return ArrayishParameterType |
||
25 | */ |
||
26 | public static function array($value) : array |
||
27 | { |
||
28 | assert(is_array($value)); |
||
29 | |||
30 | return $value; |
||
31 | } |
||
32 | |||
33 | /** |
||
34 | * @psalm-template ObjectishParameterType of object |
||
35 | * @psalm-param ObjectishParameterType|null $value |
||
36 | * @psalm-return ObjectishParameterType |
||
37 | */ |
||
38 | public static function object(?object $value) : object |
||
43 | } |
||
44 | } |
||
45 |