1: | <?php declare(strict_types = 1); |
2: | |
3: | namespace PHPStan\PhpDoc\Tag; |
4: | |
5: | use PHPStan\TrinaryLogic; |
6: | use PHPStan\Type\Type; |
7: | |
8: | |
9: | class ParamTag implements TypedTag |
10: | { |
11: | |
12: | public function __construct( |
13: | private Type $type, |
14: | private bool $isVariadic, |
15: | private TrinaryLogic $immediatelyInvokedCallable, |
16: | private ?Type $closureThisType, |
17: | ) |
18: | { |
19: | } |
20: | |
21: | public function getType(): Type |
22: | { |
23: | return $this->type; |
24: | } |
25: | |
26: | public function isVariadic(): bool |
27: | { |
28: | return $this->isVariadic; |
29: | } |
30: | |
31: | public function isImmediatelyInvokedCallable(): TrinaryLogic |
32: | { |
33: | return $this->immediatelyInvokedCallable; |
34: | } |
35: | |
36: | |
37: | |
38: | |
39: | public function withType(Type $type): TypedTag |
40: | { |
41: | return new self($type, $this->isVariadic, $this->immediatelyInvokedCallable, $this->closureThisType); |
42: | } |
43: | |
44: | public function withImmediatelyInvokedCallable(TrinaryLogic $immediatelyInvokedCallable): self |
45: | { |
46: | return new self($this->type, $this->isVariadic, $immediatelyInvokedCallable, $this->closureThisType); |
47: | } |
48: | |
49: | public function withClosureThisType(Type $closureThisType): self |
50: | { |
51: | return new self($this->type, $this->isVariadic, $this->immediatelyInvokedCallable, $closureThisType); |
52: | } |
53: | |
54: | public function getClosureThisType(): ?Type |
55: | { |
56: | return $this->closureThisType; |
57: | } |
58: | |
59: | } |
60: | |