public static function toString($value, $options = [])
{
$defaults = ['quote' => '"', 'object' => ['method' => '__toString'], 'array' => ['indent' => 1, 'char' => ' ', 'multiplier' => 4]];
$options += $defaults;
$options['array'] += $defaults['array'];
$options['object'] += $defaults['object'];
if ($value instanceof Closure) {
return '`Closure`';
}
if (is_array($value)) {
return static::_arrayToString($value, $options);
}
if (is_object($value)) {
return static::_objectToString($value, $options);
}
return static::dump($value, $options['quote']);
}