php-ref icon indicating copy to clipboard operation
php-ref copied to clipboard

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

Open jcmarchi opened this issue 6 years ago • 0 comments

I use this debug tool quite often and, in some cases, I am required to visualize the Class structure as it is defined instead of the output of the Magic Method __debugInfo() (when it is present).

Due to the fact this fantastic product is meant for debugging purposes, I felt a little orphan when I realized the function evolved to arbitrarily display the output of the __debugInfo() without any option for me to switch it back to display the Class structure as it is defined.

With the addition of the flag "debugInfo" (default to true), now it possible to use the same tool for both purposes, easily switching from one output to another simply by changing the configuration on the fly:

  • Default Output (using __debugInfo() output, if present): ref::config('debugInfo', true);
  • Class structure output (bypassing __debugInfo() output, if present): ref::config('debugInfo', false);

I am sure many people will appreciate such additional capacity. I hope it helps.

jcmarchi avatar May 01 '19 03:05 jcmarchi