@@ -88,11 +88,11 @@ public function getThrowTypeFromConstructor(MethodReflection $methodReflection,
88
88
private function resolveReflectionClass (New_ $ newNode , Scope $ scope ): Type
89
89
{
90
90
$ reflectionExceptionType = new ObjectType (ReflectionException::class);
91
- if (!isset ($ newNode ->args [0 ])) {
91
+ if (!isset ($ newNode ->getArgs () [0 ])) {
92
92
return $ reflectionExceptionType ;
93
93
}
94
94
95
- $ valueType = $ this ->resolveType ($ newNode ->args [0 ]->value , $ scope );
95
+ $ valueType = $ this ->resolveType ($ newNode ->getArgs () [0 ]->value , $ scope );
96
96
foreach (TypeUtils::getConstantStrings ($ valueType ) as $ constantString ) {
97
97
if (!$ this ->broker ->hasClass ($ constantString ->getValue ())) {
98
98
return $ reflectionExceptionType ;
@@ -111,11 +111,11 @@ private function resolveReflectionClass(New_ $newNode, Scope $scope): Type
111
111
private function resolveReflectionFunction (New_ $ newNode , Scope $ scope ): Type
112
112
{
113
113
$ reflectionExceptionType = new ObjectType (ReflectionException::class);
114
- if (!isset ($ newNode ->args [0 ])) {
114
+ if (!isset ($ newNode ->getArgs () [0 ])) {
115
115
return $ reflectionExceptionType ;
116
116
}
117
117
118
- $ valueType = $ this ->resolveType ($ newNode ->args [0 ]->value , $ scope );
118
+ $ valueType = $ this ->resolveType ($ newNode ->getArgs () [0 ]->value , $ scope );
119
119
foreach (TypeUtils::getConstantStrings ($ valueType ) as $ constantString ) {
120
120
if (!$ this ->broker ->hasFunction (new Name ($ constantString ->getValue ()), $ scope )) {
121
121
return $ reflectionExceptionType ;
@@ -148,12 +148,12 @@ private function resolveReflectionMethod(New_ $newNode, Scope $scope): Type
148
148
private function resolveReflectionMethodOrProperty (New_ $ newNode , Scope $ scope , callable $ existenceChecker ): Type
149
149
{
150
150
$ reflectionExceptionType = new ObjectType (ReflectionException::class);
151
- if (!isset ($ newNode ->args [1 ])) {
151
+ if (!isset ($ newNode ->getArgs () [1 ])) {
152
152
return $ reflectionExceptionType ;
153
153
}
154
154
155
- $ valueType = $ this ->resolveType ($ newNode ->args [0 ]->value , $ scope );
156
- $ propertyType = $ this ->resolveType ($ newNode ->args [1 ]->value , $ scope );
155
+ $ valueType = $ this ->resolveType ($ newNode ->getArgs () [0 ]->value , $ scope );
156
+ $ propertyType = $ this ->resolveType ($ newNode ->getArgs () [1 ]->value , $ scope );
157
157
foreach (TypeUtils::getConstantStrings ($ valueType ) as $ constantString ) {
158
158
try {
159
159
$ classReflection = $ this ->broker ->getClass ($ constantString ->getValue ());
@@ -188,11 +188,11 @@ private function resolveReflectionMethodOrProperty(New_ $newNode, Scope $scope,
188
188
private function resolveReflectionExtension (New_ $ newNode , Scope $ scope ): Type
189
189
{
190
190
$ reflectionExceptionType = new ObjectType (ReflectionException::class);
191
- if (!isset ($ newNode ->args [0 ])) {
191
+ if (!isset ($ newNode ->getArgs () [0 ])) {
192
192
return $ reflectionExceptionType ;
193
193
}
194
194
195
- $ valueType = $ this ->resolveType ($ newNode ->args [0 ]->value , $ scope );
195
+ $ valueType = $ this ->resolveType ($ newNode ->getArgs () [0 ]->value , $ scope );
196
196
foreach (TypeUtils::getConstantStrings ($ valueType ) as $ constantString ) {
197
197
if (!extension_loaded ($ constantString ->getValue ())) {
198
198
return $ reflectionExceptionType ;
0 commit comments