Passed
Push — main ( 0ba104...db6621 )
by Thierry
03:02
created
src/Db/Facades/TableFacade.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -200,14 +200,14 @@
 block discarded – undo
200 200
                 $target .= '<b>' . $this->utils->str->html($foreignKey->schema) . '</b>.';
201 201
             }
202 202
             $target = $this->utils->str->html($foreignKey->table) .
203
-                '(' . implode(', ', array_map(function ($key) {
203
+                '(' . implode(', ', array_map(function($key) {
204 204
                     return $this->utils->str->html($key);
205 205
                 }, $foreignKey->target)) . ')';
206 206
             $details[] = [
207 207
                 'name' => $this->utils->str->html($name),
208 208
                 'source' => '<i>' . implode(
209 209
                     '</i>, <i>',
210
-                    array_map(function ($key) {
210
+                    array_map(function($key) {
211 211
                         return $this->utils->str->html($key);
212 212
                     }, $foreignKey->source)
213 213
                 ) . '</i>',
Please login to merge, or discard this patch.
src/Db/Facades/ExportFacade.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -619,8 +619,7 @@
 block discarded – undo
619 619
         foreach (array_unique(array_merge($databases['list'], $databases['data'])) as $database) {
620 620
             try {
621 621
                 $this->dumpDatabase($database);
622
-            }
623
-            catch (Exception $e) {
622
+            } catch (Exception $e) {
624 623
                 return $e->getMessage();
625 624
             }
626 625
         }
Please login to merge, or discard this patch.
templates/views/main/content.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,26 +1,26 @@
 block discarded – undo
1
-<?php if(is_array($this->headers)): ?>
1
+<?php if (is_array($this->headers)): ?>
2 2
                     <thead>
3 3
                         <tr>
4
-<?php if(isset($this->checkbox)): ?>
4
+<?php if (isset($this->checkbox)): ?>
5 5
                             <th class="dbadmin-table-checkbox"><input id="dbadmin-table-<?php
6 6
                                 echo $this->checkbox ?>-all" type="checkbox" /></th>
7 7
 <?php endif ?>
8
-<?php foreach($this->headers as $header): ?>
8
+<?php foreach ($this->headers as $header): ?>
9 9
                             <th><?php echo $header ?></th>
10 10
 <?php endforeach ?>
11 11
                         </tr>
12 12
                     </thead>
13 13
 <?php endif ?>
14 14
                     <tbody>
15
-<?php foreach($this->details as $details): ?>
15
+<?php foreach ($this->details as $details): ?>
16 16
                         <tr>
17
-<?php if(isset($this->checkbox)): ?>
17
+<?php if (isset($this->checkbox)): ?>
18 18
                             <td><input type="checkbox" class="dbadmin-table-<?php echo
19 19
                                 $this->checkbox ?>" name="<?php echo $this->checkbox ?>[]" /></td>
20 20
 <?php endif ?>
21
-<?php foreach($details as $detail): ?>
22
-<?php if(is_array($detail)): ?>
23
-                            <td<?php foreach($detail['props'] as $name => $value): ?> <?php
21
+<?php foreach ($details as $detail): ?>
22
+<?php if (is_array($detail)): ?>
23
+                            <td<?php foreach ($detail['props'] as $name => $value): ?> <?php
24 24
                                 echo $name ?>="<?php echo $value ?>"<?php
25 25
                                 endforeach ?>><?php echo $detail['label'] ?></td>
26 26
 <?php else: ?>
Please login to merge, or discard this patch.
templates/views/sql/dump.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,18 +1,18 @@
 block discarded – undo
1
-<?php if(is_array($this->headers)): ?>
1
+<?php if (is_array($this->headers)): ?>
2 2
 -- Jaxon DbAdmin <?php echo $this->headers['version'], ' ',
3 3
                     $this->headers['driver'], ' ',
4 4
                     $this->headers['server'] ?> dump
5 5
 
6
-<?php if(($this->headers['sql'])): ?>
6
+<?php if (($this->headers['sql'])): ?>
7 7
 SET NAMES utf8;
8 8
 SET time_zone = '+00:00';
9 9
 SET foreign_key_checks = 0;
10
-<?php if(($this->headers['data_style'])): ?>
10
+<?php if (($this->headers['data_style'])): ?>
11 11
 SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
12 12
 <?php endif ?>
13 13
 <?php endif ?>
14 14
 
15 15
 <?php endif ?>
16
-<?php foreach($this->queries as $query): ?>
16
+<?php foreach ($this->queries as $query): ?>
17 17
 <?php echo $query, "\n" ?>
18 18
 <?php endforeach ?>
Please login to merge, or discard this patch.
templates/pagination/wrapper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@
 block discarded – undo
1 1
 <nav><ul class="pagination"><?php
2
-    if(($this->prev))
2
+    if (($this->prev))
3 3
     {
4 4
         echo $this->prev;
5 5
     }
6
-    foreach($this->links as $link)
6
+    foreach ($this->links as $link)
7 7
     {
8 8
         echo $link;
9 9
     }
10
-    if(($this->next))
10
+    if (($this->next))
11 11
     {
12 12
         echo $this->next;
13 13
     }
Please login to merge, or discard this patch.
src/Db/Facades/SelectFacade.php 1 patch
Spacing   +6 added lines, -9 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
     /**
36 36
      * @var SelectEntity|null
37 37
      */
38
-    private SelectEntity|null $selectEntity = null;
38
+    private SelectEntity | null $selectEntity = null;
39 39
 
40 40
     /**
41 41
      * @param AbstractFacade $dbFacade
@@ -116,11 +116,9 @@  discard block
 block discarded – undo
116 116
         $value = $this->selectEntity->queryOptions["columns"][$valueKey] ?? [];
117 117
 
118 118
         $fun = $value["fun"] ?? '';
119
-        $fieldKey = !$this->selectEntity->select ? $key :
120
-            ($value["col"] ?? current($this->selectEntity->select));
119
+        $fieldKey = !$this->selectEntity->select ? $key : ($value["col"] ?? current($this->selectEntity->select));
121 120
         $field = $this->selectEntity->fields[$fieldKey];
122
-        $name = !$field ? ($fun ? "*" : $key) :
123
-            $this->admin->fieldName($field, $rank);
121
+        $name = !$field ? ($fun ? "*" : $key) : $this->admin->fieldName($field, $rank);
124 122
 
125 123
         return [$fun, $name, $field];
126 124
     }
@@ -246,8 +244,7 @@  discard block
 block discarded – undo
246 244
     private function getRowIdMd5Key(string $key, string $collation): string
247 245
     {
248 246
         return $this->driver->jush() != 'sql' ||
249
-            preg_match("~^utf8~", $collation) ? $key :
250
-                "CONVERT($key USING " . $this->driver->charset() . ")";
247
+            preg_match("~^utf8~", $collation) ? $key : "CONVERT($key USING " . $this->driver->charset() . ")";
251 248
     }
252 249
 
253 250
     /**
@@ -366,8 +363,8 @@  discard block
 block discarded – undo
366 363
             $query = $this->driver->getRowCountQuery($table,
367 364
                 $this->selectEntity->where, $this->hasGroupsInFields(),
368 365
                 $this->selectEntity->group);
369
-            return (int)$this->driver->result($query);
370
-        } catch(Exception $_) {
366
+            return (int) $this->driver->result($query);
367
+        } catch (Exception $_) {
371 368
             return -1;
372 369
         }
373 370
     }
Please login to merge, or discard this patch.
src/Db/Facades/Select/SelectQuery.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
         $col = $value['col'];
287 287
         $prefix = '';
288 288
         if ($op === 'FIND_IN_SET') {
289
-            $prefix = $op .'(' . $this->driver->quote($value['val']) . ', ';
289
+            $prefix = $op . '(' . $this->driver->quote($value['val']) . ', ';
290 290
         }
291 291
         $condition = $this->getWhereCondition($value, $fields);
292 292
         if ($col !== '') {
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
      */
316 316
     private function getMatchExpression(IndexEntity $index, int $i): string
317 317
     {
318
-        $columns = array_map(function ($column) {
318
+        $columns = array_map(function($column) {
319 319
             return $this->driver->escapeId($column);
320 320
         }, $index->columns);
321 321
         $match = $this->driver->quote($this->utils->input->values['fulltext'][$i]);
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
             }
340 340
         }
341 341
         foreach ((array) $this->utils->input->values['where'] as $value) {
342
-            if (($value['col'] !== '' ||  $value['val'] !== '') &&
342
+            if (($value['col'] !== '' || $value['val'] !== '') &&
343 343
                 in_array($value['op'], $this->driver->operators())) {
344 344
                 $selectEntity->where[] = $this
345 345
                     ->getSelectExpression($value, $selectEntity->fields);
Please login to merge, or discard this patch.
src/Db/Facades/Select/SelectEntity.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@
 block discarded – undo
105 105
     /**
106 106
      * @var string|null
107 107
      */
108
-    public string|null $error = null;
108
+    public string | null $error = null;
109 109
 
110 110
     /**
111 111
      * @var TableSelectEntity
Please login to merge, or discard this patch.
src/Db/Facades/Select/SelectTrait.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
     {
26 26
         return [
27 27
             'select' => $select,
28
-            'values' => (array)$options["columns"],
28
+            'values' => (array) $options["columns"],
29 29
             'columns' => $columns,
30 30
             'functions' => $this->driver->functions(),
31 31
             'grouping' => $this->driver->grouping(),
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
         }
50 50
         return [
51 51
             // 'where' => $where,
52
-            'values' => (array)$options["where"],
52
+            'values' => (array) $options["where"],
53 53
             'columns' => $columns,
54 54
             'indexes' => $indexes,
55 55
             'operators' => $this->driver->operators(),
@@ -68,8 +68,8 @@  discard block
 block discarded – undo
68 68
     private function getSortingOptions(array $columns, array $options): array
69 69
     {
70 70
         $values = [];
71
-        $descs = (array)$options["desc"];
72
-        foreach ((array)$options["order"] as $key => $value) {
71
+        $descs = (array) $options["desc"];
72
+        foreach ((array) $options["order"] as $key => $value) {
73 73
             $values[] = [
74 74
                 'col' => $value,
75 75
                 'desc' => $descs[$key] ?? 0,
Please login to merge, or discard this patch.