Passed
Push — master ( e92e1f...a725e0 )
by y
06:32
created
src/DB/SQL/Text.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
      *
15 15
      * @return Numeric
16 16
      */
17
-    public function toFloat () {
17
+    public function toFloat() {
18 18
         if ($this->db->isSQLite()) {
19 19
             return Numeric::factory($this->db, "CAST({$this} AS REAL)");
20 20
         }
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
      *
27 27
      * @return Numeric
28 28
      */
29
-    public function toInt () {
29
+    public function toInt() {
30 30
         if ($this->db->isSQLite()) {
31 31
             return Numeric::factory($this->db, "CAST({$this} AS INTEGER)");
32 32
         }
Please login to merge, or discard this patch.
src/DB/SQL/NumericTrait.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  */
10 10
 trait NumericTrait {
11 11
 
12
-    abstract public function __toString ();
12
+    abstract public function __toString();
13 13
 
14 14
     /**
15 15
      * @var DB
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
      *
22 22
      * @return Numeric
23 23
      */
24
-    public function abs () {
24
+    public function abs() {
25 25
         return Numeric::factory($this->db, "ABS({$this})");
26 26
     }
27 27
 
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
      * @param number|ValueInterface $arg
32 32
      * @return Numeric
33 33
      */
34
-    public function add ($arg) {
34
+    public function add($arg) {
35 35
         return Numeric::factory($this->db, "({$this} + {$arg})");
36 36
     }
37 37
 
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
      *
41 41
      * @return Numeric
42 42
      */
43
-    public function ceil () {
43
+    public function ceil() {
44 44
         return Numeric::factory($this->db, "CEIL({$this})");
45 45
     }
46 46
 
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
      * @param number|ValueInterface $arg
51 51
      * @return Numeric
52 52
      */
53
-    public function divide ($arg) {
53
+    public function divide($arg) {
54 54
         return Numeric::factory($this->db, "({$this} / {$arg})");
55 55
     }
56 56
 
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
      *
60 60
      * @return Numeric
61 61
      */
62
-    public function floor () {
62
+    public function floor() {
63 63
         return Numeric::factory($this->db, "FLOOR({$this})");
64 64
     }
65 65
 
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
      *
69 69
      * @return Predicate
70 70
      */
71
-    public function isEven () {
71
+    public function isEven() {
72 72
         return Predicate::factory($this->db, "({$this} % 2) = 0");
73 73
     }
74 74
 
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
      *
78 78
      * @return Predicate
79 79
      */
80
-    public function isNegative () {
80
+    public function isNegative() {
81 81
         return Predicate::factory($this->db, "{$this} < 0");
82 82
     }
83 83
 
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
      *
87 87
      * @return Predicate
88 88
      */
89
-    public function isOdd () {
89
+    public function isOdd() {
90 90
         return Predicate::factory($this->db, "({$this} % 2) <> 0");
91 91
     }
92 92
 
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
      *
96 96
      * @return Predicate
97 97
      */
98
-    public function isPositive () {
98
+    public function isPositive() {
99 99
         return Predicate::factory($this->db, "{$this} > 0");
100 100
     }
101 101
 
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
      * @param number|ValueInterface $arg
106 106
      * @return Numeric
107 107
      */
108
-    public function modulo ($arg) {
108
+    public function modulo($arg) {
109 109
         return Numeric::factory($this->db, "({$this} % {$arg})");
110 110
     }
111 111
 
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
      * @param number|ValueInterface $arg
116 116
      * @return Numeric
117 117
      */
118
-    public function multiply ($arg) {
118
+    public function multiply($arg) {
119 119
         return Numeric::factory($this->db, "({$this} * {$arg})");
120 120
     }
121 121
 
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
      * @param number|ValueInterface $exponent
126 126
      * @return Numeric
127 127
      */
128
-    public function pow ($exponent) {
128
+    public function pow($exponent) {
129 129
         return Numeric::factory($this->db, "POW({$this},{$exponent})");
130 130
     }
131 131
 
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
      * @param int $decimals
136 136
      * @return Numeric
137 137
      */
138
-    public function round (int $decimals = 0) {
138
+    public function round(int $decimals = 0) {
139 139
         return Numeric::factory($this->db, "ROUND({$this},{$decimals})");
140 140
     }
141 141
 
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
      * @param number|ValueInterface $arg
146 146
      * @return Numeric
147 147
      */
148
-    public function subtract (ValueInterface $arg) {
148
+    public function subtract(ValueInterface $arg) {
149 149
         return Numeric::factory($this->db, "({$this} - {$arg})");
150 150
     }
151 151
 }
152 152
\ No newline at end of file
Please login to merge, or discard this patch.
src/DB/SQL/Numeric.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
      *
15 15
      * @return Text
16 16
      */
17
-    public function toText () {
17
+    public function toText() {
18 18
         if ($this->db->isSQLite()) {
19 19
             return Text::factory($this->db, "CAST({$this} AS TEXT)");
20 20
         }
Please login to merge, or discard this patch.
src/DB/SQL/Predicate.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
      *
13 13
      * @return static
14 14
      */
15
-    public function not () {
15
+    public function not() {
16 16
         return static::factory($this->db, "NOT({$this})");
17 17
     }
18 18
 
Please login to merge, or discard this patch.
src/DB/SQL/Expression.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
      * @param DB $db
29 29
      * @param string $expression
30 30
      */
31
-    public function __construct (DB $db, string $expression) {
31
+    public function __construct(DB $db, string $expression) {
32 32
         $this->db = $db;
33 33
         $this->expression = $expression;
34 34
     }
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
     /**
37 37
      * @return string
38 38
      */
39
-    public function __toString () {
39
+    public function __toString() {
40 40
         return $this->expression;
41 41
     }
42 42
 }
43 43
\ No newline at end of file
Please login to merge, or discard this patch.
src/DB/SQL/Choice.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
      * @param null|string $subject
60 60
      * @param array $values `[when => then]` for the subject.
61 61
      */
62
-    public function __construct (DB $db, string $subject = null, array $values = []) {
62
+    public function __construct(DB $db, string $subject = null, array $values = []) {
63 63
         parent::__construct($db, '');
64 64
         $this->subject = $subject;
65 65
         $this->whenValues($values);
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
     /**
69 69
      * @return string
70 70
      */
71
-    public function __toString () {
71
+    public function __toString() {
72 72
         $sql = 'CASE';
73 73
         if (isset($this->subject)) {
74 74
             $sql .= " {$this->subject}";
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
      * @param string|ValueInterface $then
100 100
      * @return $this
101 101
      */
102
-    public function when ($expression, $then) {
102
+    public function when($expression, $then) {
103 103
         $this->values[$this->db->quote($expression)] = $this->db->quote($then);
104 104
         return $this;
105 105
     }
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
      * @param array $values `[when => then]`
114 114
      * @return $this
115 115
      */
116
-    public function whenValues (array $values) {
116
+    public function whenValues(array $values) {
117 117
         foreach ($values as $when => $then) {
118 118
             $this->when($when, $then);
119 119
         }
Please login to merge, or discard this patch.
src/DB/SQL/AggregateTrait.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  */
10 10
 trait AggregateTrait {
11 11
 
12
-    abstract public function __toString ();
12
+    abstract public function __toString();
13 13
 
14 14
     /**
15 15
      * @var DB
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
      * @param string $aggregate `ALL|DISTINCT`
23 23
      * @return Numeric
24 24
      */
25
-    public function getAvg (string $aggregate = 'ALL') {
25
+    public function getAvg(string $aggregate = 'ALL') {
26 26
         return Numeric::factory($this->db, "AVG({$aggregate} {$this})");
27 27
     }
28 28
 
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
      * @param string $delimiter
33 33
      * @return Text
34 34
      */
35
-    public function getConcat (string $delimiter = ',') {
35
+    public function getConcat(string $delimiter = ',') {
36 36
         $delimiter = $this->db->quote($delimiter);
37 37
         if ($this->db->isSQLite()) {
38 38
             return Text::factory($this->db, "GROUP_CONCAT({$this},{$delimiter})");
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
      * @param string $aggregate `ALL|DISTINCT`
47 47
      * @return Numeric
48 48
      */
49
-    public function getCount (string $aggregate = 'ALL') {
49
+    public function getCount(string $aggregate = 'ALL') {
50 50
         return Numeric::factory($this->db, "COUNT({$aggregate} {$this})");
51 51
     }
52 52
 
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
      *
56 56
      * @return Numeric
57 57
      */
58
-    public function getMax () {
58
+    public function getMax() {
59 59
         return Numeric::factory($this->db, "MAX({$this})");
60 60
     }
61 61
 
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
      *
65 65
      * @return Numeric
66 66
      */
67
-    public function getMin () {
67
+    public function getMin() {
68 68
         return Numeric::factory($this->db, "MIN({$this})");
69 69
     }
70 70
 
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
      * @param string $aggregate `ALL|DISTINCT`
75 75
      * @return Numeric
76 76
      */
77
-    public function getSum (string $aggregate = 'ALL') {
77
+    public function getSum(string $aggregate = 'ALL') {
78 78
         return Numeric::factory($this->db, "SUM({$aggregate} {$this})");
79 79
     }
80 80
 }
81 81
\ No newline at end of file
Please login to merge, or discard this patch.
src/DB/SQL/TextTrait.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  */
10 10
 trait TextTrait {
11 11
 
12
-    abstract public function __toString ();
12
+    abstract public function __toString();
13 13
 
14 14
     /**
15 15
      * @var DB
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
     /**
20 20
      * @return Text
21 21
      */
22
-    public function getHex () {
22
+    public function getHex() {
23 23
         return Text::factory($this->db, "HEX({$this})");
24 24
     }
25 25
 
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
      *
31 31
      * @return Numeric
32 32
      */
33
-    public function getLength () {
33
+    public function getLength() {
34 34
         if ($this->db->isSQLite()) {
35 35
             return Numeric::factory($this->db, "LENGTH(CAST({$this} AS TEXT))");
36 36
         }
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
      *
43 43
      * @return Text
44 44
      */
45
-    public function getLower () {
45
+    public function getLower() {
46 46
         return Text::factory($this->db, "LOWER({$this})");
47 47
     }
48 48
 
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
      * @param string $substring
55 55
      * @return Numeric
56 56
      */
57
-    public function getPosition (string $substring) {
57
+    public function getPosition(string $substring) {
58 58
         $substring = $this->db->quote($substring);
59 59
         if ($this->db->isSQLite()) {
60 60
             return Numeric::factory($this->db, "INSTR({$this},{$substring})");
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
      * @param string $replace
70 70
      * @return Text
71 71
      */
72
-    public function getReplacement (string $search, string $replace) {
72
+    public function getReplacement(string $search, string $replace) {
73 73
         $search = $this->db->quote($search);
74 74
         $replace = $this->db->quote($replace);
75 75
         return Text::factory($this->db, "REPLACE({$this},{$search},{$replace})");
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
      *
81 81
      * @return Numeric
82 82
      */
83
-    public function getSize () {
83
+    public function getSize() {
84 84
         if ($this->db->isSQLite()) {
85 85
             return Numeric::factory($this->db, "LENGTH(CAST({$this} AS BLOB))");
86 86
         }
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
      * @param null|int $length
95 95
      * @return Text
96 96
      */
97
-    public function getSubstring (int $start, int $length = null) {
97
+    public function getSubstring(int $start, int $length = null) {
98 98
         if (isset($length)) {
99 99
             return Text::factory($this->db, "SUBSTR({$this},{$start},{$length})");
100 100
         }
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
      *
107 107
      * @return Text
108 108
      */
109
-    public function getUpper () {
109
+    public function getUpper() {
110 110
         return Text::factory($this->db, "UPPER({$this})");
111 111
     }
112 112
 }
113 113
\ No newline at end of file
Please login to merge, or discard this patch.
src/DB/SQL/ComparisonTrait.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
  */
16 16
 trait ComparisonTrait {
17 17
 
18
-    abstract public function __toString ();
18
+    abstract public function __toString();
19 19
 
20 20
     /**
21 21
      * @var DB
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
      * @param array $values
29 29
      * @return Value
30 30
      */
31
-    public function coalesce (array $values) {
31
+    public function coalesce(array $values) {
32 32
         array_unshift($values, $this);
33 33
         $values = $this->db->quoteList($values);
34 34
         return Value::factory($this->db, "COALESCE({$values})");
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
      * @param null|bool|number|string|Select $arg
44 44
      * @return Predicate
45 45
      */
46
-    public function is ($arg): Predicate {
46
+    public function is($arg): Predicate {
47 47
         if ($arg instanceof Select) {
48 48
             if ($this->db->isSQLite()) {
49 49
                 return Select::factory($this->db, $arg, [$arg[0]])
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
      * @param number $max
72 72
      * @return Predicate
73 73
      */
74
-    public function isBetween ($min, $max) {
74
+    public function isBetween($min, $max) {
75 75
         $min = $this->db->quote($min);
76 76
         $max = $this->db->quote($max);
77 77
         return Predicate::factory($this->db, "{$this} BETWEEN {$min} AND {$max}");
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
      * @param bool|number|string|array|Select $arg
84 84
      * @return Predicate
85 85
      */
86
-    public function isEqual ($arg) {
86
+    public function isEqual($arg) {
87 87
         return $this->db->match($this, $arg);
88 88
     }
89 89
 
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
      *
93 93
      * @return Predicate
94 94
      */
95
-    public function isFalse () {
95
+    public function isFalse() {
96 96
         return Predicate::factory($this->db, "{$this} IS FALSE");
97 97
     }
98 98
 
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
      * @param string $multi `ALL|ANY`
109 109
      * @return Predicate
110 110
      */
111
-    public function isGreater ($arg, string $multi = 'ALL') {
111
+    public function isGreater($arg, string $multi = 'ALL') {
112 112
         if ($arg instanceof Select) {
113 113
             if ($this->db->isSQLite()) {
114 114
                 $sub = Select::factory($this->db, $arg, [$arg[0]]);
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
      * @param string $multi `ALL|ANY`
135 135
      * @return Predicate
136 136
      */
137
-    public function isGreaterOrEqual ($arg, string $multi = 'ALL') {
137
+    public function isGreaterOrEqual($arg, string $multi = 'ALL') {
138 138
         if ($arg instanceof Select) {
139 139
             if ($this->db->isSQLite()) {
140 140
                 $sub = Select::factory($this->db, $arg, [$arg[0]]);
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
      * @param string $multi `ALL|ANY`
161 161
      * @return Predicate
162 162
      */
163
-    public function isLess ($arg, string $multi = 'ALL') {
163
+    public function isLess($arg, string $multi = 'ALL') {
164 164
         if ($arg instanceof Select) {
165 165
             if ($this->db->isSQLite()) {
166 166
                 $sub = Select::factory($this->db, $arg, [$arg[0]]);
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
      * @param string $multi `ALL|ANY`
187 187
      * @return Predicate
188 188
      */
189
-    public function isLessOrEqual ($arg, string $multi = 'ALL') {
189
+    public function isLessOrEqual($arg, string $multi = 'ALL') {
190 190
         if ($arg instanceof Select) {
191 191
             if ($this->db->isSQLite()) {
192 192
                 $sub = Select::factory($this->db, $arg, [$arg[0]]);
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
      * @param string $pattern
207 207
      * @return Predicate
208 208
      */
209
-    public function isLike (string $pattern) {
209
+    public function isLike(string $pattern) {
210 210
         $pattern = $this->db->quote($pattern);
211 211
         return Predicate::factory($this->db, "{$this} LIKE {$pattern}");
212 212
     }
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
      * @param null|bool|number|string|Select $arg
218 218
      * @return Predicate
219 219
      */
220
-    public function isNot ($arg) {
220
+    public function isNot($arg) {
221 221
         return $this->is($arg)->not();
222 222
     }
223 223
 
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
      * @param number $max
229 229
      * @return Predicate
230 230
      */
231
-    public function isNotBetween ($min, $max) {
231
+    public function isNotBetween($min, $max) {
232 232
         $min = $this->db->quote($min);
233 233
         $max = $this->db->quote($max);
234 234
         return Predicate::factory($this->db, "{$this} NOT BETWEEN {$min} AND {$max}");
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
      * @param bool|number|string|array|Select $arg
241 241
      * @return Predicate
242 242
      */
243
-    public function isNotEqual ($arg) {
243
+    public function isNotEqual($arg) {
244 244
         if ($arg instanceof Select) {
245 245
             return Predicate::factory($this->db, "{$this} NOT IN ({$arg->toSql()})");
246 246
         }
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
      * @param string $pattern
257 257
      * @return Predicate
258 258
      */
259
-    public function isNotLike (string $pattern) {
259
+    public function isNotLike(string $pattern) {
260 260
         $pattern = $this->db->quote($pattern);
261 261
         return Predicate::factory($this->db, "{$this} NOT LIKE {$pattern}");
262 262
     }
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
      *
267 267
      * @return Predicate
268 268
      */
269
-    public function isNotNull () {
269
+    public function isNotNull() {
270 270
         return Predicate::factory($this->db, "{$this} IS NOT NULL");
271 271
     }
272 272
 
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
      * @param string $pattern
277 277
      * @return Predicate
278 278
      */
279
-    public function isNotRegExp (string $pattern) {
279
+    public function isNotRegExp(string $pattern) {
280 280
         $pattern = $this->db->quote($pattern);
281 281
         return Predicate::factory($this->db, "{$this} NOT REGEXP {$pattern}");
282 282
     }
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
      *
287 287
      * @return Predicate
288 288
      */
289
-    public function isNull () {
289
+    public function isNull() {
290 290
         return Predicate::factory($this->db, "{$this} IS NULL");
291 291
     }
292 292
 
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
      * @param string $pattern
297 297
      * @return Predicate
298 298
      */
299
-    public function isRegExp (string $pattern) {
299
+    public function isRegExp(string $pattern) {
300 300
         $pattern = $this->db->quote($pattern);
301 301
         return Predicate::factory($this->db, "{$this} REGEXP {$pattern}");
302 302
     }
Please login to merge, or discard this patch.