Skip to content

Commit d526854

Browse files
authored
Merge branch '2.x' into update-dev-deps
2 parents abe9285 + a754fe1 commit d526854

File tree

10 files changed

+6
-124
lines changed

10 files changed

+6
-124
lines changed

src/PseudoTypes/False_.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
use phpDocumentor\Reflection\Type;
1818
use phpDocumentor\Reflection\Types\Boolean;
1919

20-
use function class_alias;
21-
2220
/**
2321
* Value Object representing the PseudoType 'False', which is a Boolean type.
2422
*
@@ -36,5 +34,3 @@ public function __toString(): string
3634
return 'false';
3735
}
3836
}
39-
40-
class_alias(False_::class, 'phpDocumentor\Reflection\Types\False_', false);

src/PseudoTypes/GenericTemplate.php

Lines changed: 0 additions & 43 deletions
This file was deleted.

src/PseudoTypes/True_.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
use phpDocumentor\Reflection\Type;
1818
use phpDocumentor\Reflection\Types\Boolean;
1919

20-
use function class_alias;
21-
2220
/**
2321
* Value Object representing the PseudoType 'False', which is a Boolean type.
2422
*
@@ -36,5 +34,3 @@ public function __toString(): string
3634
return 'true';
3735
}
3836
}
39-
40-
class_alias(True_::class, 'phpDocumentor\Reflection\Types\True_', false);

src/TypeResolver.php

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
use phpDocumentor\Reflection\PseudoTypes\False_;
2727
use phpDocumentor\Reflection\PseudoTypes\FloatValue;
2828
use phpDocumentor\Reflection\PseudoTypes\Generic;
29-
use phpDocumentor\Reflection\PseudoTypes\GenericTemplate;
3029
use phpDocumentor\Reflection\PseudoTypes\HtmlEscapedString;
3130
use phpDocumentor\Reflection\PseudoTypes\IntegerRange;
3231
use phpDocumentor\Reflection\PseudoTypes\IntegerValue;
@@ -467,17 +466,7 @@ private function createFromGeneric(GenericTypeNode $type, Context $context): Typ
467466
throw new RuntimeException(sprintf('%s is an unsupported generic', (string) $mainType));
468467
}
469468

470-
$types = array_map(
471-
function (TypeNode $node) use ($context): Type {
472-
$innerType = $this->createType($node, $context);
473-
if ($innerType instanceof Object_ && $innerType instanceof Generic === false) {
474-
return new GenericTemplate($innerType);
475-
}
476-
477-
return $innerType;
478-
},
479-
$type->genericTypes
480-
);
469+
$types = $this->createTypesByTypeNodes($type->genericTypes, $context);
481470

482471
return new Generic($mainType->getFqsen(), $types);
483472
}

tests/unit/CollectionResolverTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
namespace phpDocumentor\Reflection;
1515

1616
use phpDocumentor\Reflection\PseudoTypes\Generic;
17-
use phpDocumentor\Reflection\PseudoTypes\GenericTemplate;
1817
use phpDocumentor\Reflection\PseudoTypes\List_;
1918
use phpDocumentor\Reflection\PseudoTypes\NonEmptyList;
2019
use phpDocumentor\Reflection\Types\Array_;
@@ -80,7 +79,7 @@ public function testResolvingCollectionWithKeyType(): void
8079
$this->assertArrayHasKey(0, $types);
8180
$this->assertEquals(new Array_(new String_()), $types[0]);
8281
$this->assertArrayHasKey(1, $types);
83-
$this->assertEquals(new GenericTemplate(new Object_(new Fqsen('\\Iterator'))), $types[1]);
82+
$this->assertEquals(new Object_(new Fqsen('\\Iterator')), $types[1]);
8483
}
8584

8685
/**
@@ -192,7 +191,7 @@ public function testResolvingCollectionOfCollection(): void
192191

193192
$nestedGenericTypes = $types[1]->getTypes();
194193
$this->assertArrayHasKey(0, $nestedGenericTypes);
195-
$this->assertEquals(new GenericTemplate(new Object_(new Fqsen('\\DateTime'))), $nestedGenericTypes[0]);
194+
$this->assertEquals(new Object_(new Fqsen('\\DateTime')), $nestedGenericTypes[0]);
196195
}
197196

198197
/**

tests/unit/PseudoTypes/FalseTest.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,4 @@ public function testFalseStringifyCorrectly(): void
4040

4141
$this->assertSame('false', (string) $false);
4242
}
43-
44-
/**
45-
* @covers \phpDocumentor\Reflection\PseudoTypes\False_
46-
*/
47-
public function testCanBeInstantiatedUsingDeprecatedFqsen(): void
48-
{
49-
$false = new \phpDocumentor\Reflection\Types\False_();
50-
51-
$this->assertSame('false', (string) $false);
52-
}
5343
}

tests/unit/PseudoTypes/GenericTemplateTest.php

Lines changed: 0 additions & 35 deletions
This file was deleted.

tests/unit/PseudoTypes/GenericTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public static function provideToStringData(): array
7070
new Generic(
7171
new Fqsen('\\MyClass'),
7272
[
73-
new GenericTemplate(new Object_(new Fqsen('\\T'))),
73+
new Object_(new Fqsen('\\T')),
7474
new Object_(new Fqsen('\\SomeClassSecond')),
7575
new Object_(new Fqsen('\\SomeClassThird')),
7676
]

tests/unit/PseudoTypes/IntMaskOfTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ public function testCreate(): void
2828
*/
2929
public function testToString(): void
3030
{
31-
$type = new IntMask(new Compound([new IntegerValue(1), new IntegerValue(5), new IntegerValue(10)]));
31+
$type = new IntMaskOf(new Compound([new IntegerValue(1), new IntegerValue(5), new IntegerValue(10)]));
3232

33-
$this->assertSame('int-mask<1|5|10>', (string) $type);
33+
$this->assertSame('int-mask-of<1|5|10>', (string) $type);
3434
}
3535
}

tests/unit/PseudoTypes/TrueTest.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,4 @@ public function testTrueStringifyCorrectly(): void
4040

4141
$this->assertSame('true', (string) $true);
4242
}
43-
44-
/**
45-
* @covers \phpDocumentor\Reflection\PseudoTypes\True_
46-
*/
47-
public function testCanBeInstantiatedUsingDeprecatedFqsen(): void
48-
{
49-
$true = new \phpDocumentor\Reflection\Types\True_();
50-
51-
$this->assertSame('true', (string) $true);
52-
}
5343
}

0 commit comments

Comments
 (0)