@@ -132,14 +132,15 @@ class_uses($name),
132
132
}
133
133
foreach ($ class ->getMethods (ReflectionMethod::IS_PUBLIC ) as $ method ) {
134
134
if ($ method ->getDeclaringClass () == $ class ) { // intentionally ==
135
+ $ type = $ method ->getReturnType ();
135
136
$ hash [] = [
136
137
$ name ,
137
138
$ method ->name ,
138
139
$ method ->getDocComment (),
139
140
self ::hashParameters ($ method ),
140
- $ method -> hasReturnType ()
141
- ? [ $ method -> getReturnType ()-> getName (), $ method -> getReturnType ()-> allowsNull ()]
142
- : null ,
141
+ PHP_VERSION_ID < 80000
142
+ ? ( $ type ? [ $ type -> getName (), $ type -> allowsNull ()] : null )
143
+ : ( string ) $ type ,
143
144
];
144
145
}
145
146
}
@@ -158,14 +159,15 @@ class_uses($name),
158
159
$ method = new \ReflectionFunction ($ name );
159
160
$ uses = null ;
160
161
}
162
+ $ type = $ method ->getReturnType ();
161
163
$ hash [] = [
162
164
$ name ,
163
165
$ uses ,
164
166
$ method ->getDocComment (),
165
167
self ::hashParameters ($ method ),
166
- $ method -> hasReturnType ()
167
- ? [ $ method -> getReturnType ()-> getName (), $ method -> getReturnType ()-> allowsNull ()]
168
- : null ,
168
+ PHP_VERSION_ID < 80000
169
+ ? ( $ type ? [ $ type -> getName (), $ type -> allowsNull ()] : null )
170
+ : ( string ) $ type ,
169
171
];
170
172
}
171
173
@@ -179,8 +181,9 @@ private static function hashParameters(\ReflectionFunctionAbstract $method): arr
179
181
foreach ($ method ->getParameters () as $ param ) {
180
182
$ res [] = [
181
183
$ param ->name ,
182
- Reflection::getParameterType ($ param ),
183
- $ param ->allowsNull (),
184
+ PHP_VERSION_ID < 80000
185
+ ? [Reflection::getParameterType ($ param ), $ param ->allowsNull ()]
186
+ : (string ) $ param ->getType (),
184
187
$ param ->isVariadic (),
185
188
$ param ->isDefaultValueAvailable ()
186
189
? [Reflection::getParameterDefaultValue ($ param )]
0 commit comments