mirror of
https://github.com/danog/psalm.git
synced 2024-12-02 09:37:59 +01:00
Fixup
This commit is contained in:
parent
0504394e8b
commit
4e5e30633b
@ -14,6 +14,7 @@ use Psalm\Issue\DuplicateParam;
|
||||
use Psalm\Issue\PossiblyUndefinedVariable;
|
||||
use Psalm\Issue\UndefinedVariable;
|
||||
use Psalm\IssueBuffer;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
use Psalm\Type;
|
||||
use Psalm\Type\Atomic\TNamedObject;
|
||||
use Psalm\Type\Union;
|
||||
@ -30,6 +31,7 @@ use function strtolower;
|
||||
*/
|
||||
final class ClosureAnalyzer extends FunctionLikeAnalyzer
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
/**
|
||||
* @param PhpParser\Node\Expr\Closure|PhpParser\Node\Expr\ArrowFunction $function
|
||||
*/
|
||||
|
@ -7,6 +7,7 @@ namespace Psalm\Internal\Analyzer;
|
||||
use PhpParser;
|
||||
use Psalm\Config;
|
||||
use Psalm\Context;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
use UnexpectedValueException;
|
||||
|
||||
use function is_string;
|
||||
@ -18,6 +19,7 @@ use function strtolower;
|
||||
*/
|
||||
final class FunctionAnalyzer extends FunctionLikeAnalyzer
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
public function __construct(PhpParser\Node\Stmt\Function_ $function, SourceAnalyzer $source)
|
||||
{
|
||||
$codebase = $source->getCodebase();
|
||||
|
@ -20,6 +20,7 @@ use Psalm\IssueBuffer;
|
||||
use Psalm\StatementsSource;
|
||||
use Psalm\Storage\ClassLikeStorage;
|
||||
use Psalm\Storage\MethodStorage;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
use UnexpectedValueException;
|
||||
|
||||
use function in_array;
|
||||
@ -31,6 +32,7 @@ use function strtolower;
|
||||
*/
|
||||
final class MethodAnalyzer extends FunctionLikeAnalyzer
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
// https://github.com/php/php-src/blob/a83923044c48982c80804ae1b45e761c271966d3/Zend/zend_enum.c#L77-L95
|
||||
private const FORBIDDEN_ENUM_METHODS = [
|
||||
'__construct',
|
||||
|
@ -5,12 +5,14 @@ declare(strict_types=1);
|
||||
namespace Psalm\Storage\Assertion;
|
||||
|
||||
use Psalm\Storage\Assertion;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
|
||||
/**
|
||||
* @psalm-immutable
|
||||
*/
|
||||
final class Any extends Assertion
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
public function getNegation(): Assertion
|
||||
{
|
||||
return $this;
|
||||
|
@ -5,12 +5,14 @@ declare(strict_types=1);
|
||||
namespace Psalm\Storage\Assertion;
|
||||
|
||||
use Psalm\Storage\Assertion;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
|
||||
/**
|
||||
* @psalm-immutable
|
||||
*/
|
||||
final class ArrayKeyDoesNotExist extends Assertion
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
public function getNegation(): Assertion
|
||||
{
|
||||
return new ArrayKeyExists();
|
||||
|
@ -5,12 +5,14 @@ declare(strict_types=1);
|
||||
namespace Psalm\Storage\Assertion;
|
||||
|
||||
use Psalm\Storage\Assertion;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
|
||||
/**
|
||||
* @psalm-immutable
|
||||
*/
|
||||
final class ArrayKeyExists extends Assertion
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
public function getNegation(): Assertion
|
||||
{
|
||||
return new ArrayKeyDoesNotExist();
|
||||
|
@ -5,12 +5,14 @@ declare(strict_types=1);
|
||||
namespace Psalm\Storage\Assertion;
|
||||
|
||||
use Psalm\Storage\Assertion;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
|
||||
/**
|
||||
* @psalm-immutable
|
||||
*/
|
||||
final class DoesNotHaveAtLeastCount extends Assertion
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
/** @param positive-int $count */
|
||||
public function __construct(public readonly int $count)
|
||||
{
|
||||
|
@ -5,12 +5,14 @@ declare(strict_types=1);
|
||||
namespace Psalm\Storage\Assertion;
|
||||
|
||||
use Psalm\Storage\Assertion;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
|
||||
/**
|
||||
* @psalm-immutable
|
||||
*/
|
||||
final class DoesNotHaveExactCount extends Assertion
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
/** @param positive-int $count */
|
||||
public function __construct(public readonly int $count)
|
||||
{
|
||||
|
@ -5,12 +5,14 @@ declare(strict_types=1);
|
||||
namespace Psalm\Storage\Assertion;
|
||||
|
||||
use Psalm\Storage\Assertion;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
|
||||
/**
|
||||
* @psalm-immutable
|
||||
*/
|
||||
final class DoesNotHaveMethod extends Assertion
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
public function __construct(public readonly string $method)
|
||||
{
|
||||
}
|
||||
|
@ -5,12 +5,14 @@ declare(strict_types=1);
|
||||
namespace Psalm\Storage\Assertion;
|
||||
|
||||
use Psalm\Storage\Assertion;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
|
||||
/**
|
||||
* @psalm-immutable
|
||||
*/
|
||||
final class Empty_ extends Assertion
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
public function getNegation(): Assertion
|
||||
{
|
||||
return new NonEmpty();
|
||||
|
@ -5,12 +5,14 @@ declare(strict_types=1);
|
||||
namespace Psalm\Storage\Assertion;
|
||||
|
||||
use Psalm\Storage\Assertion;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
|
||||
/**
|
||||
* @psalm-immutable
|
||||
*/
|
||||
final class Falsy extends Assertion
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
public function getNegation(): Assertion
|
||||
{
|
||||
return new Truthy();
|
||||
|
@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace Psalm\Storage\Assertion;
|
||||
|
||||
use Psalm\Storage\Assertion;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
use UnexpectedValueException;
|
||||
|
||||
/**
|
||||
@ -12,6 +13,7 @@ use UnexpectedValueException;
|
||||
*/
|
||||
final class HasArrayKey extends Assertion
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
public function __construct(public readonly string $key)
|
||||
{
|
||||
}
|
||||
|
@ -5,12 +5,14 @@ declare(strict_types=1);
|
||||
namespace Psalm\Storage\Assertion;
|
||||
|
||||
use Psalm\Storage\Assertion;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
|
||||
/**
|
||||
* @psalm-immutable
|
||||
*/
|
||||
final class HasAtLeastCount extends Assertion
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
/** @param positive-int $count */
|
||||
public function __construct(public readonly int $count)
|
||||
{
|
||||
|
@ -5,12 +5,14 @@ declare(strict_types=1);
|
||||
namespace Psalm\Storage\Assertion;
|
||||
|
||||
use Psalm\Storage\Assertion;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
|
||||
/**
|
||||
* @psalm-immutable
|
||||
*/
|
||||
final class HasExactCount extends Assertion
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
/** @param positive-int $count */
|
||||
public function __construct(public readonly int $count)
|
||||
{
|
||||
|
@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace Psalm\Storage\Assertion;
|
||||
|
||||
use Psalm\Storage\Assertion;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
use UnexpectedValueException;
|
||||
|
||||
/**
|
||||
@ -12,6 +13,7 @@ use UnexpectedValueException;
|
||||
*/
|
||||
final class HasIntOrStringArrayAccess extends Assertion
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
public function getNegation(): Assertion
|
||||
{
|
||||
throw new UnexpectedValueException('This should never be called');
|
||||
|
@ -5,12 +5,14 @@ declare(strict_types=1);
|
||||
namespace Psalm\Storage\Assertion;
|
||||
|
||||
use Psalm\Storage\Assertion;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
|
||||
/**
|
||||
* @psalm-immutable
|
||||
*/
|
||||
final class HasMethod extends Assertion
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
public function __construct(public readonly string $method)
|
||||
{
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace Psalm\Storage\Assertion;
|
||||
|
||||
use Psalm\Storage\Assertion;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
use UnexpectedValueException;
|
||||
|
||||
/**
|
||||
@ -12,6 +13,7 @@ use UnexpectedValueException;
|
||||
*/
|
||||
final class HasStringArrayAccess extends Assertion
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
public function getNegation(): Assertion
|
||||
{
|
||||
throw new UnexpectedValueException('This should never be called');
|
||||
|
@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace Psalm\Storage\Assertion;
|
||||
|
||||
use Psalm\Storage\Assertion;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
use Psalm\Type\Union;
|
||||
|
||||
/**
|
||||
@ -12,6 +13,7 @@ use Psalm\Type\Union;
|
||||
*/
|
||||
final class InArray extends Assertion
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
public function __construct(public readonly Union $type)
|
||||
{
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace Psalm\Storage\Assertion;
|
||||
|
||||
use Psalm\Storage\Assertion;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
use Psalm\Type\Atomic;
|
||||
|
||||
/**
|
||||
@ -12,6 +13,7 @@ use Psalm\Type\Atomic;
|
||||
*/
|
||||
final class IsAClass extends Assertion
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
/** @param Atomic\TTemplateParamClass|Atomic\TNamedObject $type */
|
||||
public function __construct(public readonly Atomic $type, public readonly bool $allow_string)
|
||||
{
|
||||
|
@ -5,12 +5,14 @@ declare(strict_types=1);
|
||||
namespace Psalm\Storage\Assertion;
|
||||
|
||||
use Psalm\Storage\Assertion;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
|
||||
/**
|
||||
* @psalm-immutable
|
||||
*/
|
||||
final class IsClassEqual extends Assertion
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
public function __construct(public readonly string $type)
|
||||
{
|
||||
}
|
||||
|
@ -5,12 +5,14 @@ declare(strict_types=1);
|
||||
namespace Psalm\Storage\Assertion;
|
||||
|
||||
use Psalm\Storage\Assertion;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
|
||||
/**
|
||||
* @psalm-immutable
|
||||
*/
|
||||
final class IsClassNotEqual extends Assertion
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
public function __construct(public readonly string $type)
|
||||
{
|
||||
}
|
||||
|
@ -5,12 +5,14 @@ declare(strict_types=1);
|
||||
namespace Psalm\Storage\Assertion;
|
||||
|
||||
use Psalm\Storage\Assertion;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
|
||||
/**
|
||||
* @psalm-immutable
|
||||
*/
|
||||
final class IsCountable extends Assertion
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
public function getNegation(): Assertion
|
||||
{
|
||||
return new IsNotCountable(true);
|
||||
|
@ -5,12 +5,14 @@ declare(strict_types=1);
|
||||
namespace Psalm\Storage\Assertion;
|
||||
|
||||
use Psalm\Storage\Assertion;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
|
||||
/**
|
||||
* @psalm-immutable
|
||||
*/
|
||||
final class IsEqualIsset extends Assertion
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
public function getNegation(): Assertion
|
||||
{
|
||||
return new Any();
|
||||
|
@ -5,12 +5,14 @@ declare(strict_types=1);
|
||||
namespace Psalm\Storage\Assertion;
|
||||
|
||||
use Psalm\Storage\Assertion;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
|
||||
/**
|
||||
* @psalm-immutable
|
||||
*/
|
||||
final class IsGreaterThan extends Assertion
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
public function __construct(public readonly int $value)
|
||||
{
|
||||
}
|
||||
|
@ -5,12 +5,14 @@ declare(strict_types=1);
|
||||
namespace Psalm\Storage\Assertion;
|
||||
|
||||
use Psalm\Storage\Assertion;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
|
||||
/**
|
||||
* @psalm-immutable
|
||||
*/
|
||||
final class IsGreaterThanOrEqualTo extends Assertion
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
public function __construct(public readonly int $value)
|
||||
{
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace Psalm\Storage\Assertion;
|
||||
|
||||
use Psalm\Storage\Assertion;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
use Psalm\Type\Atomic;
|
||||
|
||||
/**
|
||||
@ -12,6 +13,7 @@ use Psalm\Type\Atomic;
|
||||
*/
|
||||
final class IsIdentical extends Assertion
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
public function __construct(public readonly Atomic $type)
|
||||
{
|
||||
}
|
||||
|
@ -5,12 +5,14 @@ declare(strict_types=1);
|
||||
namespace Psalm\Storage\Assertion;
|
||||
|
||||
use Psalm\Storage\Assertion;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
|
||||
/**
|
||||
* @psalm-immutable
|
||||
*/
|
||||
final class IsIsset extends Assertion
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
public function getNegation(): Assertion
|
||||
{
|
||||
return new IsNotIsset();
|
||||
|
@ -5,12 +5,14 @@ declare(strict_types=1);
|
||||
namespace Psalm\Storage\Assertion;
|
||||
|
||||
use Psalm\Storage\Assertion;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
|
||||
/**
|
||||
* @psalm-immutable
|
||||
*/
|
||||
final class IsLessThan extends Assertion
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
public function __construct(public readonly int $value)
|
||||
{
|
||||
}
|
||||
|
@ -5,12 +5,14 @@ declare(strict_types=1);
|
||||
namespace Psalm\Storage\Assertion;
|
||||
|
||||
use Psalm\Storage\Assertion;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
|
||||
/**
|
||||
* @psalm-immutable
|
||||
*/
|
||||
final class IsLessThanOrEqualTo extends Assertion
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
public function __construct(public readonly int $value)
|
||||
{
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace Psalm\Storage\Assertion;
|
||||
|
||||
use Psalm\Storage\Assertion;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
use Psalm\Type\Atomic;
|
||||
|
||||
/**
|
||||
@ -12,6 +13,7 @@ use Psalm\Type\Atomic;
|
||||
*/
|
||||
final class IsLooselyEqual extends Assertion
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
public function __construct(public readonly Atomic $type)
|
||||
{
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace Psalm\Storage\Assertion;
|
||||
|
||||
use Psalm\Storage\Assertion;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
use Psalm\Type\Atomic;
|
||||
|
||||
/**
|
||||
@ -12,6 +13,7 @@ use Psalm\Type\Atomic;
|
||||
*/
|
||||
final class IsNotAClass extends Assertion
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
/** @param Atomic\TTemplateParamClass|Atomic\TNamedObject $type */
|
||||
public function __construct(public readonly Atomic $type, public readonly bool $allow_string)
|
||||
{
|
||||
|
@ -5,12 +5,14 @@ declare(strict_types=1);
|
||||
namespace Psalm\Storage\Assertion;
|
||||
|
||||
use Psalm\Storage\Assertion;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
|
||||
/**
|
||||
* @psalm-immutable
|
||||
*/
|
||||
final class IsNotCountable extends Assertion
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
public function __construct(public readonly bool $is_negatable)
|
||||
{
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace Psalm\Storage\Assertion;
|
||||
|
||||
use Psalm\Storage\Assertion;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
use Psalm\Type\Atomic;
|
||||
|
||||
/**
|
||||
@ -12,6 +13,7 @@ use Psalm\Type\Atomic;
|
||||
*/
|
||||
final class IsNotIdentical extends Assertion
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
public function __construct(public readonly Atomic $type)
|
||||
{
|
||||
}
|
||||
|
@ -5,12 +5,14 @@ declare(strict_types=1);
|
||||
namespace Psalm\Storage\Assertion;
|
||||
|
||||
use Psalm\Storage\Assertion;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
|
||||
/**
|
||||
* @psalm-immutable
|
||||
*/
|
||||
final class IsNotIsset extends Assertion
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
public function getNegation(): Assertion
|
||||
{
|
||||
return new IsIsset();
|
||||
|
@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace Psalm\Storage\Assertion;
|
||||
|
||||
use Psalm\Storage\Assertion;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
use Psalm\Type\Atomic;
|
||||
|
||||
/**
|
||||
@ -12,6 +13,7 @@ use Psalm\Type\Atomic;
|
||||
*/
|
||||
final class IsNotLooselyEqual extends Assertion
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
public function __construct(public readonly Atomic $type)
|
||||
{
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace Psalm\Storage\Assertion;
|
||||
|
||||
use Psalm\Storage\Assertion;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
use Psalm\Type\Atomic;
|
||||
|
||||
/**
|
||||
@ -12,6 +13,7 @@ use Psalm\Type\Atomic;
|
||||
*/
|
||||
final class IsNotType extends Assertion
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
public function __construct(public readonly Atomic $type)
|
||||
{
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace Psalm\Storage\Assertion;
|
||||
|
||||
use Psalm\Storage\Assertion;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
use Psalm\Type\Atomic;
|
||||
|
||||
/**
|
||||
@ -12,6 +13,7 @@ use Psalm\Type\Atomic;
|
||||
*/
|
||||
final class IsType extends Assertion
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
public function __construct(public readonly Atomic $type)
|
||||
{
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace Psalm\Storage\Assertion;
|
||||
|
||||
use Psalm\Storage\Assertion;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
|
||||
use function json_encode;
|
||||
|
||||
@ -15,6 +16,7 @@ use const JSON_THROW_ON_ERROR;
|
||||
*/
|
||||
final class NestedAssertions extends Assertion
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
/** @param array<string, list<list<Assertion>>> $assertions */
|
||||
public function __construct(public readonly array $assertions)
|
||||
{
|
||||
|
@ -5,12 +5,14 @@ declare(strict_types=1);
|
||||
namespace Psalm\Storage\Assertion;
|
||||
|
||||
use Psalm\Storage\Assertion;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
|
||||
/**
|
||||
* @psalm-immutable
|
||||
*/
|
||||
final class NonEmpty extends Assertion
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
public function getNegation(): Assertion
|
||||
{
|
||||
return new Empty_();
|
||||
|
@ -5,12 +5,14 @@ declare(strict_types=1);
|
||||
namespace Psalm\Storage\Assertion;
|
||||
|
||||
use Psalm\Storage\Assertion;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
|
||||
/**
|
||||
* @psalm-immutable
|
||||
*/
|
||||
final class NonEmptyCountable extends Assertion
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
public function __construct(public readonly bool $is_negatable)
|
||||
{
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace Psalm\Storage\Assertion;
|
||||
|
||||
use Psalm\Storage\Assertion;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
use Psalm\Type\Union;
|
||||
|
||||
/**
|
||||
@ -12,6 +13,7 @@ use Psalm\Type\Union;
|
||||
*/
|
||||
final class NotInArray extends Assertion
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
public function __construct(
|
||||
public readonly Union $type,
|
||||
) {
|
||||
|
@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace Psalm\Storage\Assertion;
|
||||
|
||||
use Psalm\Storage\Assertion;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
|
||||
use function json_encode;
|
||||
|
||||
@ -15,6 +16,7 @@ use const JSON_THROW_ON_ERROR;
|
||||
*/
|
||||
final class NotNestedAssertions extends Assertion
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
/** @param array<string, list<list<Assertion>>> $assertions */
|
||||
public function __construct(public readonly array $assertions)
|
||||
{
|
||||
|
@ -5,12 +5,14 @@ declare(strict_types=1);
|
||||
namespace Psalm\Storage\Assertion;
|
||||
|
||||
use Psalm\Storage\Assertion;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
|
||||
/**
|
||||
* @psalm-immutable
|
||||
*/
|
||||
final class NotNonEmptyCountable extends Assertion
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
public function getNegation(): Assertion
|
||||
{
|
||||
return new NonEmptyCountable(true);
|
||||
|
@ -5,12 +5,14 @@ declare(strict_types=1);
|
||||
namespace Psalm\Storage\Assertion;
|
||||
|
||||
use Psalm\Storage\Assertion;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
|
||||
/**
|
||||
* @psalm-immutable
|
||||
*/
|
||||
final class Truthy extends Assertion
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
public function getNegation(): Assertion
|
||||
{
|
||||
return new Falsy();
|
||||
|
@ -6,6 +6,7 @@ namespace Psalm\Storage;
|
||||
|
||||
final class FunctionStorage extends FunctionLikeStorage
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
/** @var array<string, bool> */
|
||||
public array $byref_uses = [];
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ use Psalm\Type\Union;
|
||||
|
||||
final class MethodStorage extends FunctionLikeStorage
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
public bool $is_static = false;
|
||||
|
||||
public int $visibility = 0;
|
||||
|
@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace Psalm\Type\Atomic;
|
||||
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
use Psalm\Type\Atomic;
|
||||
|
||||
/**
|
||||
@ -11,6 +12,7 @@ use Psalm\Type\Atomic;
|
||||
*/
|
||||
abstract class Scalar extends Atomic
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
public function canBeFullyExpressedInPhp(int $analysis_php_version_id): bool
|
||||
{
|
||||
return true;
|
||||
|
@ -7,6 +7,7 @@ namespace Psalm\Type\Atomic;
|
||||
use Psalm\Codebase;
|
||||
use Psalm\Internal\Analyzer\StatementsAnalyzer;
|
||||
use Psalm\Internal\Type\TemplateResult;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
use Psalm\Type\Atomic;
|
||||
use Psalm\Type\Union;
|
||||
|
||||
@ -19,6 +20,7 @@ use function count;
|
||||
*/
|
||||
class TArray extends Atomic
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
/**
|
||||
* @use GenericTrait<array{Union, Union}>
|
||||
*/
|
||||
|
@ -8,6 +8,7 @@ use Psalm\Codebase;
|
||||
use Psalm\Internal\Analyzer\StatementsAnalyzer;
|
||||
use Psalm\Internal\Type\TemplateResult;
|
||||
use Psalm\Storage\FunctionLikeParameter;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
use Psalm\Type\Atomic;
|
||||
use Psalm\Type\Union;
|
||||
|
||||
@ -18,6 +19,7 @@ use Psalm\Type\Union;
|
||||
*/
|
||||
final class TCallable extends Atomic
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
use CallableTrait;
|
||||
|
||||
public string $value;
|
||||
|
@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace Psalm\Type\Atomic;
|
||||
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
use Psalm\Type;
|
||||
use Psalm\Type\Atomic;
|
||||
|
||||
@ -14,6 +15,7 @@ use Psalm\Type\Atomic;
|
||||
*/
|
||||
final class TClassConstant extends Atomic
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
public function __construct(
|
||||
public string $fq_classlike_name,
|
||||
public string $const_name,
|
||||
|
@ -9,6 +9,7 @@ use Psalm\Internal\Analyzer\StatementsAnalyzer;
|
||||
use Psalm\Internal\Type\TemplateInferredTypeReplacer;
|
||||
use Psalm\Internal\Type\TemplateResult;
|
||||
use Psalm\Internal\Type\TemplateStandinTypeReplacer;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
use Psalm\Type;
|
||||
use Psalm\Type\Atomic;
|
||||
use Psalm\Type\Union;
|
||||
@ -21,6 +22,7 @@ use Psalm\Type\Union;
|
||||
*/
|
||||
final class TClassStringMap extends Atomic
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
/**
|
||||
* Constructs a new instance of a list
|
||||
*/
|
||||
|
@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace Psalm\Type\Atomic;
|
||||
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
use Psalm\Type\Atomic;
|
||||
|
||||
/**
|
||||
@ -13,6 +14,7 @@ use Psalm\Type\Atomic;
|
||||
*/
|
||||
final class TClosedResource extends Atomic
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
public function getKey(bool $include_extra = true): string
|
||||
{
|
||||
return 'closed-resource';
|
||||
|
@ -7,6 +7,7 @@ namespace Psalm\Type\Atomic;
|
||||
use Psalm\Codebase;
|
||||
use Psalm\Internal\Type\TemplateInferredTypeReplacer;
|
||||
use Psalm\Internal\Type\TemplateResult;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
use Psalm\Type\Atomic;
|
||||
use Psalm\Type\Union;
|
||||
|
||||
@ -17,6 +18,7 @@ use Psalm\Type\Union;
|
||||
*/
|
||||
final class TConditional extends Atomic
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
public function __construct(
|
||||
public string $param_name,
|
||||
public string $defining_class,
|
||||
|
@ -7,6 +7,7 @@ namespace Psalm\Type\Atomic;
|
||||
use Psalm\Codebase;
|
||||
use Psalm\Internal\Analyzer\StatementsAnalyzer;
|
||||
use Psalm\Internal\Type\TemplateResult;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
use Psalm\Type;
|
||||
use Psalm\Type\Atomic;
|
||||
use Psalm\Type\Union;
|
||||
@ -22,6 +23,7 @@ use function substr;
|
||||
*/
|
||||
final class TIterable extends Atomic
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
use HasIntersectionTrait;
|
||||
/**
|
||||
* @use GenericTrait<array{Union, Union}>
|
||||
|
@ -10,6 +10,7 @@ use Psalm\Internal\Type\TemplateInferredTypeReplacer;
|
||||
use Psalm\Internal\Type\TemplateResult;
|
||||
use Psalm\Internal\Type\TemplateStandinTypeReplacer;
|
||||
use Psalm\Internal\Type\TypeCombiner;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
use Psalm\Type;
|
||||
use Psalm\Type\Atomic;
|
||||
use Psalm\Type\Union;
|
||||
@ -32,6 +33,7 @@ use function str_replace;
|
||||
*/
|
||||
class TKeyedArray extends Atomic
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
/**
|
||||
* If the shape has fallback params then they are here
|
||||
*
|
||||
|
@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace Psalm\Type\Atomic;
|
||||
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
use Psalm\Type\Atomic;
|
||||
|
||||
/**
|
||||
@ -13,6 +14,7 @@ use Psalm\Type\Atomic;
|
||||
*/
|
||||
class TMixed extends Atomic
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
public function __construct(public bool $from_loop_isset = false, bool $from_docblock = false)
|
||||
{
|
||||
parent::__construct($from_docblock);
|
||||
|
@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace Psalm\Type\Atomic;
|
||||
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
use Psalm\Type\Atomic;
|
||||
|
||||
/**
|
||||
@ -14,6 +15,7 @@ use Psalm\Type\Atomic;
|
||||
*/
|
||||
final class TNever extends Atomic
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
public function getKey(bool $include_extra = true): string
|
||||
{
|
||||
return 'never';
|
||||
|
@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace Psalm\Type\Atomic;
|
||||
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
use Psalm\Type\Atomic;
|
||||
|
||||
/**
|
||||
@ -13,6 +14,7 @@ use Psalm\Type\Atomic;
|
||||
*/
|
||||
final class TNull extends Atomic
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
public function getKey(bool $include_extra = true): string
|
||||
{
|
||||
return 'null';
|
||||
|
@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace Psalm\Type\Atomic;
|
||||
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
use Psalm\Type\Atomic;
|
||||
|
||||
/**
|
||||
@ -13,6 +14,7 @@ use Psalm\Type\Atomic;
|
||||
*/
|
||||
class TObject extends Atomic
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
public function getKey(bool $include_extra = true): string
|
||||
{
|
||||
return 'object';
|
||||
|
@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace Psalm\Type\Atomic;
|
||||
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
use Psalm\Type\Atomic;
|
||||
|
||||
/**
|
||||
@ -15,6 +16,7 @@ use Psalm\Type\Atomic;
|
||||
*/
|
||||
final class TPropertiesOf extends Atomic
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
// These should match the values of
|
||||
// `Psalm\Internal\Analyzer\ClassLikeAnalyzer::VISIBILITY_*`, as they are
|
||||
// used to compared against properties visibililty.
|
||||
|
@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace Psalm\Type\Atomic;
|
||||
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
use Psalm\Type\Atomic;
|
||||
|
||||
/**
|
||||
@ -13,6 +14,7 @@ use Psalm\Type\Atomic;
|
||||
*/
|
||||
final class TResource extends Atomic
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
public function getKey(bool $include_extra = true): string
|
||||
{
|
||||
return 'resource';
|
||||
|
@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace Psalm\Type\Atomic;
|
||||
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
use Psalm\Type\Atomic;
|
||||
|
||||
/**
|
||||
@ -11,6 +12,7 @@ use Psalm\Type\Atomic;
|
||||
*/
|
||||
final class TTemplateIndexedAccess extends Atomic
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
public function __construct(
|
||||
public string $array_param_name,
|
||||
public string $offset_param_name,
|
||||
|
@ -7,6 +7,7 @@ namespace Psalm\Type\Atomic;
|
||||
use Psalm\Codebase;
|
||||
use Psalm\Internal\Type\TemplateInferredTypeReplacer;
|
||||
use Psalm\Internal\Type\TemplateResult;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
use Psalm\Type\Atomic;
|
||||
use Psalm\Type\Union;
|
||||
|
||||
@ -17,6 +18,7 @@ use Psalm\Type\Union;
|
||||
*/
|
||||
final class TTemplateKeyOf extends Atomic
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
public function __construct(
|
||||
public string $param_name,
|
||||
public string $defining_class,
|
||||
|
@ -6,6 +6,7 @@ namespace Psalm\Type\Atomic;
|
||||
|
||||
use Psalm\Codebase;
|
||||
use Psalm\Internal\Type\TemplateResult;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
use Psalm\Type\Atomic;
|
||||
use Psalm\Type\Union;
|
||||
|
||||
@ -19,6 +20,7 @@ use function implode;
|
||||
*/
|
||||
final class TTemplateParam extends Atomic
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
use HasIntersectionTrait;
|
||||
|
||||
/**
|
||||
|
@ -7,6 +7,7 @@ namespace Psalm\Type\Atomic;
|
||||
use Psalm\Codebase;
|
||||
use Psalm\Internal\Type\TemplateInferredTypeReplacer;
|
||||
use Psalm\Internal\Type\TemplateResult;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
use Psalm\Type\Atomic;
|
||||
use Psalm\Type\Union;
|
||||
|
||||
@ -17,6 +18,7 @@ use Psalm\Type\Union;
|
||||
*/
|
||||
final class TTemplatePropertiesOf extends Atomic
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
/**
|
||||
* @param TPropertiesOf::VISIBILITY_*|null $visibility_filter
|
||||
*/
|
||||
|
@ -7,6 +7,7 @@ namespace Psalm\Type\Atomic;
|
||||
use Psalm\Codebase;
|
||||
use Psalm\Internal\Type\TemplateInferredTypeReplacer;
|
||||
use Psalm\Internal\Type\TemplateResult;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
use Psalm\Type\Atomic;
|
||||
use Psalm\Type\Union;
|
||||
|
||||
@ -17,6 +18,7 @@ use Psalm\Type\Union;
|
||||
*/
|
||||
final class TTemplateValueOf extends Atomic
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
public function __construct(
|
||||
public string $param_name,
|
||||
public string $defining_class,
|
||||
|
@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace Psalm\Type\Atomic;
|
||||
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
use Psalm\Type\Atomic;
|
||||
|
||||
/**
|
||||
@ -11,6 +12,7 @@ use Psalm\Type\Atomic;
|
||||
*/
|
||||
final class TTypeAlias extends Atomic
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
public function __construct(
|
||||
public string $declaring_fq_classlike_name,
|
||||
public string $alias_name,
|
||||
|
@ -6,6 +6,7 @@ namespace Psalm\Type\Atomic;
|
||||
|
||||
use Psalm\Codebase;
|
||||
use Psalm\Storage\EnumCaseStorage;
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
use Psalm\Type\Atomic;
|
||||
use Psalm\Type\Union;
|
||||
|
||||
@ -20,6 +21,7 @@ use function assert;
|
||||
*/
|
||||
final class TValueOf extends Atomic
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
public function __construct(public Union $type, bool $from_docblock = false)
|
||||
{
|
||||
parent::__construct($from_docblock);
|
||||
|
@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace Psalm\Type\Atomic;
|
||||
|
||||
use Psalm\Storage\UnserializeMemoryUsageSuppressionTrait;
|
||||
use Psalm\Type\Atomic;
|
||||
|
||||
/**
|
||||
@ -13,6 +14,7 @@ use Psalm\Type\Atomic;
|
||||
*/
|
||||
final class TVoid extends Atomic
|
||||
{
|
||||
use UnserializeMemoryUsageSuppressionTrait;
|
||||
public function getKey(bool $include_extra = true): string
|
||||
{
|
||||
return 'void';
|
||||
|
Loading…
Reference in New Issue
Block a user