From 3a2849e39198fb58791c8aae3acca33daf891652 Mon Sep 17 00:00:00 2001 From: Dave Redfern Date: Wed, 20 Jan 2021 15:49:56 -0500 Subject: [PATCH] Support PHP8 --- .gitattributes | 6 ++++++ .gitignore | 4 ++++ composer.json | 7 ++++++- src/PHPDocsMD/Reflector.php | 10 +--------- test/ExampleClass.php | 7 ++++--- test/MDTableGeneratorTest.php | 7 +++++-- test/ReflectorTest.php | 6 ++++-- test/UseInspectorTest.php | 9 +++++---- 8 files changed, 35 insertions(+), 21 deletions(-) create mode 100644 .gitattributes create mode 100644 .gitignore diff --git a/src/PHPDocsMD/Reflector.php b/src/PHPDocsMD/Reflector.php index a579e5e..598dec5 100644 --- a/src/PHPDocsMD/Reflector.php +++ b/src/PHPDocsMD/Reflector.php @@ -336,15 +336,7 @@ private function createParameterEntity(\ReflectionParameter $reflection, $docs) */ static function getParamType(\ReflectionParameter $refParam) { - $export = \ReflectionParameter::export([ - $refParam->getDeclaringClass()->name, - $refParam->getDeclaringFunction()->name - ], - $refParam->name, - true - ); - - $export = str_replace(' or NULL', '', $export); + $export = str_replace(' or NULL', '', (string)$refParam); $type = preg_replace('/.*?([\w\\\]+)\s+\$'.current(explode('=', $refParam->name)).'.*/', '\\1', $export); if( strpos($type, 'Parameter ') !== false ) {