Passed
Push — master ( 9b561d...08d227 )
by y
01:25
created

PredicateTrait   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 4
dl 0
loc 27
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A isNotNull() 0 2 1
A isFalse() 0 2 1
A isNull() 0 2 1
1
<?php
2
3
namespace Helix\DB\SQL;
4
5
/**
6
 * Produces logical expressions for the instance.
7
 */
8
trait PredicateTrait {
9
10
    /**
11
     * `$this IS FALSE`
12
     *
13
     * @return Predicate
14
     */
15
    public function isFalse () {
16
        return new Predicate("{$this} IS FALSE");
17
    }
18
19
    /**
20
     * `$this IS NOT NULL`
21
     *
22
     * @return Predicate
23
     */
24
    public function isNotNull () {
25
        return new Predicate("{$this} IS NOT NULL");
26
    }
27
28
    /**
29
     * `$this IS NULL`
30
     *
31
     * @return Predicate
32
     */
33
    public function isNull () {
34
        return new Predicate("{$this} IS NULL");
35
    }
36
}