UnionAll   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 58
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 58.33%

Importance

Changes 0
Metric Value
dl 0
loc 58
ccs 7
cts 12
cp 0.5833
rs 10
c 0
b 0
f 0
wmc 5
lcom 1
cbo 2

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A mainQuery() 0 4 1
A supportQuery() 0 4 1
A __clone() 0 5 1
A getIterator() 0 4 1
1
<?php
2
3
namespace mav3rick177\RapidPagination\Base\Query;
4
5
/**
6
 * Class UnionAll
7
 */
8
class UnionAll extends SelectOrUnionAll implements \IteratorAggregate
9
{
10
    /**
11
     * @var Select
12
     */
13
    protected $mainQuery;
14
15
    /**
16
     * @var Select
17
     */
18
    protected $supportQuery;
19
20
    /**
21
     * UnionAll constructor.
22
     *
23
     * @param Select $select
24
     */
25 10
    public function __construct(Select $select)
26
    {
27 10
        $this->mainQuery = $select;
28 10
        $this->supportQuery = $select->inverse();
29
    }
30
31
    /**
32
     * @return Select
33
     */
34 10
    public function mainQuery()
35
    {
36 10
        return $this->mainQuery;
37
    }
38
39
    /**
40
     * @return Select
41
     */
42 10
    public function supportQuery()
43
    {
44 10
        return $this->supportQuery;
45
    }
46
47
    /**
48
     * Clone Select.
49
     */
50
    public function __clone()
51
    {
52
        $this->mainQuery = clone $this->mainQuery;
53
        $this->supportQuery = clone $this->supportQuery;
54
    }
55
56
    /**
57
     * Retrieve an external iterator.
58
     *
59
     * @return \ArrayIterator|Select[]
60
     */
61
    public function getIterator()
62
    {
63
        return new \ArrayIterator([$this->mainQuery, $this->supportQuery]);
64
    }
65
}
66