Minus   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 78
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 7
lcom 0
cbo 1
dl 0
loc 78
c 2
b 0
f 1
rs 10

7 Methods

Rating   Name   Duplication   Size   Complexity  
A partName() 0 4 1
A __construct() 0 5 1
A getFirst() 0 4 1
A getSecond() 0 4 1
A getTable() 0 4 1
A getWhere() 0 4 1
A where() 0 4 1
1
<?php
2
/**
3
 * Author: Nil Portugués Calderó <[email protected]>
4
 * Date: 9/12/14
5
 * Time: 7:11 PM.
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace NilPortugues\Sql\QueryBuilder\Manipulation;
12
13
use NilPortugues\Sql\QueryBuilder\Syntax\QueryPartInterface;
14
15
/**
16
 * Class Minus.
17
 */
18
class Minus implements QueryInterface, QueryPartInterface
19
{
20
    const MINUS = 'MINUS';
21
22
    /**
23
     * @var Select
24
     */
25
    private $first;
26
27
    /**
28
     * @var Select
29
     */
30
    private $second;
31
32
    /**
33
     * @return string
34
     */
35
    public function partName()
36
    {
37
        return 'MINUS';
38
    }
39
40
    /***
41
     * @param Select $first
42
     * @param Select $second
43
     */
44
    public function __construct(Select $first, Select $second)
45
    {
46
        $this->first = $first;
47
        $this->second = $second;
48
    }
49
50
    /**
51
     * @return \NilPortugues\Sql\QueryBuilder\Manipulation\Select
52
     */
53
    public function getFirst()
54
    {
55
        return $this->first;
56
    }
57
58
    /**
59
     * @return \NilPortugues\Sql\QueryBuilder\Manipulation\Select
60
     */
61
    public function getSecond()
62
    {
63
        return $this->second;
64
    }
65
66
    /**
67
     * @throws QueryException
68
     *
69
     * @return \NilPortugues\Sql\QueryBuilder\Syntax\Table
70
     */
71
    public function getTable()
72
    {
73
        throw new QueryException('MINUS does not support tables');
74
    }
75
76
    /**
77
     * @throws QueryException
78
     *
79
     * @return \NilPortugues\Sql\QueryBuilder\Syntax\Where
80
     */
81
    public function getWhere()
82
    {
83
        throw new QueryException('MINUS does not support WHERE.');
84
    }
85
86
    /**
87
     * @throws QueryException
88
     *
89
     * @return \NilPortugues\Sql\QueryBuilder\Syntax\Where
90
     */
91
    public function where()
92
    {
93
        throw new QueryException('MINUS does not support the WHERE statement.');
94
    }
95
}
96