Passed
Push — master ( 6a4462...5500dc )
by y
01:44
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
         switch ($this->db) {
19 19
             case 'sqlite':
20 20
                 return new Numeric($this->db, "CAST({$this} AS REAL)");
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
      *
29 29
      * @return Numeric
30 30
      */
31
-    public function toInt () {
31
+    public function toInt() {
32 32
         switch ($this->db) {
33 33
             case 'sqlite':
34 34
                 return new Numeric($this->db, "CAST({$this} AS INTEGER)");
Please login to merge, or discard this patch.
src/DB/SQL/ComparisonTrait.php 2 patches
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -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 new Value($this->db, "COALESCE({$values})");
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
      * @param array $values `[when => then]`
41 41
      * @return Choice
42 42
      */
43
-    public function getChoice (array $values) {
43
+    public function getChoice(array $values) {
44 44
         return new Choice($this->db, "{$this}", $values);
45 45
     }
46 46
 
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
      * @param null|bool|number|string|Select $arg
54 54
      * @return Predicate
55 55
      */
56
-    public function is ($arg): Predicate {
56
+    public function is($arg): Predicate {
57 57
         if ($arg === null or is_bool($arg)) {
58 58
             $arg = ['' => 'NULL', 1 => 'TRUE', 0 => 'FALSE'][$arg];
59 59
         }
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
      * @param number|string $max
80 80
      * @return Predicate
81 81
      */
82
-    public function isBetween ($min, $max) {
82
+    public function isBetween($min, $max) {
83 83
         $min = $this->db->quote($min);
84 84
         $max = $this->db->quote($max);
85 85
         return new Predicate("{$this} BETWEEN {$min} AND {$max}");
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
      * @param bool|number|string|array|Select $arg
92 92
      * @return Predicate
93 93
      */
94
-    public function isEqual ($arg) {
94
+    public function isEqual($arg) {
95 95
         return Predicate::compare($this, $this->db->quoteMixed($arg));
96 96
     }
97 97
 
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
      * @param number|string|Select $arg
105 105
      * @return Predicate
106 106
      */
107
-    public function isGreater ($arg) {
107
+    public function isGreater($arg) {
108 108
         if ($arg instanceof Select and $this->db == 'sqlite') {
109 109
             $sub = new Select($this->db, $arg, [$arg[0]]);
110 110
             return $sub->where("{$this} <= {$arg[0]}")->isNotCorrelated();
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
      * @param number|string|Select $arg
122 122
      * @return Predicate
123 123
      */
124
-    public function isGreaterOrEqual ($arg) {
124
+    public function isGreaterOrEqual($arg) {
125 125
         if ($arg instanceof Select and $this->db == 'sqlite') {
126 126
             $sub = new Select($this->db, $arg, [$arg[0]]);
127 127
             return $sub->where("{$this} < {$arg[0]}")->isNotCorrelated();
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
      * @param number|string|Select $arg
139 139
      * @return Predicate
140 140
      */
141
-    public function isLess ($arg) {
141
+    public function isLess($arg) {
142 142
         if ($arg instanceof Select and $this->db == 'sqlite') {
143 143
             $sub = new Select($this->db, $arg, [$arg[0]]);
144 144
             return $sub->where("{$this} >= {$arg[0]}")->isNotCorrelated();
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
      * @param number|string|Select $arg
156 156
      * @return Predicate
157 157
      */
158
-    public function isLessOrEqual ($arg) {
158
+    public function isLessOrEqual($arg) {
159 159
         if ($arg instanceof Select and $this->db == 'sqlite') {
160 160
             $sub = new Select($this->db, $arg, [$arg[0]]);
161 161
             return $sub->where("{$this} > {$arg[0]}")->isNotCorrelated();
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
      * @param string $pattern
170 170
      * @return Predicate
171 171
      */
172
-    public function isLike (string $pattern) {
172
+    public function isLike(string $pattern) {
173 173
         $pattern = $this->db->quote($pattern);
174 174
         return new Predicate("{$this} LIKE {$pattern}");
175 175
     }
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
      * @param null|bool|number|string|Select $arg
181 181
      * @return Predicate
182 182
      */
183
-    public function isNot ($arg) {
183
+    public function isNot($arg) {
184 184
         return $this->is($arg)->invert();
185 185
     }
186 186
 
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
      * @param number|string $max
192 192
      * @return Predicate
193 193
      */
194
-    public function isNotBetween ($min, $max) {
194
+    public function isNotBetween($min, $max) {
195 195
         $min = $this->db->quote($min);
196 196
         $max = $this->db->quote($max);
197 197
         return new Predicate("{$this} NOT BETWEEN {$min} AND {$max}");
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
      * @param bool|number|string|array|Select $arg
204 204
      * @return Predicate
205 205
      */
206
-    public function isNotEqual ($arg) {
206
+    public function isNotEqual($arg) {
207 207
 
208 208
         return Predicate::compare($this, $this->db->quoteMixed($arg), '<>', 'NOT IN');
209 209
     }
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
      * @param string $pattern
215 215
      * @return Predicate
216 216
      */
217
-    public function isNotLike (string $pattern) {
217
+    public function isNotLike(string $pattern) {
218 218
         $pattern = $this->db->quote($pattern);
219 219
         return new Predicate("{$this} NOT LIKE {$pattern}");
220 220
     }
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
      * @param string $pattern
226 226
      * @return Predicate
227 227
      */
228
-    public function isNotRegExp (string $pattern) {
228
+    public function isNotRegExp(string $pattern) {
229 229
         $pattern = $this->db->quote($pattern);
230 230
         return new Predicate("{$this} NOT REGEXP {$pattern}");
231 231
     }
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
      * @param string $pattern
237 237
      * @return Predicate
238 238
      */
239
-    public function isRegExp (string $pattern) {
239
+    public function isRegExp(string $pattern) {
240 240
         $pattern = $this->db->quote($pattern);
241 241
         return new Predicate("{$this} REGEXP {$pattern}");
242 242
     }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -56,8 +56,7 @@
 block discarded – undo
56 56
     public function is ($arg): Predicate {
57 57
         if ($arg === null or is_bool($arg)) {
58 58
             $arg = ['' => 'NULL', 1 => 'TRUE', 0 => 'FALSE'][$arg];
59
-        }
60
-        else {
59
+        } else {
61 60
             $arg = $this->db->quote($arg);
62 61
         }
63 62
         switch ($this->db) {
Please login to merge, or discard this patch.
src/DB/SQL/TextTrait.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
     /**
18 18
      * @return Text
19 19
      */
20
-    public function getHex () {
20
+    public function getHex() {
21 21
         return new Text($this->db, "HEX({$this})");
22 22
     }
23 23
 
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
      *
29 29
      * @return Numeric
30 30
      */
31
-    public function getLength () {
31
+    public function getLength() {
32 32
         switch ($this->db) {
33 33
             case 'sqlite':
34 34
                 return new Numeric($this->db, "LENGTH(CAST({$this} AS TEXT))");
@@ -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 new Text($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
         switch ($this->db) {
60 60
             case 'sqlite':
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
      * @param string $replace
72 72
      * @return Text
73 73
      */
74
-    public function getReplacement (string $search, string $replace) {
74
+    public function getReplacement(string $search, string $replace) {
75 75
         $search = $this->db->quote($search);
76 76
         $replace = $this->db->quote($replace);
77 77
         return new Text($this->db, "REPLACE({$this},{$search},{$replace})");
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
      *
83 83
      * @return Numeric
84 84
      */
85
-    public function getSize () {
85
+    public function getSize() {
86 86
         switch ($this->db) {
87 87
             case 'sqlite':
88 88
                 return new Numeric($this->db, "LENGTH(CAST({$this} AS BLOB))");
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
      * @param int $length
99 99
      * @return Text
100 100
      */
101
-    public function getSubstring (int $start, int $length = null) {
101
+    public function getSubstring(int $start, int $length = null) {
102 102
         if (isset($length)) {
103 103
             return new Text($this->db, "SUBSTR({$this},{$start},{$length})");
104 104
         }
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
      *
111 111
      * @return Text
112 112
      */
113
-    public function getUpper () {
113
+    public function getUpper() {
114 114
         return new Text($this->db, "UPPER({$this})");
115 115
     }
116 116
 }
117 117
\ No newline at end of file
Please login to merge, or discard this patch.
src/DB/SQL/AggregateTrait.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
      * @param string $aggregate `ALL|DISTINCT`
21 21
      * @return Numeric
22 22
      */
23
-    public function getAvg ($aggregate = 'ALL') {
23
+    public function getAvg($aggregate = 'ALL') {
24 24
         return new Numeric($this->db, "AVG({$aggregate} {$this})");
25 25
     }
26 26
 
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
      * @param string $delimiter
31 31
      * @return Text
32 32
      */
33
-    public function getConcat (string $delimiter = ',') {
33
+    public function getConcat(string $delimiter = ',') {
34 34
         $delimiter = $this->db->quote($delimiter);
35 35
         switch ($this->db) {
36 36
             case 'sqlite':
@@ -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 new Numeric($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 new Numeric($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 new Numeric($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 new Numeric($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/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 == 'sqlite') {
19 19
             return new Text($this->db, "CAST({$this} AS TEXT)");
20 20
         }
Please login to merge, or discard this patch.