mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
Fixes
This commit is contained in:
parent
a233e621b2
commit
5953b1c53a
@ -1459,7 +1459,7 @@ class ClassLikeNodeScanner
|
||||
|
||||
if (!isset($storage->enum_cases[$stmt->name->name])) {
|
||||
$case = new EnumCaseStorage(
|
||||
$enum_value?->value,
|
||||
$enum_value,
|
||||
$case_location,
|
||||
);
|
||||
|
||||
|
@ -1,18 +1,31 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Psalm\Storage;
|
||||
|
||||
use Psalm\CodeLocation;
|
||||
use Psalm\Type\Atomic\TLiteralInt;
|
||||
use Psalm\Type\Atomic\TLiteralString;
|
||||
|
||||
final class EnumCaseStorage
|
||||
{
|
||||
public bool $deprecated = false;
|
||||
/**
|
||||
* @var TLiteralString|TLiteralInt|null
|
||||
*/
|
||||
public $value;
|
||||
|
||||
/** @var CodeLocation */
|
||||
public $stmt_location;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
public $deprecated = false;
|
||||
|
||||
public function __construct(
|
||||
public int|string|null $value,
|
||||
public CodeLocation $location,
|
||||
TLiteralString|TLiteralInt|null $value,
|
||||
CodeLocation $location,
|
||||
) {
|
||||
$this->value = $value;
|
||||
$this->stmt_location = $location;
|
||||
}
|
||||
}
|
||||
|
@ -1212,6 +1212,7 @@ trait UnionTrait
|
||||
|
||||
/**
|
||||
* @psalm-mutation-free
|
||||
* @psalm-suppress InvalidFalsableReturnType
|
||||
*/
|
||||
public function getSingleLiteral(): TLiteralInt|TLiteralString|TLiteralFloat
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user