1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-25 15:51:37 +02:00

Add __debugInfo() method to WireInput class per processwire/processwire-issues#575

This commit is contained in:
Ryan Cramer
2018-04-26 08:48:09 -04:00
parent e53e4b4bd0
commit 105ba2b8eb

View File

@@ -650,5 +650,24 @@ class WireInput extends Wire {
} }
} }
} }
/**
* debugInfo PHP 5.6+ magic method
*
* This is used when you print_r() an object instance.
*
* @return array
*
*/
public function __debugInfo() {
$info = parent::__debugInfo();
$info['get'] = $this->getVars ? $this->getVars->getArray() : null;
$info['post'] = $this->postVars ? $this->postVars->getArray() : null;
$info['cookie'] = $this->cookieVars ? $this->cookieVars->getArray() : null;
$info['whitelist'] = $this->whitelist ? $this->whitelist->getArray() : null;
$info['urlSegments'] = $this->urlSegments;
$info['pageNum'] = $this->pageNum;
return $info;
}
} }