src/Viserio/Component/Exception/Console/Handler.php
private static function formatsArgs(array $arguments, bool $recursive = true): string
    {
        $result = [];

        foreach ($arguments as $argument) {
            switch (true) {
                case \is_string($argument):
                    $result[] = '"' . $argument . '"';

                    break;
                case \is_array($argument):
                    $associative = \array_keys($argument) !== \range(0, \count($argument) - 1);

                    if ($recursive && $associative && \count($argument) <= 5) {
                        $result[] = '[' . self::formatsArgs($argument, false) . ']';
                    }

                    break;
                case \is_object($argument):
                    $class    = \get_class($argument);
                    $result[] = "Object(${class})";

                    break;
            }
        }

        return \implode(', ', $result);
    }
private static function formatsArgs(array $arguments, bool $recursive = true): string
    {
        $result = [];

        foreach ($arguments as $argument) {
            switch (true) {
                case \is_string($argument):
                    $result[] = '"' . $argument . '"';

                    break;
                case \is_array($argument):
                    $associative = \array_keys($argument) !== \range(0, \count($argument) - 1);

                    if ($recursive && $associative && \count($argument) <= 5) {
                        $result[] = '[' . self::formatsArgs($argument, false) . ']';
                    }

                    break;
                case \is_object($argument):
                    $class    = \get_class($argument);
                    $result[] = "Object(${class})";

                    break;
            }
        }

        return \implode(', ', $result);
    }
Format the given function args to a string.

@param array $arguments
@param bool  $recursive

@return string