Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 0 additions & 43 deletions src/PseudoTypes/GenericTemplate.php

This file was deleted.

13 changes: 1 addition & 12 deletions src/TypeResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
use phpDocumentor\Reflection\PseudoTypes\False_;
use phpDocumentor\Reflection\PseudoTypes\FloatValue;
use phpDocumentor\Reflection\PseudoTypes\Generic;
use phpDocumentor\Reflection\PseudoTypes\GenericTemplate;
use phpDocumentor\Reflection\PseudoTypes\HtmlEscapedString;
use phpDocumentor\Reflection\PseudoTypes\IntegerRange;
use phpDocumentor\Reflection\PseudoTypes\IntegerValue;
Expand Down Expand Up @@ -472,17 +471,7 @@ private function createFromGeneric(GenericTypeNode $type, Context $context): Typ
throw new RuntimeException(sprintf('%s is an unsupported generic', (string) $mainType));
}

$types = array_map(
function (TypeNode $node) use ($context): Type {
$innerType = $this->createType($node, $context);
if ($innerType instanceof Object_ && $innerType instanceof Generic === false) {
return new GenericTemplate($innerType);
}

return $innerType;
},
$type->genericTypes
);
$types = $this->createTypesByTypeNodes($type->genericTypes, $context);

return new Generic($mainType->getFqsen(), $types);
}
Expand Down
5 changes: 2 additions & 3 deletions tests/unit/CollectionResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
namespace phpDocumentor\Reflection;

use phpDocumentor\Reflection\PseudoTypes\Generic;
use phpDocumentor\Reflection\PseudoTypes\GenericTemplate;
use phpDocumentor\Reflection\PseudoTypes\List_;
use phpDocumentor\Reflection\PseudoTypes\NonEmptyList;
use phpDocumentor\Reflection\Types\Array_;
Expand Down Expand Up @@ -81,7 +80,7 @@ public function testResolvingCollectionWithKeyType(): void
$this->assertArrayHasKey(0, $types);
$this->assertEquals(new Array_(new String_()), $types[0]);
$this->assertArrayHasKey(1, $types);
$this->assertEquals(new GenericTemplate(new Object_(new Fqsen('\\Iterator'))), $types[1]);
$this->assertEquals(new Object_(new Fqsen('\\Iterator')), $types[1]);
}

/**
Expand Down Expand Up @@ -193,7 +192,7 @@ public function testResolvingCollectionOfCollection(): void

$nestedGenericTypes = $types[1]->getTypes();
$this->assertArrayHasKey(0, $nestedGenericTypes);
$this->assertEquals(new GenericTemplate(new Object_(new Fqsen('\\DateTime'))), $nestedGenericTypes[0]);
$this->assertEquals(new Object_(new Fqsen('\\DateTime')), $nestedGenericTypes[0]);
}

/**
Expand Down
35 changes: 0 additions & 35 deletions tests/unit/PseudoTypes/GenericTemplateTest.php

This file was deleted.

2 changes: 1 addition & 1 deletion tests/unit/PseudoTypes/GenericTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public static function provideToStringData(): array
new Generic(
new Fqsen('\\MyClass'),
[
new GenericTemplate(new Object_(new Fqsen('\\T'))),
new Object_(new Fqsen('\\T')),
new Object_(new Fqsen('\\SomeClassSecond')),
new Object_(new Fqsen('\\SomeClassThird')),
]
Expand Down