1: <?php declare(strict_types = 1);
2:
3: namespace PHPStan\Type\Generic;
4:
5: use PHPStan\Type\Traits\UndecidedComparisonCompoundTypeTrait;
6: use PHPStan\Type\Type;
7:
8: /** @api */
9: final class TemplateGenericObjectType extends GenericObjectType implements TemplateType
10: {
11:
12: use UndecidedComparisonCompoundTypeTrait;
13: /** @use TemplateTypeTrait<GenericObjectType> */
14: use TemplateTypeTrait;
15:
16: public function __construct(
17: TemplateTypeScope $scope,
18: TemplateTypeStrategy $templateTypeStrategy,
19: TemplateTypeVariance $templateTypeVariance,
20: string $name,
21: GenericObjectType $bound,
22: )
23: {
24: parent::__construct($bound->getClassName(), $bound->getTypes());
25:
26: $this->scope = $scope;
27: $this->strategy = $templateTypeStrategy;
28: $this->variance = $templateTypeVariance;
29: $this->name = $name;
30: $this->bound = $bound;
31: }
32:
33: protected function recreate(string $className, array $types, ?Type $subtractedType): GenericObjectType
34: {
35: return new self(
36: $this->scope,
37: $this->strategy,
38: $this->variance,
39: $this->name,
40: $this->getBound(),
41: );
42: }
43:
44: }
45: