protected function getArgumentsAsString(array $args)
    {
        $result = [];
        $isNumeric = Jasny\is_numeric_array($args);
        $stringify = function ($input) {
            return sprintf("'%s'", addcslashes($input, "'"));
        };

        foreach ($args as $key => $arg) {
            switch (strtolower(gettype($arg))) {
                case 'string':
                    $string = $stringify($arg);
                    break;

                case 'object':
                    $string = get_class($arg);
                    break;

                case 'array':
                    $string = "[{$this->getArgumentsAsString($arg)}]";
                    break;

                case 'null':
                    $string = 'null';
                    break;

                case 'boolean':
                    $string = $arg ? 'true' : 'false';
                    break;

                case 'resource':
                    $string = sprintf('*%s', get_resource_type($arg));
                    break;

                default:
                    $string = $arg;
            }

            if ($isNumeric === false) {
                $result[] = is_string($key) === true ? $stringify($key) . ' => ' . $string : $string;
            } else {
                $result[] = $string;
            }
        }

        return join(', ', $result);
    }