private static function rewriteParameterAndType(array $parameters, array $types, $index)
    {
        // The parameter value according.
        $parameterValue = $parameters[$index];

        // The parameter count.
        $parameterCount = count($parameterValue);

        // Extract the fridge type.
        $type = static::extractType($types[$index]);

        // Shift parameters and types placed just after the current rewritten position according to the gap.
        // This will prepare the parameters & types to be rewritten with new placeholders.

        // Determine the interval to shift.
        $minPosition = $index;
        $maxPosition = max(array_keys($parameters));

        // Iterate the interval to shift each of them according to the parameter count.
        for ($rewritePosition = $maxPosition; $rewritePosition > $minPosition; $rewritePosition--) {

            // Determine the new position.
            $newPosition = $rewritePosition + $parameterCount - 1;

            // Shift the parameter.
            $parameters[$newPosition] = $parameters[$rewritePosition];

            // Shift or unset the type if it does not exist.
            if (isset($types[$rewritePosition])) {
                $types[$newPosition] = $types[$rewritePosition];
            } elseif (isset($types[$newPosition])) {
                unset($types[$newPosition]);
            }
        }

        // Rewrite parameters and types according to the parameter count.
        for ($newPlaceholderIndex = 0; $newPlaceholderIndex < $parameterCount; $newPlaceholderIndex++) {

            // Determine the new position.
            $newPosition = $index + $newPlaceholderIndex;

            // Rewrite the parameter and type.
            $parameters[$newPosition] = $parameterValue[$newPlaceholderIndex];
            $types[$newPosition] = $type;
        }

        return array($parameters, $types);
    }