1: <?php declare(strict_types = 1);
2:
3: namespace PHPStan\Type;
4:
5: /** @api */
6: class ErrorType extends MixedType
7: {
8:
9: /** @api */
10: public function __construct(private ?string $reason = null)
11: {
12: parent::__construct();
13: }
14:
15: public function getReason(): ?string
16: {
17: return $this->reason;
18: }
19:
20: public function describe(VerbosityLevel $level): string
21: {
22: return $level->handle(
23: fn (): string => parent::describe($level),
24: fn (): string => parent::describe($level),
25: static fn (): string => '*ERROR*',
26: );
27: }
28:
29: public function getIterableKeyType(): Type
30: {
31: return new ErrorType();
32: }
33:
34: public function getIterableValueType(): Type
35: {
36: return new ErrorType();
37: }
38:
39: public function subtract(Type $type): Type
40: {
41: return new self();
42: }
43:
44: public function equals(Type $type): bool
45: {
46: return $type instanceof self;
47: }
48:
49: }
50: