Completed
Push — master ( 65f66e...428edc )
by Michal
04:14
created

UnionKeyword::build()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
eloc 5
nc 2
nop 2
dl 0
loc 9
ccs 6
cts 6
cp 1
crap 2
rs 9.6666
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * `UNION` keyword builder.
5
 */
6
7
namespace PhpMyAdmin\SqlParser\Components;
8
9
use PhpMyAdmin\SqlParser\Component;
10
use PhpMyAdmin\SqlParser\Statements\SelectStatement;
11
12
/**
13
 * `UNION` keyword builder.
14
 *
15
 * @category   Keywords
16
 *
17
 * @license    https://www.gnu.org/licenses/gpl-2.0.txt GPL-2.0+
18
 */
19
class UnionKeyword extends Component
20
{
21
    /**
22
     * @param SelectStatement[] $component the component to be built
23
     * @param array             $options   parameters for building
24
     *
25
     * @return string
26
     */
27 1
    public static function build($component, array $options = array())
28
    {
29 1
        $tmp = array();
30 1
        foreach ($component as $component) {
31 1
            $tmp[] = $component[0] . ' ' . $component[1];
32 1
        }
33
34 1
        return implode(' ', $tmp);
35
    }
36
}
37