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);
    }
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);
    }
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 ) ; }
Rewrites the parameter & type according to the parameter index .

Example:
- parameters:
- parameters: array(array(1, 3, 5))
- types: array('integer[]')
- index: 0
- result:
- rewrittenParameters: array(1, 3, 5)
- rewrittenTypes: array('integer', 'integer', 'integer')

@param array   $parameters The query parameters.
@param array   $types      The query types.
@param integer $index      The query parameter index.

@return array 0 => The rewritten parameters, 1 => The rewritten types.
Rewrites the parameter & type according to the parameter index .