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