private static function determinePlaceholderPositions($query, $placeholder)
    {
        // Placeholder positions.
        $placeholderPositions = array();

        // TRUE if we are in an escaped section else FALSE.
        $escaped = false;

        // The placeholder length.
        $placeholderLength = strlen($placeholder);

        // The placeholder position limit before which it can be found.
        $placeolderPositionLimit = strlen($query) - $placeholderLength + 1;

        // Iterache each query char to find the placeholder.
        for ($placeholderPosition = 0; $placeholderPosition < $placeolderPositionLimit; $placeholderPosition++) {

            // Switch the escaped flag if the current query char is a escape delimiter.
            if (in_array($query[$placeholderPosition], array('\'', '"'))) {
                $escaped = !$escaped;
            }

            // Collect the placeholder position if we are not in an escaped section and there is the placeholder at the
            // current position.
            if (!$escaped && (substr($query, $placeholderPosition, $placeholderLength) === $placeholder)) {
                $placeholderPositions[] = $placeholderPosition;
            }
        }

        // Check if the placeholder has been found.
        if (empty($placeholderPositions)) {
            throw QueryRewriterException::namedPlaceholderDoesNotExist($placeholder, $query);
        }

        return $placeholderPositions;
    }
private static function determinePlaceholderPositions($query, $placeholder)
    {
        // Placeholder positions.
        $placeholderPositions = array();

        // TRUE if we are in an escaped section else FALSE.
        $escaped = false;

        // The placeholder length.
        $placeholderLength = strlen($placeholder);

        // The placeholder position limit before which it can be found.
        $placeolderPositionLimit = strlen($query) - $placeholderLength + 1;

        // Iterache each query char to find the placeholder.
        for ($placeholderPosition = 0; $placeholderPosition < $placeolderPositionLimit; $placeholderPosition++) {

            // Switch the escaped flag if the current query char is a escape delimiter.
            if (in_array($query[$placeholderPosition], array('\'', '"'))) {
                $escaped = !$escaped;
            }

            // Collect the placeholder position if we are not in an escaped section and there is the placeholder at the
            // current position.
            if (!$escaped && (substr($query, $placeholderPosition, $placeholderLength) === $placeholder)) {
                $placeholderPositions[] = $placeholderPosition;
            }
        }

        // Check if the placeholder has been found.
        if (empty($placeholderPositions)) {
            throw QueryRewriterException::namedPlaceholderDoesNotExist($placeholder, $query);
        }

        return $placeholderPositions;
    }
private static function determinePlaceholderPositions ( $ query , $ placeholder ) { // Placeholder positions. $ placeholderPositions = array ( ) ; // TRUE if we are in an escaped section else FALSE. $ escaped = false ; // The placeholder length. $ placeholderLength = strlen ( $ placeholder ) ; // The placeholder position limit before which it can be found. $ placeolderPositionLimit = strlen ( $ query ) - $ placeholderLength + 1 ; // Iterache each query char to find the placeholder. for ( $ placeholderPosition = 0 ; $ placeholderPosition < $ placeolderPositionLimit ; $ placeholderPosition ++ ) { // Switch the escaped flag if the current query char is a escape delimiter. if ( in_array ( $ query [ $ placeholderPosition ] , array ( '\'' , '"' ) ) ) { $ escaped = ! $ escaped ; } // Collect the placeholder position if we are not in an escaped section and there is the placeholder at the // current position. if ( ! $ escaped && ( substr ( $ query , $ placeholderPosition , $ placeholderLength ) === $ placeholder ) ) { $ placeholderPositions [ ] = $ placeholderPosition ; } } // Check if the placeholder has been found. if ( empty ( $ placeholderPositions ) ) { throw QueryRewriterException :: namedPlaceholderDoesNotExist ( $ placeholder , $ query ) ; } return $ placeholderPositions ; }
Determines the placeholder positions in the query.

Example:
- parameters:
- query: SELECT * FROM foo WHERE foo IN (:foo) AND bar IN (:foo)
^ (32)            ^ (50)
- placeholder: :foo
- result:
- placeholderPositions: array(32, 50)

@param string $query       The query.
@param string $placeholder The placeholder.

@throws \Fridge\DBAL\Exception\QueryRewriterException If the placeholder does not exist.

@return array The placeholder positions.
Determines the placeholder positions in the query .