src/Query/Traits/TokenTrait.php
private function builtConditions(
        string $innerJoiner,
        string $key,
        $where,
        &$tokens,
        callable $wrapper
    ) {
        foreach ($where as $operation => $value) {
            if (is_numeric($operation)) {
                throw new BuilderException('Nested conditions should have defined operator');
            }

            $operation = strtoupper($operation);
            if (!in_array($operation, ['BETWEEN', 'NOT BETWEEN'])) {
                //AND|OR [name] [OPERATION] [nestedValue]
                $tokens[] = [$innerJoiner, [$key, $operation, $wrapper($value)]];
                continue;
            }

            /*
             * Between and not between condition described using array of [left, right] syntax.
             */

            if (!is_array($value) || count($value) != 2) {
                throw new BuilderException(
                    'Exactly 2 array values are required for between statement'
                );
            }

            $tokens[] = [
                //AND|OR [name] [BETWEEN|NOT BETWEEN] [value 1] [value 2]
                $innerJoiner,
                [$key, $operation, $wrapper($value[0]), $wrapper($value[1])],
            ];
        }

        return $tokens;
    }
private function builtConditions(
        string $innerJoiner,
        string $key,
        $where,
        &$tokens,
        callable $wrapper
    ) {
        foreach ($where as $operation => $value) {
            if (is_numeric($operation)) {
                throw new BuilderException('Nested conditions should have defined operator');
            }

            $operation = strtoupper($operation);
            if (!in_array($operation, ['BETWEEN', 'NOT BETWEEN'])) {
                //AND|OR [name] [OPERATION] [nestedValue]
                $tokens[] = [$innerJoiner, [$key, $operation, $wrapper($value)]];
                continue;
            }

            /*
             * Between and not between condition described using array of [left, right] syntax.
             */

            if (!is_array($value) || count($value) != 2) {
                throw new BuilderException(
                    'Exactly 2 array values are required for between statement'
                );
            }

            $tokens[] = [
                //AND|OR [name] [BETWEEN|NOT BETWEEN] [value 1] [value 2]
                $innerJoiner,
                [$key, $operation, $wrapper($value[0]), $wrapper($value[1])],
            ];
        }

        return $tokens;
    }
private function builtConditions ( string $ innerJoiner , string $ key , $ where , & $ tokens , callable $ wrapper ) { foreach ( $ where as $ operation => $ value ) { if ( is_numeric ( $ operation ) ) { throw new BuilderException ( 'Nested conditions should have defined operator' ) ; } $ operation = strtoupper ( $ operation ) ; if ( ! in_array ( $ operation , [ 'BETWEEN' , 'NOT BETWEEN' ] ) ) { //AND|OR [name] [OPERATION] [nestedValue] $ tokens [ ] = [ $ innerJoiner , [ $ key , $ operation , $ wrapper ( $ value ) ] ] ; continue ; } /*
             * Between and not between condition described using array of [left, right] syntax.
             */ if ( ! is_array ( $ value ) || count ( $ value ) != 2 ) { throw new BuilderException ( 'Exactly 2 array values are required for between statement' ) ; } $ tokens [ ] = [ //AND|OR [name] [BETWEEN|NOT BETWEEN] [value 1] [value 2] $ innerJoiner , [ $ key , $ operation , $ wrapper ( $ value [ 0 ] ) , $ wrapper ( $ value [ 1 ] ) ] , ] ; } return $ tokens ; }
Build set of conditions for specified identifier.

@param string   $innerJoiner Inner boolean joiner.
@param string   $key Column identifier.
@param array    $where Operations associated with identifier.
@param array    $tokens Array to aggregate compiled tokens. Reference.
@param callable $wrapper Callback or closure used to wrap/collect every potential
parameter.

@return array

@throws BuilderException
Build set of conditions for specified identifier .