File tree 2 files changed +17
-2
lines changed
2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 13
13
14
14
namespace phpDocumentor \Reflection \Types ;
15
15
16
+ use phpDocumentor \Reflection \PseudoType ;
17
+ use phpDocumentor \Reflection \Type ;
18
+
16
19
/**
17
20
* Value Object representing a array-key Type.
18
21
*
19
22
* A array-key Type is the supertype (but not a union) of int and string.
20
23
*
21
24
* @psalm-immutable
22
25
*/
23
- final class ArrayKey extends AggregatedType
26
+ final class ArrayKey extends AggregatedType implements PseudoType
24
27
{
25
28
public function __construct ()
26
29
{
27
30
parent ::__construct ([new String_ (), new Integer ()], '| ' );
28
31
}
29
32
33
+ public function underlyingType (): Type
34
+ {
35
+ return new String_ ();
36
+ }
37
+
30
38
public function __toString (): string
31
39
{
32
40
return 'array-key ' ;
Original file line number Diff line number Diff line change 14
14
namespace phpDocumentor \Reflection \Types ;
15
15
16
16
use phpDocumentor \Reflection \Fqsen ;
17
+ use phpDocumentor \Reflection \PseudoType ;
18
+ use phpDocumentor \Reflection \Type ;
17
19
18
20
/**
19
21
* Value Object representing the type 'string'.
20
22
*
21
23
* @psalm-immutable
22
24
*/
23
- final class ClassString extends String_
25
+ final class ClassString extends String_ implements PseudoType
24
26
{
25
27
/** @var Fqsen|null */
26
28
private $ fqsen ;
@@ -33,6 +35,11 @@ public function __construct(?Fqsen $fqsen = null)
33
35
$ this ->fqsen = $ fqsen ;
34
36
}
35
37
38
+ public function underlyingType (): Type
39
+ {
40
+ return new String_ ();
41
+ }
42
+
36
43
/**
37
44
* Returns the FQSEN associated with this object.
38
45
*/
You can’t perform that action at this time.
0 commit comments