From c36314e70f6d02a5dc9eee2b94c10711240fe8f4 Mon Sep 17 00:00:00 2001 From: NigelR Date: Wed, 27 May 2020 18:23:49 +0100 Subject: [PATCH] Fix for 'ReflectionType::__toString() beeing deprecated' error in obtaining the data type to pass back. --- .gitignore | 1 + report/.gitignore | 1 + report/codeCoverage/.gitignore | 3 +++ report/codeCoverage/_css/.gitignore | 5 +++++ report/codeCoverage/_icons/.gitignore | 2 ++ report/codeCoverage/_js/.gitignore | 6 ++++++ src/XMLReaderReg.php | 8 +++++++- 7 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 report/.gitignore create mode 100644 report/codeCoverage/.gitignore create mode 100644 report/codeCoverage/_css/.gitignore create mode 100644 report/codeCoverage/_icons/.gitignore create mode 100644 report/codeCoverage/_js/.gitignore diff --git a/.gitignore b/.gitignore index 9871767..226a9d4 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ /composer.lock /composer.phar /tests/report/ +/.phpunit.result.cache diff --git a/report/.gitignore b/report/.gitignore new file mode 100644 index 0000000..24590c0 --- /dev/null +++ b/report/.gitignore @@ -0,0 +1 @@ +/testdox.html diff --git a/report/codeCoverage/.gitignore b/report/codeCoverage/.gitignore new file mode 100644 index 0000000..92b65be --- /dev/null +++ b/report/codeCoverage/.gitignore @@ -0,0 +1,3 @@ +/dashboard.html +/index.html +/XMLReaderReg.php.html diff --git a/report/codeCoverage/_css/.gitignore b/report/codeCoverage/_css/.gitignore new file mode 100644 index 0000000..f602d47 --- /dev/null +++ b/report/codeCoverage/_css/.gitignore @@ -0,0 +1,5 @@ +/bootstrap.min.css +/custom.css +/nv.d3.min.css +/octicons.css +/style.css diff --git a/report/codeCoverage/_icons/.gitignore b/report/codeCoverage/_icons/.gitignore new file mode 100644 index 0000000..a5f4a2f --- /dev/null +++ b/report/codeCoverage/_icons/.gitignore @@ -0,0 +1,2 @@ +/file-code.svg +/file-directory.svg diff --git a/report/codeCoverage/_js/.gitignore b/report/codeCoverage/_js/.gitignore new file mode 100644 index 0000000..09888cf --- /dev/null +++ b/report/codeCoverage/_js/.gitignore @@ -0,0 +1,6 @@ +/bootstrap.min.js +/d3.min.js +/file.js +/jquery.min.js +/nv.d3.min.js +/popper.min.js diff --git a/src/XMLReaderReg.php b/src/XMLReaderReg.php index e1b22b9..1dfa99e 100644 --- a/src/XMLReaderReg.php +++ b/src/XMLReaderReg.php @@ -188,7 +188,13 @@ private function processClosures() { foreach ( $this->dataMatch as $key => $callable ) { $reflection = new ReflectionFunction($callable); - $argType = (string)$reflection->getParameters()[0]->getType(); + $argType = $reflection->getParameters()[0]->getType(); + if ( $argType != null ) { + $argType = $argType->getName(); + } + else { + $argType = 'string'; + } // Set element associated closure according to type if ( isset($returnMethods[$argType]) ) { $this->callableParam[ $key ] = $returnMethods[$argType];