Passed
Push — main ( d70ce6...1926a3 )
by Thierry
02:00
created
src/DbAdmin/TableSelectAdmin.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
     {
24 24
         return [
25 25
             'select' => $select,
26
-            'values' => (array)$options["columns"],
26
+            'values' => (array) $options["columns"],
27 27
             'columns' => $columns,
28 28
             'functions' => $this->driver->functions(),
29 29
             'grouping' => $this->driver->grouping(),
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
         }
48 48
         return [
49 49
             // 'where' => $where,
50
-            'values' => (array)$options["where"],
50
+            'values' => (array) $options["where"],
51 51
             'columns' => $columns,
52 52
             'indexes' => $indexes,
53 53
             'operators' => $this->driver->operators(),
@@ -66,8 +66,8 @@  discard block
 block discarded – undo
66 66
     private function getSortingOptions(array $columns, array $options)
67 67
     {
68 68
         $values = [];
69
-        $descs = (array)$options["desc"];
70
-        foreach ((array)$options["order"] as $key => $value) {
69
+        $descs = (array) $options["desc"];
70
+        foreach ((array) $options["order"] as $key => $value) {
71 71
             $values[] = [
72 72
                 'col' => $value,
73 73
                 'desc' => $descs[$key] ?? 0,
Please login to merge, or discard this patch.
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'));
@@ -520,9 +520,8 @@  discard block
 block discarded – undo
520 520
         \preg_match_all("~'((?:[^']|'')*)'~", $field->length, $matches);
521 521
         foreach ($matches[1] as $i => $val) {
522 522
             $val = \stripcslashes(\str_replace("''", "'", $val));
523
-            $checked = (\is_int($value) ? $value == $i + 1 :
524
-                (\is_array($value) ? \in_array($i+1, $value) : $value === $val));
525
-            $inputs[] = "<label><input type='$type'$attrs value='" . ($i+1) . "'" .
523
+            $checked = (\is_int($value) ? $value == $i + 1 : (\is_array($value) ? \in_array($i + 1, $value) : $value === $val));
524
+            $inputs[] = "<label><input type='$type'$attrs value='" . ($i + 1) . "'" .
526 525
                 ($checked ? ' checked' : '') . '>' . $this->html($this->editValue($val, $field)) . '</label>';
527 526
         }
528 527
 
@@ -586,8 +585,7 @@  discard block
 block discarded – undo
586 585
         }
587 586
         $enumLength = $this->driver->enumLength();
588 587
         return (\preg_match("~^\\s*\\(?\\s*$enumLength(?:\\s*,\\s*$enumLength)*+\\s*\\)?\\s*\$~", $length) &&
589
-            \preg_match_all("~$enumLength~", $length, $matches) ? '(' . \implode(',', $matches[0]) . ')' :
590
-            \preg_replace('~^[0-9].*~', '(\0)', \preg_replace('~[^-0-9,+()[\]]~', '', $length))
588
+            \preg_match_all("~$enumLength~", $length, $matches) ? '(' . \implode(',', $matches[0]) . ')' : \preg_replace('~^[0-9].*~', '(\0)', \preg_replace('~[^-0-9,+()[\]]~', '', $length))
591 589
         );
592 590
     }
593 591
 
@@ -769,7 +767,7 @@  discard block
 block discarded – undo
769 767
         $expressions = [];
770 768
         foreach ($indexes as $i => $index) {
771 769
             if ($index->type == 'FULLTEXT' && $this->input->values['fulltext'][$i] != '') {
772
-                $columns = \array_map(function ($column) {
770
+                $columns = \array_map(function($column) {
773 771
                     return $this->driver->escapeId($column);
774 772
                 }, $index->columns);
775 773
                 $expressions[] = 'MATCH (' . \implode(', ', $columns) . ') AGAINST (' .
@@ -884,8 +882,7 @@  discard block
 block discarded – undo
884 882
      */
885 883
     private function _selectValue($value, string $link, string $type, string $original)
886 884
     {
887
-        $clause = ($value === null ? '<i>NULL</i>' :
888
-            (\preg_match('~char|binary|boolean~', $type) && !\preg_match('~var~', $type) ?
885
+        $clause = ($value === null ? '<i>NULL</i>' : (\preg_match('~char|binary|boolean~', $type) && !\preg_match('~var~', $type) ?
889 886
             "<code>$value</code>" : $value));
890 887
         if (\preg_match('~blob|bytea|raw|file~', $type) && !$this->isUtf8($value)) {
891 888
             $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   +4 added lines, -7 removed lines patch added patch discarded remove patch
@@ -210,9 +210,7 @@  discard block
 block discarded – undo
210 210
 
211 211
         // TODO: Move this to driver implementations
212 212
         $parse = '[\'"' .
213
-            ($this->driver->jush() == "sql" ? '`#' :
214
-            ($this->driver->jush() == "sqlite" ? '`[' :
215
-            ($this->driver->jush() == "mssql" ? '[' : ''))) . ']|/\*|-- |$' .
213
+            ($this->driver->jush() == "sql" ? '`#' : ($this->driver->jush() == "sqlite" ? '`[' : ($this->driver->jush() == "mssql" ? '[' : ''))) . ']|/\*|-- |$' .
216 214
             ($this->driver->jush() == "pgsql" ? '|\$[^$]*\$' : '');
217 215
         // should always match
218 216
         \preg_match('(' . \preg_quote($delimiter) . "\\s*|$parse)", $queries, $match, PREG_OFFSET_CAPTURE, $offset);
@@ -225,8 +223,7 @@  discard block
 block discarded – undo
225 223
 
226 224
         if (!empty($found) && \rtrim($found) != $delimiter) {
227 225
             // find matching quote or comment end
228
-            while (\preg_match('(' . ($found == '/*' ? '\*/' : ($found == '[' ? ']' :
229
-                (\preg_match('~^-- |^#~', $found) ? "\n" : \preg_quote($found) . "|\\\\."))) . '|$)s',
226
+            while (\preg_match('(' . ($found == '/*' ? '\*/' : ($found == '[' ? ']' : (\preg_match('~^-- |^#~', $found) ? "\n" : \preg_quote($found) . "|\\\\."))) . '|$)s',
230 227
                 $queries, $match, PREG_OFFSET_CAPTURE, $offset)) {
231 228
                 //! respect sql_mode NO_BACKSLASH_ESCAPES
232 229
                 $s = $match[0][0];
@@ -326,7 +323,7 @@  discard block
 block discarded – undo
326 323
                 \ini_set('memory_limit', \max($this->util->iniBytes('memory_limit'),
327 324
                     2 * \strlen($queries) + \memory_get_usage() + 8e6));
328 325
             }
329
-            catch(\Exception $e) {
326
+            catch (\Exception $e) {
330 327
                 // Do nothing if the option is not modified.
331 328
             }
332 329
         }
@@ -379,7 +376,7 @@  discard block
 block discarded – undo
379 376
         if ($empty) {
380 377
             $messages[] = $this->trans->lang('No commands to execute.');
381 378
         } elseif ($onlyErrors) {
382
-            $messages[] =  $this->trans->lang('%d query(s) executed OK.', $commands - \count($errors));
379
+            $messages[] = $this->trans->lang('%d query(s) executed OK.', $commands - \count($errors));
383 380
             // $timestamps[] = $this->trans->formatTime($total_start);
384 381
         }
385 382
         // elseif($errors && $commands > 1)
Please login to merge, or discard this patch.