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