Debug_Bar_Pretty_Output::get_object_info PHP Method

get_object_info() private static method

Retrieve pretty output about objects.
Since: 1.3
private static get_object_info ( object $obj, boolean $escape, string $space, boolean $short, integer $depth ) : string
$obj object Object to show.
$escape boolean (internal) Whether to character escape the textual output.
$space string (internal) Indentation spacing.
$short boolean (internal) Short or normal annotation.
$depth integer (internal) The depth of the current recursion.
return string
        private static function get_object_info($obj, $escape, $space, $short, $depth = 0)
        {
            $output = '';
            $output .= $space . '<b><i>Class</i></b>: ' . esc_html(get_class($obj)) . ' (<br />';
            if (true !== $short) {
                $spacing = $space . '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
            } else {
                $spacing = $space . '&nbsp;&nbsp;';
            }
            $properties = get_object_vars($obj);
            if (!empty($properties) && is_array($properties)) {
                foreach ($properties as $var => $val) {
                    if (is_array($val)) {
                        $output .= $spacing . '<b><i>property</i></b>: ' . esc_html($var) . "<b><i> (array)</i></b>\n";
                        $output .= self::get_output($val, '', $escape, $spacing, $short, $depth);
                    } else {
                        $output .= $spacing . '<b><i>property</i></b>: ' . esc_html($var) . ' = ';
                        $output .= self::get_output($val, '', $escape, $spacing, $short, $depth);
                    }
                }
            }
            unset($properties, $var, $val);
            $methods = get_class_methods($obj);
            if (!empty($methods) && is_array($methods)) {
                foreach ($methods as $method) {
                    $output .= $spacing . '<b><i>method</i></b>: ' . esc_html($method) . "<br />\n";
                }
            }
            unset($methods, $method);
            $output .= $space . ')<br /><br />';
            return $output;
        }