AbstractType   A
last analyzed

Complexity

Total Complexity 15

Size/Duplication

Total Lines 80
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 13

Test Coverage

Coverage 16.13%

Importance

Changes 0
Metric Value
dl 0
loc 80
c 0
b 0
f 0
wmc 15
lcom 0
cbo 13
ccs 5
cts 31
cp 0.1613
rs 10

15 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getName() 0 4 1
A equal() 0 4 1
A different() 0 4 1
A like() 0 4 1
A notLike() 0 4 1
A greaterThan() 0 4 1
A greaterOrEqualThan() 0 4 1
A lowerThan() 0 4 1
A lowerOrEqualThan() 0 4 1
A between() 0 4 1
A in() 0 4 1
A isNull() 0 4 1
A isNotNull() 0 4 1
A notIn() 0 4 1
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace Puzzle\QueryBuilder\Types;
6
7
use Puzzle\QueryBuilder\Type;
8
use Puzzle\QueryBuilder\Conditions;
9
use Puzzle\QueryBuilder\Conditions\Equal;
10
use Puzzle\QueryBuilder\Conditions\Different;
11
use Puzzle\QueryBuilder\Conditions\Like;
12
use Puzzle\QueryBuilder\Conditions\NotLike;
13
use Puzzle\QueryBuilder\Conditions\Greater;
14
use Puzzle\QueryBuilder\Conditions\GreaterOrEqual;
15
use Puzzle\QueryBuilder\Conditions\Lower;
16
use Puzzle\QueryBuilder\Conditions\LowerOrEqual;
17
use Puzzle\QueryBuilder\Conditions\Between;
18
use Puzzle\QueryBuilder\Conditions\In;
19
use Puzzle\QueryBuilder\Conditions\IsNull;
20
use Puzzle\QueryBuilder\Conditions\IsNotNull;
21
use Puzzle\QueryBuilder\Conditions\NotIn;
22
23
abstract class AbstractType implements Type
24
{
25
    private
26
        $name;
1 ignored issue
show
Coding Style introduced by
The visibility should be declared for property $name.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
27
28 80
    public function __construct(string $name)
29
    {
30 80
        $this->name = (string) $name;
31 80
    }
32
33 250
    public function getName(): string
34
    {
35 250
        return $this->name;
36
    }
37
38
    public function equal($value): Conditions\Equal
39
    {
40
        return new Equal($this, $value);
41
    }
42
43
    public function different($value): Conditions\Different
44
    {
45
        return new Different($this, $value);
46
    }
47
48
    public function like($value): Conditions\Like
49
    {
50
        return new Like($this, $value);
51
    }
52
53
    public function notLike($value): Conditions\NotLike
54
    {
55
        return new NotLike($this, $value);
56
    }
57
58
    public function greaterThan($value): Conditions\Greater
59
    {
60
        return new Greater($this, $value);
61
    }
62
63
    public function greaterOrEqualThan($value): Conditions\GreaterOrEqual
64
    {
65
        return new GreaterOrEqual($this, $value);
66
    }
67
68
    public function lowerThan($value): Conditions\Lower
69
    {
70
        return new Lower($this, $value);
71
    }
72
73
    public function lowerOrEqualThan($value): Conditions\LowerOrEqual
74
    {
75
        return new LowerOrEqual($this, $value);
76
    }
77
78
    public function between($start, $end): Conditions\Between
79
    {
80
        return new Between($this, $start, $end);
81
    }
82
83
    public function in(array $values): Conditions\In
84
    {
85
        return new In($this, $values);
86
    }
87
88
    public function isNull(): Conditions\IsNull
89
    {
90
        return new IsNull($this);
91
    }
92
93
    public function isNotNull(): Conditions\IsNotNull
94
    {
95
        return new IsNotNull($this);
96
    }
97
98
    public function notIn(array $values): Conditions\NotIn
99
    {
100
        return new NotIn($this, $values);
101
    }
102
}
103