Skip to content

Commit 7d75bd9

Browse files
committed
use "PseudoType"
1 parent 937a026 commit 7d75bd9

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

src/Types/ArrayKey.php

+9-1
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,28 @@
1313

1414
namespace phpDocumentor\Reflection\Types;
1515

16+
use phpDocumentor\Reflection\PseudoType;
17+
use phpDocumentor\Reflection\Type;
18+
1619
/**
1720
* Value Object representing a array-key Type.
1821
*
1922
* A array-key Type is the supertype (but not a union) of int and string.
2023
*
2124
* @psalm-immutable
2225
*/
23-
final class ArrayKey extends AggregatedType
26+
final class ArrayKey extends AggregatedType implements PseudoType
2427
{
2528
public function __construct()
2629
{
2730
parent::__construct([new String_(), new Integer()], '|');
2831
}
2932

33+
public function underlyingType(): Type
34+
{
35+
return new String_();
36+
}
37+
3038
public function __toString(): string
3139
{
3240
return 'array-key';

src/Types/ClassString.php

+8-1
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@
1414
namespace phpDocumentor\Reflection\Types;
1515

1616
use phpDocumentor\Reflection\Fqsen;
17+
use phpDocumentor\Reflection\PseudoType;
18+
use phpDocumentor\Reflection\Type;
1719

1820
/**
1921
* Value Object representing the type 'string'.
2022
*
2123
* @psalm-immutable
2224
*/
23-
final class ClassString extends String_
25+
final class ClassString extends String_ implements PseudoType
2426
{
2527
/** @var Fqsen|null */
2628
private $fqsen;
@@ -33,6 +35,11 @@ public function __construct(?Fqsen $fqsen = null)
3335
$this->fqsen = $fqsen;
3436
}
3537

38+
public function underlyingType(): Type
39+
{
40+
return new String_();
41+
}
42+
3643
/**
3744
* Returns the FQSEN associated with this object.
3845
*/

0 commit comments

Comments
 (0)