summaryrefslogtreecommitdiffstats
path: root/php-victorjonsson-markdowndocs-php8.patch
blob: da6e869d5614ef552448d0db54fdfe1102eb6865 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
From 3a2849e39198fb58791c8aae3acca33daf891652 Mon Sep 17 00:00:00 2001
From: Dave Redfern <david.redfern@madagasgar.com>
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 ) {