1: <?php declare(strict_types = 1);
2:
3: namespace PHPStan\Reflection;
4:
5: use PHPStan\Type\Generic\TemplateTypeMap;
6: use PHPStan\Type\Type;
7:
8: /** @api */
9: class FunctionVariant implements ParametersAcceptor
10: {
11:
12: /**
13: * @api
14: * @param array<int, ParameterReflection> $parameters
15: */
16: public function __construct(
17: private TemplateTypeMap $templateTypeMap,
18: private ?TemplateTypeMap $resolvedTemplateTypeMap,
19: private array $parameters,
20: private bool $isVariadic,
21: private Type $returnType,
22: )
23: {
24: }
25:
26: public function getTemplateTypeMap(): TemplateTypeMap
27: {
28: return $this->templateTypeMap;
29: }
30:
31: public function getResolvedTemplateTypeMap(): TemplateTypeMap
32: {
33: return $this->resolvedTemplateTypeMap ?? TemplateTypeMap::createEmpty();
34: }
35:
36: /**
37: * @return array<int, ParameterReflection>
38: */
39: public function getParameters(): array
40: {
41: return $this->parameters;
42: }
43:
44: public function isVariadic(): bool
45: {
46: return $this->isVariadic;
47: }
48:
49: public function getReturnType(): Type
50: {
51: return $this->returnType;
52: }
53:
54: }
55: