Skip to content

Commit 6707446

Browse files
authored
Merge pull request #168 from rogervila/psalm-5
Upgrade to Psalm 5
2 parents 43db94c + f9a24be commit 6707446

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@
3131
"require-dev": {
3232
"phpunit/phpunit": "^9.5",
3333
"squizlabs/php_codesniffer": "1.*",
34-
"vimeo/psalm": "^4.6.2"
34+
"vimeo/psalm": "^4.6.2 || ^5.2"
3535
}
3636
}

src/Enum.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ public static function values()
176176

177177
/** @psalm-var T $value */
178178
foreach (static::toArray() as $key => $value) {
179+
/** @psalm-suppress UnsafeGenericInstantiation */
179180
$values[$key] = new static($value);
180181
}
181182

@@ -297,6 +298,7 @@ public static function __callStatic($name, $arguments)
297298
$message = "No static method or enum constant '$name' in class " . static::class;
298299
throw new \BadMethodCallException($message);
299300
}
301+
/** @psalm-suppress UnsafeGenericInstantiation */
300302
return self::$instances[$class][$name] = new static($array[$name]);
301303
}
302304
return clone self::$instances[$class][$name];
@@ -308,7 +310,6 @@ public static function __callStatic($name, $arguments)
308310
*
309311
* @return mixed
310312
* @link http://php.net/manual/en/jsonserializable.jsonserialize.php
311-
* @psalm-pure
312313
*/
313314
#[\ReturnTypeWillChange]
314315
public function jsonSerialize()

0 commit comments

Comments
 (0)