File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 2828 "require-dev" : {
2929 "phpunit/phpunit" : " ^9.5" ,
3030 "squizlabs/php_codesniffer" : " 1.*" ,
31- "vimeo/psalm" : " ^4.5.1 "
31+ "vimeo/psalm" : " ^4.6.2 "
3232 }
3333}
Original file line number Diff line number Diff line change @@ -69,15 +69,25 @@ public function __construct($value)
6969 $ value = $ value ->getValue ();
7070 }
7171
72+ /** @psalm-suppress ImplicitToStringCast assertValidValueReturningKey returns always a string but psalm has currently an issue here */
7273 $ this ->key = static ::assertValidValueReturningKey ($ value );
7374
7475 /** @psalm-var T */
7576 $ this ->value = $ value ;
7677 }
7778
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+ */
7883 public function __wakeup ()
7984 {
85+ /** @psalm-suppress DocblockTypeContradiction key can be null when deserializing an enum without the key */
8086 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+ */
8191 $ this ->key = static ::search ($ this ->value );
8292 }
8393 }
@@ -215,6 +225,7 @@ public static function isValid($value)
215225 *
216226 * @psalm-pure
217227 * @psalm-assert T $value
228+ * @param mixed $value
218229 */
219230 public static function assertValidValue ($ value ): void
220231 {
@@ -226,6 +237,8 @@ public static function assertValidValue($value): void
226237 *
227238 * @psalm-pure
228239 * @psalm-assert T $value
240+ * @param mixed $value
241+ * @return string
229242 */
230243 private static function assertValidValueReturningKey ($ value ): string
231244 {
You can’t perform that action at this time.
0 commit comments