File tree 2 files changed +14
-1
lines changed
2 files changed +14
-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,25 @@ 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
81
+ * that didn't had the key property
82
+ */
78
83
public function __wakeup ()
79
84
{
85
+ /** @psalm-suppress DocblockTypeContradiction key can be null when deserializing an enum without the key */
80
86
if ($ this ->key === null ) {
87
+ /**
88
+ * @psalm-suppress InaccessibleProperty key is not readonly as marked by psalm
89
+ * @psalm-suppress PossiblyFalsePropertyAssignmentValue deserializing a case that was removed
90
+ */
81
91
$ this ->key = static ::search ($ this ->value );
82
92
}
83
93
}
@@ -215,6 +225,7 @@ public static function isValid($value)
215
225
*
216
226
* @psalm-pure
217
227
* @psalm-assert T $value
228
+ * @param mixed $value
218
229
*/
219
230
public static function assertValidValue ($ value ): void
220
231
{
@@ -226,6 +237,8 @@ public static function assertValidValue($value): void
226
237
*
227
238
* @psalm-pure
228
239
* @psalm-assert T $value
240
+ * @param mixed $value
241
+ * @return string
229
242
*/
230
243
private static function assertValidValueReturningKey ($ value ): string
231
244
{
You can’t perform that action at this time.
0 commit comments