|
65 | 65 | use PHPStan\Type\FloatType;
|
66 | 66 | use PHPStan\Type\Generic\GenericClassStringType;
|
67 | 67 | use PHPStan\Type\Generic\GenericObjectType;
|
68 |
| -use PHPStan\Type\Generic\TemplateType; |
69 | 68 | use PHPStan\Type\Generic\TemplateTypeVariance;
|
70 | 69 | use PHPStan\Type\Helper\GetTemplateTypeType;
|
71 | 70 | use PHPStan\Type\IntegerRangeType;
|
@@ -759,29 +758,6 @@ static function (string $variance): TemplateTypeVariance {
|
759 | 758 |
|
760 | 759 | $classReflection = $this->getReflectionProvider()->getClass($mainTypeClassName);
|
761 | 760 | if ($classReflection->isGeneric()) {
|
762 |
| - if ($mainTypeName === 'static') { |
763 |
| - $templateTags = $classReflection->getTemplateTags(); |
764 |
| - $templateTypeMap = $classReflection->getTemplateTypeMap(); |
765 |
| - if (count($genericTypes) === $templateTypeMap->count()) { |
766 |
| - $templateTypeList = $classReflection->typeMapToList($templateTypeMap); |
767 |
| - foreach ($genericTypes as $i => $genericType) { |
768 |
| - if (!$genericType instanceof TemplateType) { |
769 |
| - break; |
770 |
| - } |
771 |
| - $templateType = $templateTypeList[$i]; |
772 |
| - if (!$templateType instanceof TemplateType) { |
773 |
| - break; |
774 |
| - } |
775 |
| - if ($templateType->getName() !== $genericType->getName()) { |
776 |
| - break; |
777 |
| - } |
778 |
| - unset($templateTags[$genericType->getName()]); |
779 |
| - } |
780 |
| - if (count($templateTags) === 0) { |
781 |
| - return new StaticType($classReflection); |
782 |
| - } |
783 |
| - } |
784 |
| - } |
785 | 761 | if (in_array($mainTypeClassName, [
|
786 | 762 | Traversable::class,
|
787 | 763 | IteratorAggregate::class,
|
|
0 commit comments