File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -177,6 +177,7 @@ private function generateSignature(\ReflectionClass $class)
177
177
if (!$ parametersWithUndefinedConstants ) {
178
178
yield preg_replace ('/^ @@.*/m ' , '' , $ m );
179
179
} else {
180
+ $ t = \PHP_VERSION_ID >= 70000 ? $ m ->getReturnType () : '' ;
180
181
$ stack = [
181
182
$ m ->getDocComment (),
182
183
$ m ->getName (),
@@ -187,15 +188,16 @@ private function generateSignature(\ReflectionClass $class)
187
188
$ m ->isPrivate (),
188
189
$ m ->isProtected (),
189
190
$ m ->returnsReference (),
190
- \ PHP_VERSION_ID >= 70000 && $ m -> hasReturnType () ? (\ PHP_VERSION_ID >= 70100 ? $ m -> getReturnType () ->getName () : (string ) $ m -> getReturnType ()) : '' ,
191
+ $ t instanceof \ReflectionNamedType ? (( string ) $ t -> allowsNull ()). $ t ->getName () : (string ) $ t ,
191
192
];
192
193
193
194
foreach ($ m ->getParameters () as $ p ) {
194
195
if (!isset ($ parametersWithUndefinedConstants [$ p ->name ])) {
195
196
$ stack [] = (string ) $ p ;
196
197
} else {
198
+ $ t = \PHP_VERSION_ID >= 70000 ? $ p ->getType () : '' ;
197
199
$ stack [] = $ p ->isOptional ();
198
- $ stack [] = \ PHP_VERSION_ID >= 70000 && $ p -> hasType () ? (\ PHP_VERSION_ID >= 70100 ? $ p -> getType ()-> getName () : (string ) $ p -> getType ()) : '' ;
200
+ $ stack [] = $ t instanceof \ReflectionNamedType ? $ t -> getName () : (string ) $ t ;
199
201
$ stack [] = $ p ->isPassedByReference ();
200
202
$ stack [] = \PHP_VERSION_ID >= 50600 ? $ p ->isVariadic () : '' ;
201
203
$ stack [] = $ p ->getName ();
You can’t perform that action at this time.
0 commit comments