Passed
Push — main ( 521dc8...b09a59 )
by Thierry
02:33
created
src/Db/Util.php 1 patch
Spacing   +6 added lines, -9 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
      */
81 81
     public function html(?string $string)
82 82
     {
83
-        if(!$string) {
83
+        if (!$string) {
84 84
             return $string;
85 85
         }
86 86
         return \str_replace("\0", '�', \htmlspecialchars($string, ENT_QUOTES, 'utf-8'));
@@ -510,9 +510,8 @@  discard block
 block discarded – undo
510 510
         \preg_match_all("~'((?:[^']|'')*)'~", $field->length, $matches);
511 511
         foreach ($matches[1] as $i => $val) {
512 512
             $val = \stripcslashes(\str_replace("''", "'", $val));
513
-            $checked = (\is_int($value) ? $value == $i + 1 :
514
-                (\is_array($value) ? \in_array($i+1, $value) : $value === $val));
515
-            $inputs[] = "<label><input type='$type'$attrs value='" . ($i+1) . "'" .
513
+            $checked = (\is_int($value) ? $value == $i + 1 : (\is_array($value) ? \in_array($i + 1, $value) : $value === $val));
514
+            $inputs[] = "<label><input type='$type'$attrs value='" . ($i + 1) . "'" .
516 515
                 ($checked ? ' checked' : '') . '>' . $this->html($val) . '</label>';
517 516
         }
518 517
 
@@ -576,8 +575,7 @@  discard block
 block discarded – undo
576 575
         }
577 576
         $enumLength = $this->driver->enumLength();
578 577
         return (\preg_match("~^\\s*\\(?\\s*$enumLength(?:\\s*,\\s*$enumLength)*+\\s*\\)?\\s*\$~", $length) &&
579
-            \preg_match_all("~$enumLength~", $length, $matches) ? '(' . \implode(',', $matches[0]) . ')' :
580
-            \preg_replace('~^[0-9].*~', '(\0)', \preg_replace('~[^-0-9,+()[\]]~', '', $length))
578
+            \preg_match_all("~$enumLength~", $length, $matches) ? '(' . \implode(',', $matches[0]) . ')' : \preg_replace('~^[0-9].*~', '(\0)', \preg_replace('~[^-0-9,+()[\]]~', '', $length))
581 579
         );
582 580
     }
583 581
 
@@ -759,7 +757,7 @@  discard block
 block discarded – undo
759 757
         $expressions = [];
