Passed
Branch main (26cc78)
by Thierry
02:40
created
src/Db/Util.php 1 patch
Spacing   +5 added lines, -8 removed lines patch added patch discarded remove patch
@@ -517,9 +517,8 @@  discard block
 block discarded – undo
517 517
         \preg_match_all("~'((?:[^']|'')*)'~", $field->length, $matches);
518 518
         foreach ($matches[1] as $i => $val) {
519 519
             $val = \stripcslashes(\str_replace("''", "'", $val));
520
-            $checked = (\is_int($value) ? $value == $i + 1 :
521
-                (\is_array($value) ? \in_array($i+1, $value) : $value === $val));
522
-            $inputs[] = "<label><input type='$type'$attrs value='" . ($i+1) . "'" .
520
+            $checked = (\is_int($value) ? $value == $i + 1 : (\is_array($value) ? \in_array($i + 1, $value) : $value === $val));
521
+            $inputs[] = "<label><input type='$type'$attrs value='" . ($i + 1) . "'" .
523 522
                 ($checked ? ' checked' : '') . '>' . $this->html($this->editValue($val, $field)) . '</label>';
524 523
         }
525 524
 
@@ -583,8 +582,7 @@  discard block
 block discarded – undo
583 582
         }
584 583
         $enumLength = $this->driver->enumLength();
585 584
         return (\preg_match("~^\\s*\\(?\\s*$enumLength(?:\\s*,\\s*$enumLength)*+\\s*\\)?\\s*\$~", $length) &&
586
-            \preg_match_all("~$enumLength~", $length, $matches) ? "(" . \implode(",", $matches[0]) . ")" :
587
-            \preg_replace('~^[0-9].*~', '(\0)', \preg_replace('~[^-0-9,+()[\]]~', '', $length))
585
+            \preg_match_all("~$enumLength~", $length, $matches) ? "(" . \implode(",", $matches[0]) . ")" : \preg_replace('~^[0-9].*~', '(\0)', \preg_replace('~[^-0-9,+()[\]]~', '', $length))
588 586
         );
589 587
     }
590 588
 
@@ -755,7 +753,7 @@  discard block
 block discarded – undo
755 753
         $expressions = [];
756 754
         foreach ($indexes as $i => $index) {
757 755
             if ($index->type == "FULLTEXT" && $this->input->values["fulltext"][$i] != "") {
758
-                $columns = \array_map(function ($column) {
756
+                $columns = \array_map(function($column) {
759 757
                     return $this->driver->escapeId($column);
760 758
                 }, $index->columns);
761 759
                 $expressions[] = "MATCH (" . \implode(", ", $columns) . ") AGAINST (" .
@@ -873,8 +871,7 @@  discard block
 block discarded – undo
873 871
      */
874 872
     private function _selectValue(string $value, string $link, string $type, string $original)
875 873
     {
876
-        $clause = ($value === null ? "<i>NULL</i>" :
877
-            (\preg_match("~char|binary|boolean~", $type) && !\preg_match("~var~", $type) ?
874
+        $clause = ($value === null ? "<i>NULL</i>" : (\preg_match("~char|binary|boolean~", $type) && !\preg_match("~var~", $type) ?
878 875
             "<code>$value</code>" : $value));
879 876
         if (\preg_match('~blob|bytea|raw|file~', $type) && !$this->isUtf8($value)) {
880 877
             $clause = "<i>" . $this->trans->lang('%d byte(s)', \strlen($original)) . "</i>";
Please login to merge, or discard this patch.
src/DbAdmin/ViewTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
52 52
             $this->viewAdmin = new ViewAdmin();
53 53
             $this->viewAdmin->init($this->admin());
54 54
         }
55
-        return $this->viewAdmin ;
55
+        return $this->viewAdmin;
56 56
     }
57 57
 
58 58
     /**
Please login to merge, or discard this patch.
src/Db/Admin.php 1 patch
Spacing   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -93,8 +93,7 @@  discard block
 block discarded – undo
93 93
      */
94 94
     public function applySqlFunction(string $function, string $column)
95 95
     {
96
-        return ($function ? ($function == 'unixepoch' ? "DATETIME($column, '$function')" :
97
-            ($function == 'count distinct' ? 'COUNT(DISTINCT ' : strtoupper("$function(")) . "$column)") : $column);
96
+        return ($function ? ($function == 'unixepoch' ? "DATETIME($column, '$function')" : ($function == 'count distinct' ? 'COUNT(DISTINCT ' : strtoupper("$function(")) . "$column)") : $column);
98 97
     }
99 98
 
100 99
     /**
@@ -169,7 +168,7 @@  discard block
 block discarded – undo
169 168
                     }
170 169
                 }
171 170
                 if (\preg_match("~ IDENTIFIED BY PASSWORD '([^']+)~", $row[0], $match)) {
172
-                    $password  = $match[1];
171
+                    $password = $match[1];
173 172
                 }
174 173
             }
175 174
         }
Please login to merge, or discard this patch.