ExpressionFactory::notEquals()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 3
c 0
b 0
f 0
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 1
nc 1
nop 2
crap 1
1
<?php
2
3
namespace Xsolve\SalesforceClient\QueryBuilder\Expr;
4
5
use Xsolve\SalesforceClient\Enum\AbstractSObjectType;
6
use Xsolve\SalesforceClient\QueryBuilder\Query;
7
8
class ExpressionFactory
9
{
10
    /**
11
     * @param string[] $fields
12
     *
13
     * @return Select\Fields
14
     */
15 4
    public function fields(array $fields): Select\Fields
16
    {
17 4
        return new Select\Fields($fields);
18
    }
19
20 2
    public function count(string $countedValue = null): Select\Count
21
    {
22 2
        return new Select\Count($countedValue);
23
    }
24
25 2
    public function inner(Query $innerQuery): Select\Inner
26
    {
27 2
        return new Select\Inner($innerQuery);
28
    }
29
30 4
    public function grouping(string $source, string $target = ''): Select\Grouping
31
    {
32 4
        if (empty($target)) {
33 3
            $target = sprintf('grp_%s', $source);
34
        }
35
36 4
        return new Select\Grouping($source, $target);
37
    }
38
39 2
    public function groupings(array $values): Select\MultipleGrouping
40
    {
41 2
        $array = [];
42
43 2
        foreach ($values as $key => $value) {
44 2
            if (is_int($key)) {
45 2
                $array[] = $this->grouping($value);
46 2
                continue;
47
            }
48
49 2
            $array[] = $this->grouping($key, $value);
50
        }
51
52 2
        return new Select\MultipleGrouping($array);
53
    }
54
55 4
    public function objectType(AbstractSObjectType $objectType): From\ObjectType
56
    {
57 4
        return new From\ObjectType($objectType);
58
    }
59
60 2
    public function equals(string $left, string $right): Compare\Equals
61
    {
62 2
        return new Compare\Equals($left, $right);
63
    }
64
65 2
    public function greaterThan(string $left, string $right): Compare\GreaterThan
66
    {
67 2
        return new Compare\GreaterThan($left, $right);
68
    }
69
70 2
    public function greaterThanOrEquals(string $left, string $right): Compare\GreaterThanOrEquals
71
    {
72 2
        return new Compare\GreaterThanOrEquals($left, $right);
73
    }
74
75 2
    public function in(string $left, array $values): Compare\In
76
    {
77 2
        return new Compare\In($left, $values);
78
    }
79
80 2
    public function lessThan(string $left, string $right): Compare\LessThan
81
    {
82 2
        return new Compare\LessThan($left, $right);
83
    }
84
85 2
    public function lessThanOrEquals(string $left, string $right): Compare\LessThanOrEquals
86
    {
87 2
        return new Compare\LessThanOrEquals($left, $right);
88
    }
89
90 2
    public function like(string $left, string $right): Compare\Like
91
    {
92 2
        return new Compare\Like($left, $right);
93
    }
94
95 1
    public function notEquals(string $left, string $right): Compare\NotEquals
96
    {
97 1
        return new Compare\NotEquals($left, $right);
98
    }
99
100 1
    public function notIn(string $left, array $values): Compare\NotIn
101
    {
102 1
        return new Compare\NotIn($left, $values);
103
    }
104
105 2
    public function groupBy(string ...$fields): GroupBy\Fields
106
    {
107 2
        return new GroupBy\Fields($fields);
108
    }
109
110 1
    public function groupByRollup(string ...$fields): GroupBy\Rollup
111
    {
112 1
        return new GroupBy\Rollup($fields);
113
    }
114
115 1
    public function groupByCube(string ...$fields): GroupBy\Cube
116
    {
117 1
        return new GroupBy\Cube($fields);
118
    }
119
120 2
    public function orderBy(array $values, OrderBy\Order $order = null, OrderBy\Strategy $strategy = null): OrderBy\OrderBy
121
    {
122 2
        return new OrderBy\OrderBy($values, $order, $strategy);
123
    }
124
125 1
    public function typeof(string $field): Select\Typeof
126
    {
127 1
        return new Select\Typeof($field);
128
    }
129
}
130