760 758
         foreach ($indexes as $i => $index) {
761 759
             if ($index->type == 'FULLTEXT' && $this->input->values['fulltext'][$i] != '') {
762
-                $columns = \array_map(function ($column) {
760
+                $columns = \array_map(function($column) {
763 761
                     return $this->driver->escapeId($column);
764 762
                 }, $index->columns);
765 763
                 $expressions[] = 'MATCH (' . \implode(', ', $columns) . ') AGAINST (' .
@@ -874,8 +872,7 @@  discard block
 block discarded – undo
874 872
      */
875 873
     private function _selectValue($value, string $link, string $type, $original)
876 874
     {
877
-        $clause = ($value === null ? '<i>NULL</i>' :
878
-            (\preg_match('~char|binary|boolean~', $type) && !\preg_match('~var~', $type) ?
875
+        $clause = ($value === null ? '<i>NULL</i>' : (\preg_match('~char|binary|boolean~', $type) && !\preg_match('~var~', $type) ?
879 876
             "<code>$value</code>" : $value));
880 877
         if (\preg_match('~blob|bytea|raw|file~', $type) && !$this->isUtf8($value)) {
881 878
             $clause = '<i>' . $this->trans->lang('%d byte(s)', \strlen($original)) . '</i>';
Please login to merge, or discard this patch.
src/DbAdmin/CommandAdmin.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
                 \ini_set('memory_limit', \max($this->util->iniBytes('memory_limit'),
197 197
                     2 * \strlen($queries) + \memory_get_usage() + 8e6));
198 198
             }
199
-            catch(\Exception $e) {
199
+            catch (\Exception $e) {
200 200
                 // Do nothing if the option is not modified.
201 201
             }
202 202
         }
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
         if ($commands === 0) {
236 236
             $messages[] = $this->trans->lang('No commands to execute.');
237 237
         } elseif ($onlyErrors) {
238
-            $messages[] =  $this->trans->lang('%d query(s) executed OK.', $commands - $errors);
238
+            $messages[] = $this->trans->lang('%d query(s) executed OK.', $commands - $errors);
239 239
         }
240 240
 
241 241
         return ['results' => $this->results, 'messages' => $messages];
Please login to merge, or discard this patch.
templates/views/bootstrap3/pagination/wrapper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,14 +1,14 @@
 block discarded – undo
1 1
 <ul class="pagination">
2 2
 <?php
3
-    if(($this->prev))
3
+    if (($this->prev))
4 4
     {
5 5
         echo $this->prev;
6 6
     }
7
-    foreach($this->links as $link)
7
+    foreach ($this->links as $link)
8 8
     {
9 9
         echo $link;
10 10
     }
11
-    if(($this->next))
11
+    if (($this->next))
12 12
     {
13 13
         echo $this->next;
14 14
     }
Please login to merge, or discard this patch.
templates/views/bootstrap4/pagination/wrapper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,15 +1,15 @@
 block discarded – undo
1 1
 <nav aria-label="">
2 2
     <ul class="pagination">
3 3
 <?php
4
-    if(($this->prev))
4
+    if (($this->prev))
5 5
     {
6 6
         echo $this->prev;
7 7
     }
8
-    foreach($this->links as $link)
8
+    foreach ($this->links as $link)
9 9
     {
10 10
         echo $link;
11 11
     }
12
-    if(($this->next))
12
+    if (($this->next))
13 13
     {
14 14
         echo $this->next;
15 15
     }
Please login to merge, or discard this patch.
src/DbAdmin/TableQueryAdmin.php 1 patch
Spacing   +3 added lines, -8 removed lines patch added patch discarded remove patch
@@ -100,8 +100,7 @@  discard block
 block discarded – undo
100 100
             $maxlength = (!\preg_match('~int~', $field->type) &&
101 101
                 \preg_match('~^(\d+)(,(\d+))?$~', $field->length, $match) ?
102 102
                 ((\preg_match("~binary~", $field->type) ? 2 : 1) * $match[1] + (($match[3] ?? null) ? 1 : 0) +
103
-                (($match[2] ?? false) && !$unsigned ? 1 : 0)) :
104
-                ($this->driver->typeExists($field->type) ? $this->driver->type($field->type) + ($unsigned ? 0 : 1) : 0));
103
+                (($match[2] ?? false) && !$unsigned ? 1 : 0)) : ($this->driver->typeExists($field->type) ? $this->driver->type($field->type) + ($unsigned ? 0 : 1) : 0));
105 104
             if ($this->driver->jush() == 'sql' && $this->driver->minVersion(5.6) && \preg_match('~time~', $field->type)) {
106 105
                 $maxlength += 7; // microtime
107 106
             }
@@ -241,12 +240,8 @@  discard block
 block discarded – undo
241 240
                 // }
242 241
                 $value = ($row !== null ?
243 242
                     ($row[$name] != "" && $this->driver->jush() == "sql" && \preg_match("~enum|set~", $field->type) ?
244
-                    (\is_array($row[$name]) ? \array_sum($row[$name]) : +$row[$name]) :
245
-                    (\is_bool($row[$name]) ? +$row[$name] : $row[$name])) :
246
-                    (!$update && $field->autoIncrement ? "" : (isset($queryOptions["select"]) ? false : $default)));
247
-                $function = ($queryOptions["save"] ? (string)$queryOptions["function"][$name] :
248
-                    ($update && \preg_match('~^CURRENT_TIMESTAMP~i', $field->onUpdate) ? "now" :
249
-                    ($value === false ? null : ($value !== null ? '' : 'NULL'))));
243
+                    (\is_array($row[$name]) ? \array_sum($row[$name]) : +$row[$name]) : (\is_bool($row[$name]) ? +$row[$name] : $row[$name])) : (!$update && $field->autoIncrement ? "" : (isset($queryOptions["select"]) ? false : $default)));
244
+                $function = ($queryOptions["save"] ? (string) $queryOptions["function"][$name] : ($update && \preg_match('~^CURRENT_TIMESTAMP~i', $field->onUpdate) ? "now" : ($value === false ? null : ($value !== null ? '' : 'NULL'))));
250 245
                 if (!$update && $value == $field->default && \preg_match('~^[\w.]+\(~', $value)) {
251 246
                     $function = "SQL";
252 247
                 }
Please login to merge, or discard this patch.