1: <?php declare(strict_types = 1);
2:
3: namespace PHPStan\Type\Generic;
4:
5: use PHPStan\Turbo\ShadowedByTurboExtension;
6: use PHPStan\Type\AcceptsResult;
7: use PHPStan\Type\IsSuperTypeOfResult;
8: use PHPStan\Type\MixedType;
9: use PHPStan\Type\StrictMixedType;
10: use PHPStan\Type\Type;
11:
12: /** @api */
13: #[ShadowedByTurboExtension(implementation: __DIR__ . '/../../../turbo-ext/src/TemplateStrictMixedType.cpp')]
14: final class TemplateStrictMixedType extends StrictMixedType implements TemplateType
15: {
16:
17: /** @use TemplateTypeTrait<StrictMixedType> */
18: use TemplateTypeTrait;
19:
20: /**
21: * @param non-empty-string $name
22: */
23: public function __construct(
24: TemplateTypeScope $scope,
25: TemplateTypeStrategy $templateTypeStrategy,
26: TemplateTypeVariance $templateTypeVariance,
27: string $name,
28: StrictMixedType $bound,
29: ?Type $default,
30: )
31: {
32: $this->scope = $scope;
33: $this->strategy = $templateTypeStrategy;
34: $this->variance = $templateTypeVariance;
35: $this->name = $name;
36: $this->bound = $bound;
37: $this->default = $default;
38: }
39:
40: public function isSuperTypeOfMixed(MixedType $type): IsSuperTypeOfResult
41: {
42: return $this->isSuperTypeOf($type);
43: }
44:
45: public function isAcceptedBy(Type $acceptingType, bool $strictTypes): AcceptsResult
46: {
47: return $this->isSubTypeOf($acceptingType)->toAcceptsResult();
48: }
49:
50: }
51: