Passed
Push — main ( b51950...376464 )
by BRUNO
02:00
created
src/CrudBuilder.php 2 patches
Indentation   +60 added lines, -60 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
     use DatalayerTrait;
18 18
 
19 19
     /**
20
-    * @var array
20
+     * @var array
21 21
      */
22 22
     private array $sqlPartsSelect = [
23 23
         'main'      => [],
@@ -37,13 +37,13 @@  discard block
 block discarded – undo
37 37
 
38 38
     /**
39 39
      *
40
-    * <code>
41
-    *   $qb = $this->select('u.id, p.id')
42
-    *           ->where('phonenumbers=?', [$number]);
43
-    * </code>
44
-    * @param string $fields
45
-    * @param array $paramns
46
-    * @return $this
40
+     * <code>
41
+     *   $qb = $this->select('u.id, p.id')
42
+     *           ->where('phonenumbers=?', [$number]);
43
+     * </code>
44
+     * @param string $fields
45
+     * @param array $paramns
46
+     * @return $this
47 47
      */
48 48
     public function selectBuilder(string $fields = "*", array $paramns = []): self
49 49
     {
@@ -59,9 +59,9 @@  discard block
 block discarded – undo
59 59
     }
60 60
 
61 61
     /**
62
-    * @param string $fields
63
-    * @param array $paramns
64
-    * @return $this
62
+     * @param string $fields
63
+     * @param array $paramns
64
+     * @return $this
65 65
      */
66 66
     protected function insertBuilder(string $fields, array $paramns): self
67 67
     {
@@ -80,9 +80,9 @@  discard block
 block discarded – undo
80 80
     }
81 81
 
82 82
     /**
83
-    * @param string $fields
84
-    * @param array $paramns
85
-    * @return $this
83
+     * @param string $fields
84
+     * @param array $paramns
85
+     * @return $this
86 86
      */
87 87
     protected function updateBuilder(string $fields, array $paramns): self
88 88
     {
@@ -103,9 +103,9 @@  discard block
 block discarded – undo
103 103
     }
104 104
 
105 105
     /**
106
-    * @param string $fields
107
-    * @param array $paramns
108
-    * @return $this
106
+     * @param string $fields
107
+     * @param array $paramns
108
+     * @return $this
109 109
      */
110 110
     protected function deleteBuilder(): self
111 111
     {
@@ -119,9 +119,9 @@  discard block
 block discarded – undo
119 119
     }
120 120
 
121 121
     /**
122
-    * @param string $query
123
-    * @param array $paramns
124
-    * @return $this
122
+     * @param string $query
123
+     * @param array $paramns
124
+     * @return $this
125 125
      */
126 126
     protected function query(string $query, array $paramns = []): self
127 127
     {
@@ -134,9 +134,9 @@  discard block
 block discarded – undo
134 134
     }
135 135
 
136 136
     /**
137
-    * @param string $texto
138
-    * @param array $paramns
139
-    * @return $this
137
+     * @param string $texto
138
+     * @param array $paramns
139
+     * @return $this
140 140
      */
141 141
     protected function where(string $texto, array $paramns = []): self
142 142
     {
@@ -150,9 +150,9 @@  discard block
 block discarded – undo
150 150
     }
151 151
 
152 152
     /**
153
-    * @param string $condition
154
-    * @param array $paramns
155
-    * @return $this
153
+     * @param string $condition
154
+     * @param array $paramns
155
+     * @return $this
156 156
      */
157 157
     protected function andWhere(string $condition, array $paramns = []): self
158 158
     {
@@ -166,9 +166,9 @@  discard block
 block discarded – undo
166 166
     }
167 167
 
168 168
     /**
169
-    * @param string $condition
170
-    * @param array $paramns
171
-    * @return $this
169
+     * @param string $condition
170
+     * @param array $paramns
171
+     * @return $this
172 172
      */
173 173
     protected function orWhere(string $condition, array $paramns = []): self
174 174
     {
@@ -182,9 +182,9 @@  discard block
 block discarded – undo
182 182
     }
183 183
 
184 184
     /**
185
-    * @param string $parameter
186
-    * @param $order
187
-    * @return $this
185
+     * @param string $parameter
186
+     * @param $order
187
+     * @return $this
188 188
      */
189 189
     protected function orderBy(string $parameter, $order = null): self
190 190
     {
@@ -198,9 +198,9 @@  discard block
 block discarded – undo
198 198
     }
199 199
 
200 200
     /**
201
-    * @param string $parameter
202
-    * @param $order
203
-    * @return $this
201
+     * @param string $parameter
202
+     * @param $order
203
+     * @return $this
204 204
      */
205 205
     protected function addOrderBy(string $parameter, $order = null): self
206 206
     {
@@ -214,8 +214,8 @@  discard block
 block discarded – undo
214 214
     }
215 215
 
216 216
     /**
217
-    * @param string $texto
218
-    * @return $this
217
+     * @param string $texto
218
+     * @return $this
219 219
      */
220 220
     protected function limit(string $texto): self
221 221
     {
@@ -225,8 +225,8 @@  discard block
 block discarded – undo
225 225
     }
226 226
 
227 227
     /**
228
-    * @param string $texto
229
-    * @return $this
228
+     * @param string $texto
229
+     * @return $this
230 230
      */
231 231
     protected function offset(string $texto): self
232 232
     {
@@ -240,8 +240,8 @@  discard block
 block discarded – undo
240 240
     }
241 241
 
242 242
     /**
243
-    * @param string $texto
244
-    * @return $this
243
+     * @param string $texto
244
+     * @return $this
245 245
      */
246 246
     protected function groupBy(string $texto): self
247 247
     {
@@ -255,8 +255,8 @@  discard block
 block discarded – undo
255 255
     }
256 256
 
257 257
     /**
258
-    * @param string $texto
259
-    * @return $this
258
+     * @param string $texto
259
+     * @return $this
260 260
      */
261 261
     protected function having(string $texto): self
262 262
     {
@@ -300,10 +300,10 @@  discard block
 block discarded – undo
300 300
     }
301 301
 
302 302
     /**
303
-    * @param string $table
304
-    * @param string $alias
305
-    * @param string $codition
306
-    * @return $this
303
+     * @param string $table
304
+     * @param string $alias
305
+     * @param string $codition
306
+     * @return $this
307 307
      */
308 308
     protected function innerJoin(string $table, string $alias, string $codition): self
309 309
     {
@@ -317,10 +317,10 @@  discard block
 block discarded – undo
317 317
     }
318 318
 
319 319
     /**
320
-    * @param string $table
321
-    * @param string $alias
322
-    * @param string $codition
323
-    * @return $this
320
+     * @param string $table
321
+     * @param string $alias
322
+     * @param string $codition
323
+     * @return $this
324 324
      */
325 325
     protected function leftJoin(string $table, string $alias, string $codition): self
326 326
     {
@@ -334,10 +334,10 @@  discard block
 block discarded – undo
334 334
     }
335 335
 
336 336
     /**
337
-    * @param string $table
338
-    * @param string $alias
339
-    * @param string $codition
340
-    * @return $this
337
+     * @param string $table
338
+     * @param string $alias
339
+     * @param string $codition
340
+     * @return $this
341 341
      */
342 342
     protected function rightJoin(string $table, string $alias, string $codition): self
343 343
     {
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
     }
376 376
 
377 377
     /**
378
-    * @return void
378
+     * @return void
379 379
      */
380 380
     protected function debug(): void
381 381
     {
@@ -389,10 +389,10 @@  discard block
 block discarded – undo
389 389
 
390 390
 
391 391
     /**
392
-    * @param string $query
393
-    * @param string $type
394
-    * @param array $params
395
-    * @return void
392
+     * @param string $query
393
+     * @param string $type
394
+     * @param array $params
395
+     * @return void
396 396
      */
397 397
     private function add(string $query, string $type, array $params = []): void
398 398
     {
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -49,8 +49,9 @@  discard block
 block discarded – undo
49 49
     {
50 50
         try {
51 51
             $query = "SELECT {$fields} FROM {$this->getTable()}";
52
-            if (!empty($this->getTableAlias()))
53
-                $query .= " AS {$this->getTableAlias()}";
52
+            if (!empty($this->getTableAlias())) {
53
+                            $query .= " AS {$this->getTableAlias()}";
54
+            }
54 55
             $this->add($query, "main", $paramns);
55 56
             return $this;
56 57
         } catch (\PDOException $e) {
@@ -404,8 +405,9 @@  discard block
 block discarded – undo
404 405
                 $this->sqlPartsSelect[$type] = $query;
405 406
             }
406 407
 
407
-            if (!empty($params))
408
-                $this->setParameter($params);
408
+            if (!empty($params)) {
409
+                            $this->setParameter($params);
410
+            }
409 411
         } catch (\PDOException $e) {
410 412
             $this->setError($e);
411 413
         }
Please login to merge, or discard this patch.
example/ExampleDao.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
     public function findName(): array {
16 16
         $this->selectBuilder()
17
-            ->where("NOME=?",["Joao"])
17
+            ->where("NOME=?", ["Joao"])
18 18
             ->orderBy("NOME")
19 19
             ->executeQuery()
20 20
             ->fetchArrayAssoc();
Please login to merge, or discard this patch.