src/Driver/Compiler.php
protected function compileUnions(array $unionTokens): string
    {
        if (empty($unionTokens)) {
            return '';
        }

        $statement = '';
        foreach ($unionTokens as $union) {
            if (!empty($union[0])) {
                //First key is union type, second united query (no need to share compiler)
                $statement .= "\nUNION {$union[0]}\n({$union[1]})";
            } else {
                //No extra space
                $statement .= "\nUNION \n({$union[1]})";
            }
        }

        return ltrim($statement, "\n");
    }
protected function compileUnions(array $unionTokens): string
    {
        if (empty($unionTokens)) {
            return '';
        }

        $statement = '';
        foreach ($unionTokens as $union) {
            if (!empty($union[0])) {
                //First key is union type, second united query (no need to share compiler)
                $statement .= "\nUNION {$union[0]}\n({$union[1]})";
            } else {
                //No extra space
                $statement .= "\nUNION \n({$union[1]})";
            }
        }

        return ltrim($statement, "\n");
    }
protected function compileUnions ( array $ unionTokens ) : string { if ( empty ( $ unionTokens ) ) { return '' ; } $ statement = '' ; foreach ( $ unionTokens as $ union ) { if ( ! empty ( $ union [ 0 ] ) ) { //First key is union type, second united query (no need to share compiler) $ statement .= "\nUNION {$union[0]}\n({$union[1]})" ; } else { //No extra space $ statement .= "\nUNION \n({$union[1]})" ; } } return ltrim ( $ statement , "\n" ) ; }
Compile union statement chunk. Keywords UNION and ALL will be included, this methods will
automatically move every union on new line.

@param array $unionTokens

@return string
Compile union statement chunk . Keywords UNION and ALL will be included this methods will automatically move every union on new line .