From b0bd8e27a1db32a234c2fc88e47d0aae247b8eea Mon Sep 17 00:00:00 2001 From: Simon Podlipsky Date: Tue, 3 Aug 2021 10:38:50 +0200 Subject: [PATCH] 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` --- composer.json | 2 +- psalm.xml | 1 + src/Enum.php | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 924f924..a100860 100644 --- a/composer.json +++ b/composer.json @@ -28,6 +28,6 @@ "require-dev": { "phpunit/phpunit": "^9.5", "squizlabs/php_codesniffer": "1.*", - "vimeo/psalm": "^4.6.2" + "vimeo/psalm": "~4.9.0" } } diff --git a/psalm.xml b/psalm.xml index ff06b66..65e8f0e 100644 --- a/psalm.xml +++ b/psalm.xml @@ -2,6 +2,7 @@ key = static::assertValidValueReturningKey($value); - /** @psalm-var T */ $this->value = $value; } @@ -126,7 +125,6 @@ public function getKey() /** * @psalm-pure - * @psalm-suppress InvalidCast * @return string */ public function __toString() @@ -176,6 +174,7 @@ public static function values() /** @psalm-var T $value */ foreach (static::toArray() as $key => $value) { + /** @psalm-suppress UnsafeGenericInstantiation */ $values[$key] = new static($value); } @@ -186,7 +185,6 @@ public static function values() * Returns all possible values as an array * * @psalm-pure - * @psalm-suppress ImpureStaticProperty * * @psalm-return array * @return array Constant name in key, constant value in value @@ -297,6 +295,7 @@ public static function __callStatic($name, $arguments) $message = "No static method or enum constant '$name' in class " . static::class; throw new \BadMethodCallException($message); } + /** @psalm-suppress UnsafeGenericInstantiation */ return self::$instances[$class][$name] = new static($array[$name]); } return clone self::$instances[$class][$name]; @@ -309,6 +308,7 @@ public static function __callStatic($name, $arguments) * @return mixed * @link http://php.net/manual/en/jsonserializable.jsonserialize.php * @psalm-pure + * @psalm-suppress UndefinedAttributeClass ReturnTypeWillChange is not available on