22
22
use phpDocumentor \Reflection \PseudoTypes \ProtectedPropertiesOf ;
23
23
use phpDocumentor \Reflection \PseudoTypes \PublicPropertiesOf ;
24
24
use phpDocumentor \Reflection \PseudoTypes \ValueOf ;
25
- use function trim ;
26
- use function strpos ;
27
- use function sprintf ;
28
25
use RuntimeException ;
29
- use function in_array ;
30
- use function array_map ;
31
- use function get_class ;
32
- use function strtolower ;
33
- use function array_filter ;
34
- use function class_exists ;
35
- use function array_reverse ;
36
26
use InvalidArgumentException ;
37
- use function array_key_exists ;
38
- use function class_implements ;
39
27
use phpDocumentor \Reflection \Type ;
40
28
use PHPStan \PhpDocParser \Lexer \Lexer ;
41
29
use Doctrine \Deprecations \Deprecation ;
112
100
use phpDocumentor \Reflection \PseudoTypes \ArrayShapeItem ;
113
101
use phpDocumentor \Reflection \PseudoTypes \CallableString ;
114
102
use phpDocumentor \Reflection \PseudoTypes \NonEmptyString ;
115
-
116
103
use phpDocumentor \Reflection \PseudoTypes \ConstExpression ;
117
104
use phpDocumentor \Reflection \PseudoTypes \LowercaseString ;
118
105
use phpDocumentor \Reflection \PseudoTypes \NegativeInteger ;
125
112
use PHPStan \PhpDocParser \Ast \Type \CallableTypeParameterNode ;
126
113
use phpDocumentor \Reflection \PseudoTypes \ConditionalParameter ;
127
114
use phpDocumentor \Reflection \PseudoTypes \NonEmptyLowercaseString ;
115
+
128
116
use PHPStan \PhpDocParser \Ast \Type \ConditionalTypeForParameterNode ;
117
+ use function trim ;
118
+ use function strpos ;
119
+ use function sprintf ;
120
+ use function in_array ;
121
+ use function array_map ;
122
+ use function get_class ;
123
+ use function strtolower ;
124
+ use function array_filter ;
125
+ use function class_exists ;
126
+ use function array_reverse ;
127
+ use function array_key_exists ;
128
+ use function class_implements ;
129
129
130
130
final class TypeResolver
131
131
{
@@ -290,6 +290,7 @@ function (ArrayShapeItemNode $item) use ($context): ListShapeItem {
290
290
default :
291
291
throw new RuntimeException ('Unsupported array shape kind ' );
292
292
}
293
+ // no break
293
294
case ObjectShapeNode::class:
294
295
return new ObjectShape (
295
296
...array_map (
@@ -464,7 +465,7 @@ private function createFromGeneric(GenericTypeNode $type, Context $context): Typ
464
465
return new PrivatePropertiesOf (
465
466
$ subType ->getFqsen ()
466
467
);
467
-
468
+
468
469
case 'list ' :
469
470
return new List_ (
470
471
$ this ->createType ($ type ->genericTypes [0 ], $ context )
@@ -474,12 +475,12 @@ private function createFromGeneric(GenericTypeNode $type, Context $context): Typ
474
475
return new NonEmptyList (
475
476
$ this ->createType ($ type ->genericTypes [0 ], $ context )
476
477
);
477
-
478
+
478
479
case 'key-of ' :
479
480
return new KeyOf (
480
481
$ this ->createType ($ type ->genericTypes [0 ], $ context )
481
482
);
482
-
483
+
483
484
case 'value-of ' :
484
485
return new ValueOf (
485
486
$ this ->createType ($ type ->genericTypes [0 ], $ context )
0 commit comments