1 | <?php |
||
27 | abstract class Enum |
||
28 | { |
||
29 | |||
30 | /** |
||
31 | * Class constants from reflection |
||
32 | * @var null |
||
33 | */ |
||
34 | private static $constCacheArray = null; |
||
35 | |||
36 | /** |
||
37 | * Enum constructor. |
||
38 | * Private to prevent instantiation |
||
39 | */ |
||
40 | private function __construct() |
||
43 | |||
44 | /** |
||
45 | * Is this name valid?, accepts string |
||
46 | * @param $name string |
||
47 | * @param bool|FALSE $strict |
||
48 | * @return bool |
||
49 | */ |
||
50 | 1 | public static function isValidName($name, $strict = false) |
|
62 | |||
63 | /** |
||
64 | * get internal functions |
||
65 | * @return mixed |
||
66 | */ |
||
67 | 3 | private static function getConstants() |
|
80 | |||
81 | /** |
||
82 | * Is the value valid for our enum, accepts int |
||
83 | * @param $value |
||
84 | * @return bool |
||
85 | */ |
||
86 | 1 | public static function isValidValue($value) |
|
92 | |||
93 | /** |
||
94 | * Get the enum member name as a string from the value |
||
95 | * @param $value |
||
96 | * @return mixed |
||
97 | */ |
||
98 | 1 | public static function getName($value) |
|
102 | } |
||
103 | |||
105 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..