src/Utils/Stringer.php
public static function stringify($value)
    {
        if (is_string($value)) {
            return $value;
        }
        if ($value === null || is_bool($value)) {
            return var_export($value, true);
        }

        if (is_array($value) || (is_object($value) && !method_exists($value, '__toString'))) {
            return json_encode($value, JSON_ERROR_NONE | JSON_UNESCAPED_SLASHES);
        }
        return (string)$value;
    }
public static function stringify($value)
    {
        if (is_string($value)) {
            return $value;
        }
        if ($value === null || is_bool($value)) {
            return var_export($value, true);
        }

        if (is_array($value) || (is_object($value) && !method_exists($value, '__toString'))) {
            return json_encode($value, JSON_ERROR_NONE | JSON_UNESCAPED_SLASHES);
        }
        return (string)$value;
    }
public static function stringify ( $ value ) { if ( is_string ( $ value ) ) { return $ value ; } if ( $ value === null || is_bool ( $ value ) ) { return var_export ( $ value , true ) ; } if ( is_array ( $ value ) || ( is_object ( $ value ) && ! method_exists ( $ value , '__toString' ) ) ) { return json_encode ( $ value , JSON_ERROR_NONE | JSON_UNESCAPED_SLASHES ) ; } return ( string ) $ value ; }
Converts a value into a string.

@param mixed $value
@return string
Converts a value into a string .