Skip to content

Commit

Permalink
Merge pull request #3 from NigelRel3/Composer
Browse files Browse the repository at this point in the history
Fix for 'ReflectionType::__toString() beeing deprecated' error in obtaining the data type to pass back.
  • Loading branch information
NigelRel3 authored May 27, 2020
2 parents 0bcee56 + c36314e commit 32c2590
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
/composer.lock
/composer.phar
/tests/report/
/.phpunit.result.cache
1 change: 1 addition & 0 deletions report/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/testdox.html
3 changes: 3 additions & 0 deletions report/codeCoverage/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/dashboard.html
/index.html
/XMLReaderReg.php.html
5 changes: 5 additions & 0 deletions report/codeCoverage/_css/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/bootstrap.min.css
/custom.css
/nv.d3.min.css
/octicons.css
/style.css
2 changes: 2 additions & 0 deletions report/codeCoverage/_icons/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/file-code.svg
/file-directory.svg
6 changes: 6 additions & 0 deletions report/codeCoverage/_js/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/bootstrap.min.js
/d3.min.js
/file.js
/jquery.min.js
/nv.d3.min.js
/popper.min.js
8 changes: 7 additions & 1 deletion src/XMLReaderReg.php
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 32c2590

Please sign in to comment.