File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -74,18 +74,18 @@ public function dumpBody()
7474 */
7575 protected function getTypeAsString (ReflectionParameter $ parameter )
7676 {
77- if (method_exists ($ parameter , 'getType ' )) {
78- /** @var mixed $parameter ReflectionParameter has hasType and getType methods since PHP 7.0. */
77+ if (version_compare (phpversion (), '8.0.0-dev ' , '< ' )) {
78+ if ($ parameter ->isArray ()) {
79+ return 'array ' ;
80+ }
7981
80- return $ parameter ->hasType () ? strval ($ parameter ->getType ()) : null ;
81- }
82+ $ class = $ parameter ->getClass ();
8283
83- if ($ parameter ->isArray ()) {
84- return 'array ' ;
84+ return $ class ? $ class ->name : null ;
8585 }
8686
87- $ class = $ parameter-> getClass ();
87+ /** @var mixed $parameter ReflectionParameter has hasType and getType methods since PHP 7.0. */
8888
89- return $ class ? $ class -> name : null ;
89+ return $ parameter -> hasType () ? strval ( $ parameter -> getType ()) : null ;
9090 }
9191}
You can’t perform that action at this time.
0 commit comments