protected static function _arrayToString($datas, $options)
{
if (!count($datas)) {
return '[]';
}
extract($options['array']);
$comma = false;
$tab = str_repeat($char, $indent * $multiplier);
$string = "[\n";
foreach ($datas as $key => $value) {
if ($comma) {
$string .= ",\n";
}
$comma = true;
$key = filter_var($key, FILTER_VALIDATE_INT) ? $key : static::dump($key, $options['quote']);
$string .= $tab . $key . ' => ';
if (is_array($value)) {
$options['array']['indent'] = $indent + 1;
$string .= static::_arrayToString($value, $options);
} else {
$string .= static::toString($value, $options);
}
}
$tab = str_repeat($char, ($indent - 1) * $multiplier);
return $string . "\n" . $tab . "]";
}