src/Util/Text.php
protected static function _objectToString($value, $options)
    {
        if ($value instanceof Exception) {
            $msg = '`' . get_class($value) .'` Code(' . $value->getCode() . ') with ';
            $message = $value->getMessage();
            if ($message) {
                $msg .= 'message '. static::dump($value->getMessage());
            } else {
                $msg .= 'no message';
            }
            return $msg . ' in '. $value->getFile() . ':' . $value->getLine();
        }
        $method = $options['object']['method'];
        if (is_callable($method)) {
            return $method($value);
        }
        if (!$method  || !method_exists($value, $method)) {
            return '`' . get_class($value) . '`';
        }
        return $value->{$method}();
    }
protected static function _objectToString($value, $options)
    {
        if ($value instanceof Exception) {
            $msg = '`' . get_class($value) .'` Code(' . $value->getCode() . ') with ';
            $message = $value->getMessage();
            if ($message) {
                $msg .= 'message '. static::dump($value->getMessage());
            } else {
                $msg .= 'no message';
            }
            return $msg . ' in '. $value->getFile() . ':' . $value->getLine();
        }
        $method = $options['object']['method'];
        if (is_callable($method)) {
            return $method($value);
        }
        if (!$method  || !method_exists($value, $method)) {
            return '`' . get_class($value) . '`';
        }
        return $value->{$method}();
    }
protected static function _objectToString ( $ value , $ options ) { if ( $ value instanceof Exception ) { $ msg = '`' . get_class ( $ value ) . '` Code(' . $ value -> getCode ( ) . ') with ' ; $ message = $ value -> getMessage ( ) ; if ( $ message ) { $ msg .= 'message ' . static :: dump ( $ value -> getMessage ( ) ) ; } else { $ msg .= 'no message' ; } return $ msg . ' in ' . $ value -> getFile ( ) . ':' . $ value -> getLine ( ) ; } $ method = $ options [ 'object' ] [ 'method' ] ; if ( is_callable ( $ method ) ) { return $ method ( $ value ) ; } if ( ! $ method || ! method_exists ( $ value , $ method ) ) { return '`' . get_class ( $ value ) . '`' ; } return $ value -> { $ method } ( ) ; }
Generate a string representation of an object.

@param object $value The object.
@param array $options Array of options. Currently one option is supported: $options['object']['method']. It is a object's method which will return it's string representation

@return string The dumped string.
Generate a string representation of an object .