Skip to content

Added 'debugInfo' flag to switch output between Magic Method '__debugInfo()' or Default Class Structure #52

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion ref.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ class ref{
// note: seriously slows down queries on large amounts of data
'showStringMatches' => true,

// when a class has the Magic Method "__debugInfo()" defined, show its output by default, or
// tet this flag to false to process the class as a normal object without the Magic Method interference
'debugInfo' => true,

// shortcut functions used to access the query method below;
// if they are namespaced, the namespace must be present as well (methods are not supported)
'shortcutFunc' => array('r', 'rt'),
Expand Down Expand Up @@ -1669,7 +1673,7 @@ protected function evaluate(&$subject, $specialStr = false){

$props = $magicProps = $methods = array();

if($reflector->hasMethod('__debugInfo')){
if($reflector->hasMethod('__debugInfo') && static::$config['debugInfo']){
$magicProps = $subject->__debugInfo();
}else{
$props = $reflector->getProperties($flags);
Expand Down