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 FunctionVariantWithPhpDocs extends FunctionVariant implements ParametersAcceptorWithPhpDocs
10: {
11:
12: /**
13: * @api
14: * @param array<int, ParameterReflectionWithPhpDocs> $parameters
15: */
16: public function __construct(
17: TemplateTypeMap $templateTypeMap,
18: ?TemplateTypeMap $resolvedTemplateTypeMap,
19: array $parameters,
20: bool $isVariadic,
21: Type $returnType,
22: private Type $phpDocReturnType,
23: private Type $nativeReturnType,
24: )
25: {
26: parent::__construct(
27: $templateTypeMap,
28: $resolvedTemplateTypeMap,
29: $parameters,
30: $isVariadic,
31: $returnType,
32: );
33: }
34:
35: /**
36: * @return array<int, ParameterReflectionWithPhpDocs>
37: */
38: public function getParameters(): array
39: {
40: /** @var array<int, ParameterReflectionWithPhpDocs> $parameters */
41: $parameters = parent::getParameters();
42:
43: return $parameters;
44: }
45:
46: public function getPhpDocReturnType(): Type
47: {
48: return $this->phpDocReturnType;
49: }
50:
51: public function getNativeReturnType(): Type
52: {
53: return $this->nativeReturnType;
54: }
55:
56: }
57: