kahlan\util\Text::_arrayToString PHP Метод

_arrayToString() защищенный статический Метод

Generate a string representation of an array.
protected static _arrayToString ( array $datas, array $options ) : string
$datas array An array.
$options array An array of options.
Результат string The dumped string.
    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 . "]";
    }