@@ -551,7 +551,7 @@ public function resolveVariableToNode($var)
551
551
552
552
/**
553
553
* Given an expression node, resolves that expression recursively to a type.
554
- * If the type could not be resolved, returns Types\Mixed .
554
+ * If the type could not be resolved, returns Types\Mixed_ .
555
555
*
556
556
* @param Node\Expression $expr
557
557
* @return \phpDocumentor\Reflection\Type|null
@@ -567,7 +567,7 @@ public function resolveExpressionNodeToType($expr)
567
567
if ($ expr == null || $ expr instanceof PhpParser \MissingToken || $ expr instanceof PhpParser \SkippedToken) {
568
568
// TODO some members are null or Missing/SkippedToken
569
569
// How do we handle this more generally?
570
- return new Types \Mixed ;
570
+ return new Types \Mixed_ ;
571
571
}
572
572
573
573
// VARIABLE
@@ -597,7 +597,7 @@ public function resolveExpressionNodeToType($expr)
597
597
// Find the function definition
598
598
if ($ expr ->callableExpression instanceof Node \Expression) {
599
599
// Cannot get type for dynamic function call
600
- return new Types \Mixed ;
600
+ return new Types \Mixed_ ;
601
601
}
602
602
603
603
if ($ expr ->callableExpression instanceof Node \QualifiedName) {
@@ -646,7 +646,7 @@ public function resolveExpressionNodeToType($expr)
646
646
// MEMBER ACCESS EXPRESSION
647
647
if ($ expr instanceof Node \Expression \MemberAccessExpression) {
648
648
if ($ expr ->memberName instanceof Node \Expression) {
649
- return new Types \Mixed ;
649
+ return new Types \Mixed_ ;
650
650
}
651
651
$ var = $ expr ->dereferencableExpression ;
652
652
@@ -659,10 +659,10 @@ public function resolveExpressionNodeToType($expr)
659
659
if ($ t instanceof Types \This) {
660
660
$ classFqn = self ::getContainingClassFqn ($ expr );
661
661
if ($ classFqn === null ) {
662
- return new Types \Mixed ;
662
+ return new Types \Mixed_ ;
663
663
}
664
664
} else if (!($ t instanceof Types \Object_) || $ t ->getFqsen () === null ) {
665
- return new Types \Mixed ;
665
+ return new Types \Mixed_ ;
666
666
} else {
667
667
$ classFqn = substr ((string )$ t ->getFqsen (), 1 );
668
668
}
@@ -689,7 +689,7 @@ public function resolveExpressionNodeToType($expr)
689
689
if ($ expr instanceof Node \Expression \ScopedPropertyAccessExpression) {
690
690
$ classType = $ this ->resolveClassNameToType ($ expr ->scopeResolutionQualifier );
691
691
if (!($ classType instanceof Types \Object_) || $ classType ->getFqsen () === null ) {
692
- return new Types \Mixed ;
692
+ return new Types \Mixed_ ;
693
693
}
694
694
$ fqn = substr ((string )$ classType ->getFqsen (), 1 ) . ':: ' ;
695
695
@@ -701,7 +701,7 @@ public function resolveExpressionNodeToType($expr)
701
701
702
702
$ def = $ this ->index ->getDefinition ($ fqn );
703
703
if ($ def === null ) {
704
- return new Types \Mixed ;
704
+ return new Types \Mixed_ ;
705
705
}
706
706
return $ def ->type ;
707
707
}
@@ -888,7 +888,7 @@ public function resolveExpressionNodeToType($expr)
888
888
if ($ expr instanceof Node \Expression \SubscriptExpression) {
889
889
$ varType = $ this ->resolveExpressionNodeToType ($ expr ->postfixExpression );
890
890
if (!($ varType instanceof Types \Array_)) {
891
- return new Types \Mixed ;
891
+ return new Types \Mixed_ ;
892
892
}
893
893
return $ varType ->getValueType ();
894
894
}
@@ -897,14 +897,14 @@ public function resolveExpressionNodeToType($expr)
897
897
// include, require, include_once, require_once
898
898
if ($ expr instanceof Node \Expression \ScriptInclusionExpression) {
899
899
// TODO: resolve path to PhpDocument and find return statement
900
- return new Types \Mixed ;
900
+ return new Types \Mixed_ ;
901
901
}
902
902
903
903
if ($ expr instanceof Node \QualifiedName) {
904
904
return $ this ->resolveClassNameToType ($ expr );
905
905
}
906
906
907
- return new Types \Mixed ;
907
+ return new Types \Mixed_ ;
908
908
}
909
909
910
910
@@ -918,7 +918,7 @@ public function resolveExpressionNodeToType($expr)
918
918
public function resolveClassNameToType ($ class ): Type
919
919
{
920
920
if ($ class instanceof Node \Expression) {
921
- return new Types \Mixed ;
921
+ return new Types \Mixed_ ;
922
922
}
923
923
if ($ class instanceof PhpParser \Token && $ class ->kind === PhpParser \TokenKind::ClassKeyword) {
924
924
// Anonymous class
@@ -958,7 +958,7 @@ public function resolveClassNameToType($class): Type
958
958
* For classes and interfaces, this is the class type (object).
959
959
* For variables / assignments, this is the documented type or type the assignment resolves to.
960
960
* Can also be a compound type.
961
- * If it is unknown, will be Types\Mixed .
961
+ * If it is unknown, will be Types\Mixed_ .
962
962
* Returns null if the node does not have a type.
963
963
*
964
964
* @param Node $node
@@ -1012,7 +1012,7 @@ public function getTypeFromNode($node)
1012
1012
}
1013
1013
$ type = $ defaultType ;
1014
1014
}
1015
- return $ type ?? new Types \Mixed ;
1015
+ return $ type ?? new Types \Mixed_ ;
1016
1016
}
1017
1017
1018
1018
// FUNCTIONS AND METHODS
@@ -1040,7 +1040,7 @@ public function getTypeFromNode($node)
1040
1040
return new Types \Object_ (new Fqsen ('\\' . (string )$ node ->returnType ->getResolvedName ()));
1041
1041
}
1042
1042
// Unknown return type
1043
- return new Types \Mixed ;
1043
+ return new Types \Mixed_ ;
1044
1044
}
1045
1045
1046
1046
// PROPERTIES, CONSTS, CLASS CONSTS, ASSIGNMENT EXPRESSIONS
@@ -1077,7 +1077,7 @@ public function getTypeFromNode($node)
1077
1077
// TODO: read @property tags of class
1078
1078
// TODO: Try to infer the type from default value / constant value
1079
1079
// Unknown
1080
- return new Types \Mixed ;
1080
+ return new Types \Mixed_ ;
1081
1081
}
1082
1082
1083
1083
// The node does not have a type
0 commit comments