Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b0bd8e2

Browse files
committedAug 24, 2021
Bump psalm to v4.9.2
- Lock to v4.9 otherwise it bumps automatically, finds new issues and builds start failing without any change in this lib - fix some psalm issues - enable `findUnusedPsalmSuppress`
1 parent 8bb24a0 commit b0bd8e2

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed
 

‎composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@
2828
"require-dev": {
2929
"phpunit/phpunit": "^9.5",
3030
"squizlabs/php_codesniffer": "1.*",
31-
"vimeo/psalm": "^4.6.2"
31+
"vimeo/psalm": "~4.9.0"
3232
}
3333
}

‎psalm.xml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<psalm
33
totallyTyped="true"
44
resolveFromConfigFile="true"
5+
findUnusedPsalmSuppress="true"
56
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
67
xmlns="https://getpsalm.org/schema/config"
78
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"

‎src/Enum.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ public function __construct($value)
7272
/** @psalm-suppress ImplicitToStringCast assertValidValueReturningKey returns always a string but psalm has currently an issue here */
7373
$this->key = static::assertValidValueReturningKey($value);
7474

75-
/** @psalm-var T */
7675
$this->value = $value;
7776
}
7877

@@ -126,7 +125,6 @@ public function getKey()
126125

127126
/**
128127
* @psalm-pure
129-
* @psalm-suppress InvalidCast
130128
* @return string
131129
*/
132130
public function __toString()
@@ -176,6 +174,7 @@ public static function values()
176174

177175
/** @psalm-var T $value */
178176
foreach (static::toArray() as $key => $value) {
177+
/** @psalm-suppress UnsafeGenericInstantiation */
179178
$values[$key] = new static($value);
180179
}
181180

@@ -186,7 +185,6 @@ public static function values()
186185
* Returns all possible values as an array
187186
*
188187
* @psalm-pure
189-
* @psalm-suppress ImpureStaticProperty
190188
*
191189
* @psalm-return array<string, mixed>
192190
* @return array Constant name in key, constant value in value
@@ -297,6 +295,7 @@ public static function __callStatic($name, $arguments)
297295
$message = "No static method or enum constant '$name' in class " . static::class;
298296
throw new \BadMethodCallException($message);
299297
}
298+
/** @psalm-suppress UnsafeGenericInstantiation */
300299
return self::$instances[$class][$name] = new static($array[$name]);
301300
}
302301
return clone self::$instances[$class][$name];
@@ -309,6 +308,7 @@ public static function __callStatic($name, $arguments)
309308
* @return mixed
310309
* @link http://php.net/manual/en/jsonserializable.jsonserialize.php
311310
* @psalm-pure
311+
* @psalm-suppress UndefinedAttributeClass ReturnTypeWillChange is not available on <PHP8
312312
*/
313313
#[\ReturnTypeWillChange]
314314
public function jsonSerialize()

0 commit comments

Comments
 (0)