1: | <?php declare(strict_types = 1); |
2: | |
3: | namespace PHPStan\Type\Generic; |
4: | |
5: | use PHPStan\Type\Constant\ConstantArrayType; |
6: | use PHPStan\Type\Traits\UndecidedComparisonCompoundTypeTrait; |
7: | |
8: | |
9: | final class TemplateConstantArrayType extends ConstantArrayType implements TemplateType |
10: | { |
11: | |
12: | |
13: | use TemplateTypeTrait; |
14: | use UndecidedComparisonCompoundTypeTrait; |
15: | |
16: | public function __construct( |
17: | TemplateTypeScope $scope, |
18: | TemplateTypeStrategy $templateTypeStrategy, |
19: | TemplateTypeVariance $templateTypeVariance, |
20: | string $name, |
21: | ConstantArrayType $bound, |
22: | ) |
23: | { |
24: | parent::__construct($bound->getKeyTypes(), $bound->getValueTypes(), $bound->getNextAutoIndexes(), $bound->getOptionalKeys(), $bound->isList()->yes()); |
25: | $this->scope = $scope; |
26: | $this->strategy = $templateTypeStrategy; |
27: | $this->variance = $templateTypeVariance; |
28: | $this->name = $name; |
29: | $this->bound = $bound; |
30: | } |
31: | |
32: | protected function shouldGeneralizeInferredType(): bool |
33: | { |
34: | return false; |
35: | } |
36: | |
37: | } |
38: | |