Passed
Push — main ( d70ce6...1926a3 )
by Thierry
02:00
created
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.