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])) {
|
if (!isset($storage->enum_cases[$stmt->name->name])) {
|
||||||
$case = new EnumCaseStorage(
|
$case = new EnumCaseStorage(
|
||||||
$enum_value?->value,
|
$enum_value,
|
||||||
$case_location,
|
$case_location,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -1,18 +1,31 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace Psalm\Storage;
|
namespace Psalm\Storage;
|
||||||
|
|
||||||
use Psalm\CodeLocation;
|
use Psalm\CodeLocation;
|
||||||
|
use Psalm\Type\Atomic\TLiteralInt;
|
||||||
|
use Psalm\Type\Atomic\TLiteralString;
|
||||||
|
|
||||||
final class EnumCaseStorage
|
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 function __construct(
|
||||||
public int|string|null $value,
|
TLiteralString|TLiteralInt|null $value,
|
||||||
public CodeLocation $location,
|
CodeLocation $location,
|
||||||
) {
|
) {
|
||||||
|
$this->value = $value;
|
||||||
|
$this->stmt_location = $location;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1212,6 +1212,7 @@ trait UnionTrait
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @psalm-mutation-free
|
* @psalm-mutation-free
|
||||||
|
* @psalm-suppress InvalidFalsableReturnType
|
||||||
*/
|
*/
|
||||||
public function getSingleLiteral(): TLiteralInt|TLiteralString|TLiteralFloat
|
public function getSingleLiteral(): TLiteralInt|TLiteralString|TLiteralFloat
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user