Passed
Push — main ( 3796a3...bdf2d0 )
by A
02:22
created
config/navbar/header.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2
-if ($_SESSION["acronym"] ?? null) {
3
-    $status = $_SESSION["status"];
2
+if ($_SESSION[ "acronym" ] ?? null) {
3
+    $status = $_SESSION[ "status" ];
4 4
     $questions = [
5 5
         "text" => "Frågor",
6 6
         "url" => "user/questions",
Please login to merge, or discard this patch.
src/DatabaseActiveRecord/ActiveRecordModel.php 2 patches
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -135,11 +135,11 @@  discard block
 block discarded – undo
135 135
         $this->checkDb();
136 136
         $params = is_array($value) ? $value : [$value];
137 137
         $this->db->connect()
138
-                 ->select()
139
-                 ->from($this ->tableName)
140
-                 ->where($where)
141
-                 ->execute($params)
142
-                 ->fetchInto($this);
138
+                    ->select()
139
+                    ->from($this ->tableName)
140
+                    ->where($where)
141
+                    ->execute($params)
142
+                    ->fetchInto($this);
143 143
         return $this;
144 144
     }
145 145
 
@@ -242,8 +242,8 @@  discard block
 block discarded – undo
242 242
         $values  = array_values($properties);
243 243
 
244 244
         $this->db->connect()
245
-                 ->insert($this->tableName, $columns)
246
-                 ->execute($values);
245
+                    ->insert($this->tableName, $columns)
246
+                    ->execute($values);
247 247
 
248 248
         $this->{$this->tableIdColumn} = $this->db->lastInsertId();
249 249
     }
@@ -265,9 +265,9 @@  discard block
 block discarded – undo
265 265
         $values[] = $this->{$this->tableIdColumn};
266 266
 
267 267
         $this->db->connect()
268
-                 ->update($this->tableName, $columns)
269
-                 ->where("{$this->tableIdColumn} = ?")
270
-                 ->execute($values);
268
+                    ->update($this->tableName, $columns)
269
+                    ->where("{$this->tableIdColumn} = ?")
270
+                    ->execute($values);
271 271
     }
272 272
 
273 273
 
@@ -299,9 +299,9 @@  discard block
 block discarded – undo
299 299
         $values = array_merge($values, $values1);
300 300
 
301 301
         $this->db->connect()
302
-                 ->update($this->tableName, $columns)
303
-                 ->where($where)
304
-                 ->execute($values);
302
+                    ->update($this->tableName, $columns)
303
+                    ->where($where)
304
+                    ->execute($values);
305 305
     }
306 306
 
307 307
 
@@ -321,9 +321,9 @@  discard block
 block discarded – undo
321 321
         $id = $id ?: $this->{$this->tableIdColumn};
322 322
 
323 323
         $this->db->connect()
324
-                 ->deleteFrom($this->tableName)
325
-                 ->where("{$this->tableIdColumn} = ?")
326
-                 ->execute([$id]);
324
+                    ->deleteFrom($this->tableName)
325
+                    ->where("{$this->tableIdColumn} = ?")
326
+                    ->execute([$id]);
327 327
 
328 328
         $this->{$this->tableIdColumn} = null;
329 329
     }
@@ -352,8 +352,8 @@  discard block
 block discarded – undo
352 352
         $values = is_array($value) ? $value : [$value];
353 353
 
354 354
         $this->db->connect()
355
-                 ->deleteFrom($this->tableName)
356
-                 ->where($where)
357
-                 ->execute($values);
355
+                    ->deleteFrom($this->tableName)
356
+                    ->where($where)
357
+                    ->execute($values);
358 358
     }
359 359
 }
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -72,10 +72,10 @@  discard block
 block discarded – undo
72 72
     {
73 73
         $properties = get_object_vars($this);
74 74
         unset(
75
-            $properties['tableName'],
76
-            $properties['db'],
77
-            $properties['di'],
78
-            $properties['tableIdColumn']
75
+            $properties[ 'tableName' ],
76
+            $properties[ 'db' ],
77
+            $properties[ 'di' ],
78
+            $properties[ 'tableIdColumn' ]
79 79
         );
80 80
         return $properties;
81 81
     }
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
     public function findWhere($where, $value) : object
