File tree 2 files changed +13
-1
lines changed
2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 28
28
"require-dev" : {
29
29
"phpunit/phpunit" : " ^9.5" ,
30
30
"squizlabs/php_codesniffer" : " 1.*" ,
31
- "vimeo/psalm" : " ^4.5.1 "
31
+ "vimeo/psalm" : " ^4.6.2 "
32
32
}
33
33
}
Original file line number Diff line number Diff line change @@ -69,15 +69,24 @@ public function __construct($value)
69
69
$ value = $ value ->getValue ();
70
70
}
71
71
72
+ /** @psalm-suppress ImplicitToStringCast assertValidValueReturningKey returns always a string but psalm has currently an issue here */
72
73
$ this ->key = static ::assertValidValueReturningKey ($ value );
73
74
74
75
/** @psalm-var T */
75
76
$ this ->value = $ value ;
76
77
}
77
78
79
+ /**
80
+ * This method exists only for the compatibility reason when deserializing a previously serialized version that didn't had the key property
81
+ */
78
82
public function __wakeup ()
79
83
{
84
+ /** @psalm-suppress DocblockTypeContradiction key can be null when deserializing a serialized enum without the key property */
80
85
if ($ this ->key === null ) {
86
+ /**
87
+ * @psalm-suppress InaccessibleProperty key is not readonly as marked by psalm
88
+ * @psalm-suppress PossiblyFalsePropertyAssignmentValue key might be false deserializing a case that was removed
89
+ */
81
90
$ this ->key = static ::search ($ this ->value );
82
91
}
83
92
}
@@ -215,6 +224,7 @@ public static function isValid($value)
215
224
*
216
225
* @psalm-pure
217
226
* @psalm-assert T $value
227
+ * @param mixed $value
218
228
*/
219
229
public static function assertValidValue ($ value ): void
220
230
{
@@ -226,6 +236,8 @@ public static function assertValidValue($value): void
226
236
*
227
237
* @psalm-pure
228
238
* @psalm-assert T $value
239
+ * @param mixed $value
240
+ * @return string
229
241
*/
230
242
private static function assertValidValueReturningKey ($ value ): string
231
243
{
You can’t perform that action at this time.
0 commit comments