-
Notifications
You must be signed in to change notification settings - Fork 574
Expand file tree
/
Copy pathAnnotationsMethodParameterReflection.php
More file actions
95 lines (75 loc) · 1.77 KB
/
AnnotationsMethodParameterReflection.php
File metadata and controls
95 lines (75 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<?php declare(strict_types = 1);
namespace PHPStan\Reflection\Annotations;
use PHPStan\Reflection\AllowedConstantsResult;
use PHPStan\Reflection\ExtendedParameterReflection;
use PHPStan\Reflection\ParameterAllowedConstants;
use PHPStan\Reflection\PassedByReference;
use PHPStan\TrinaryLogic;
use PHPStan\Type\MixedType;
use PHPStan\Type\Type;
final class AnnotationsMethodParameterReflection implements ExtendedParameterReflection
{
public function __construct(private string $name, private Type $type, private PassedByReference $passedByReference, private bool $isOptional, private bool $isVariadic, private ?Type $defaultValue)
{
}
public function getName(): string
{
return $this->name;
}
public function isOptional(): bool
{
return $this->isOptional;
}
public function getType(): Type
{
return $this->type;
}
public function getPhpDocType(): Type
{
return $this->type;
}
public function hasNativeType(): bool
{
return false;
}
public function getNativeType(): Type
{
return new MixedType();
}
public function getOutType(): ?Type
{
return null;
}
public function isImmediatelyInvokedCallable(): TrinaryLogic
{
return TrinaryLogic::createMaybe();
}
public function getClosureThisType(): ?Type
{
return null;
}
public function passedByReference(): PassedByReference
{
return $this->passedByReference;
}
public function isVariadic(): bool
{
return $this->isVariadic;
}
public function getDefaultValue(): ?Type
{
return $this->defaultValue;
}
public function getAttributes(): array
{
return [];
}
public function getAllowedConstants(): ?ParameterAllowedConstants
{
return null;
}
public function checkAllowedConstants(array $constants): AllowedConstantsResult
{
return new AllowedConstantsResult([], [], false);
}
}