134 134
     {
135 135
         $this->checkDb();
136
-        $params = is_array($value) ? $value : [$value];
136
+        $params = is_array($value) ? $value : [ $value ];
137 137
         $this->db->connect()
138 138
                  ->select()
139 139
                  ->from($this ->tableName)
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
     public function findAllWhere($where, $value)
180 180
     {
181 181
         $this->checkDb();
182
-        $params = is_array($value) ? $value : [$value];
182
+        $params = is_array($value) ? $value : [ $value ];
183 183
         return $this->db->connect()
184 184
                         ->select()
185 185
                         ->from($this->tableName)
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
     {
238 238
         $this->checkDb();
239 239
         $properties = $this->getProperties();
240
-        unset($properties[$this->tableIdColumn]);
240
+        unset($properties[ $this->tableIdColumn ]);
241 241
         $columns = array_keys($properties);
242 242
         $values  = array_values($properties);
243 243
 
@@ -259,10 +259,10 @@  discard block
 block discarded – undo
259 259
     {
260 260
         $this->checkDb();
261 261
         $properties = $this->getProperties();
262
-        unset($properties[$this->tableIdColumn]);
262
+        unset($properties[ $this->tableIdColumn ]);
263 263
         $columns = array_keys($properties);
264 264
         $values  = array_values($properties);
265
-        $values[] = $this->{$this->tableIdColumn};
265
+        $values[ ] = $this->{$this->tableIdColumn};
266 266
 
267 267
         $this->db->connect()
268 268
                  ->update($this->tableName, $columns)
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
         $values  = array_values($properties);
296 296
         $values1 = is_array($value)
297 297
             ? $value
298
-            : [$value];
298
+            : [ $value ];
299 299
         $values = array_merge($values, $values1);
300 300
 
301 301
         $this->db->connect()
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
         $this->db->connect()
324 324
                  ->deleteFrom($this->tableName)
325 325
                  ->where("{$this->tableIdColumn} = ?")
326
-                 ->execute([$id]);
326
+                 ->execute([ $id ]);
327 327
 
328 328
         $this->{$this->tableIdColumn} = null;
329 329
     }
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
     public function deleteWhere($where, $value)
350 350
     {
351 351
         $this->checkDb();
352
-        $values = is_array($value) ? $value : [$value];
352
+        $values = is_array($value) ? $value : [ $value ];
353 353
 
354 354
         $this->db->connect()
355 355
                  ->deleteFrom($this->tableName)
Please login to merge, or discard this patch.
src/DatabaseQueryBuilder/DatabaseQueryBuilder.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -21,12 +21,12 @@  discard block
 block discarded – undo
21 21
      */
22 22
     public function setDefaultsFromConfiguration()
23 23
     {
24
-        if ($this->options['dsn']) {
25
-            $dsn = explode(':', $this->options['dsn']);
26
-            $this->setSQLDialect($dsn[0]);
24
+        if ($this->options[ 'dsn' ]) {
25
+            $dsn = explode(':', $this->options[ 'dsn' ]);
26
+            $this->setSQLDialect($dsn[ 0 ]);
27 27
         }
28 28
 
29
-        $this->setTablePrefix($this->options['table_prefix']);
29
+        $this->setTablePrefix($this->options[ 'table_prefix' ]);
30 30
     }
31 31
 
32 32
 
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
      *
40 40
      * @return self
41 41
      */
42
-    public function execute($query = null, array $params = []) : object
42
+    public function execute($query = null, array $params = [ ]) : object
43 43
     {
44 44
         // When using one argument and its array, assume its $params
45 45
         if (is_array($query)) {
Please login to merge, or discard this patch.
src/DatabaseQueryBuilder/QueryBuilderTrait.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -466,12 +466,12 @@  discard block
 block discarded – undo
466 466
 
467 467
 
468 468
     /**
469
-    * Build the group by part.
470
-    *
471
-    * @param string $condition for building the group by part of the query.
472
-    *
473
-    * @return $this
474
-    */
469
+     * Build the group by part.
470
+     *
471
+     * @param string $condition for building the group by part of the query.
472
+     *
473
+     * @return $this
474
+     */
475 475
     public function groupBy($condition)
476 476
     {
477 477
         $this->groupby = "GROUP BY " . $condition;
@@ -482,12 +482,12 @@  discard block
 block discarded – undo
482 482
 
483 483
 
484 484
     /**
485
-    * Build the order by part.
486
-    *
487
-    * @param string $condition for building the where part of the query.
488
-    *
489
-    * @return $this
490
-    */
485
+     * Build the order by part.
486
+     *
487
+     * @param string $condition for building the where part of the query.
488
+     *
489
+     * @return $this
490
+     */
491 491
     public function orderBy($condition)
492 492
     {
493 493
         $this->orderby = "ORDER BY " . $condition;
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -64,14 +64,14 @@  discard block
 block discarded – undo
64 64
     protected function build()
65 65
     {
66 66
         $sql = $this->start . "\n"
67
-            . ($this->from    ? $this->from . "\n"    : null)
68
-            . ($this->join    ? $this->join           : null)
69
-            . ($this->set     ? $this->set . "\n"     : null)
70
-            . ($this->where   ? $this->where . "\n"   : null)
67
+            . ($this->from ? $this->from . "\n" : null)
68
+            . ($this->join ? $this->join : null)
69
+            . ($this->set ? $this->set . "\n" : null)
70
+            . ($this->where ? $this->where . "\n" : null)
71 71
             . ($this->groupby ? $this->groupby . "\n" : null)
72 72
             . ($this->orderby ? $this->orderby . "\n" : null)
73
-            . ($this->limit   ? $this->limit . "\n"   : null)
74
-            . ($this->offset  ? $this->offset . "\n"  : null)
73
+            . ($this->limit ? $this->limit . "\n" : null)
74
+            . ($this->offset ? $this->offset . "\n" : null)
75 75
             . ";";
76 76
 
77 77
         return $sql;
@@ -226,9 +226,9 @@  discard block
 block discarded – undo
226 226
 
227 227
         $max = count($columns);
228 228
         for ($i = 0; $i < $max; $i++) {
229
-            $cols .= $columns[$i] . ', ';
229
+            $cols .= $columns[ $i ] . ', ';
230 230
 
231
-            $val = $values[$i];
231
+            $val = $values[ $i ];
232 232
 
233 233
             if ($val == '?') {
234 234
                 $vals .= $val . ', ';
@@ -282,9 +282,9 @@  discard block
 block discarded – undo
282 282
         $max = count($columns);
283 283
         
284 284
         for ($i = 0; $i < $max; $i++) {
285
-            $cols .= "\t" . $columns[$i] . ' = ';
285
+            $cols .= "\t" . $columns[ $i ] . ' = ';
286 286
 
287
-            $val = $values[$i];
287
+            $val = $values[ $i ];
288 288
             if ($val == '?') {
289 289
                 $cols .= $val . ",\n";
290 290
             } else {
@@ -549,12 +549,12 @@  discard block
 block discarded – undo
549 549
                 // Create an array of '?' to match number of columns
550 550
                 $max = count($columns);
551 551
                 for ($i = 0; $i < $max; $i++) {
552
-                    $values[] = '?';
552
+                    $values[ ] = '?';
553 553
                 }
554 554
             }
555 555
         }
556 556
 
557
-        return [$columns, $values];
557
+        return [ $columns, $values ];
558 558
     }
559 559
 
560 560
 
Please login to merge, or discard this patch.
src/User/Answers.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,8 +39,8 @@
 block discarded – undo
39 39
     {
40 40
         $db = $di->get("dbqb");
41 41
         $db->connect()
42
-            ->insert("Answers", ["questionId", "acronym", "answer", "points", "created"])
43
-            ->execute([$this->questionId, $this->acronym, $this->answer, $this->points, $this->created]);
42
+            ->insert("Answers", [ "questionId", "acronym", "answer", "points", "created" ])
43
+            ->execute([ $this->questionId, $this->acronym, $this->answer, $this->points, $this->created ]);
44 44
     }
45 45
 
46 46
 
Please login to merge, or discard this patch.
src/User/HTMLForm/FormElementFile.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,10 +17,10 @@
 block discarded – undo
17 17
      * @param array  $attributes to set to the element. Default is an empty
18 18
      *                           array.
19 19
      */
20
-    public function __construct($name, $attributes = [])
20
+    public function __construct($name, $attributes = [ ])
21 21
     {
22 22
         parent::__construct($name, $attributes);
23
-        $this['type'] = 'file';
23
+        $this[ 'type' ] = 'file';
24 24
         $this->UseNameAsDefaultLabel();
25 25
     }
26 26
 }
Please login to merge, or discard this patch.
src/User/HTMLForm/CreateUserFormExample.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
                         "pear"   => "pear",
98 98
                         "banana" => "banana",
99 99
                     ],
100
-                    "checked"   => ["potato", "pear"],
100
+                    "checked"   => [ "potato", "pear" ],
101 101
                 ],
102 102
 
103 103
                 "color" => [
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
                 "submit" => [
200 200
                     "type" => "submit",
201 201
                     "value" => "Submit",
202
-                    "callback" => [$this, "callbackSubmit"]
202
+                    "callback" => [ $this, "callbackSubmit" ]
203 203
                 ],
204 204
             ]
205 205
         );
Please login to merge, or discard this patch.
src/User/HTMLForm/UserLoginFormExample.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
                 "submit" => [
41 41
                     "type" => "submit",
42 42
                     "value" => "Login",
43
-                    "callback" => [$this, "callbackSubmit"]
43
+                    "callback" => [ $this, "callbackSubmit" ]
44 44
                 ],
45 45
             ]
46 46
         );
Please login to merge, or discard this patch.
src/User/HTMLForm/CreateQuestionForm.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
                 "submit" => [
52 52
                     "type" => "submit",
53 53
                     "value" => "Ställ fråga",
54
-                    "callback" => [$this, "callbackSubmit"]
54
+                    "callback" => [ $this, "callbackSubmit" ]
55 55
                 ],
56 56
             ]
57 57
         );
Please login to merge, or discard this patch.