Passed
Push — main ( 1926a3...c0ed3d )
by Thierry
02:11
created
src/DbAdmin/CommandAdmin.php 1 patch
Spacing   +4 added lines, -7 removed lines patch added patch discarded remove patch
@@ -208,9 +208,7 @@  discard block
 block discarded – undo
208 208
 
209 209
         // TODO: Move this to driver implementations
210 210
         $parse = '[\'"' .
211
-            ($this->driver->jush() == "sql" ? '`#' :
212
-            ($this->driver->jush() == "sqlite" ? '`[' :
213
-            ($this->driver->jush() == "mssql" ? '[' : ''))) . ']|/\*|-- |$' .
211
+            ($this->driver->jush() == "sql" ? '`#' : ($this->driver->jush() == "sqlite" ? '`[' : ($this->driver->jush() == "mssql" ? '[' : ''))) . ']|/\*|-- |$' .
214 212
             ($this->driver->jush() == "pgsql" ? '|\$[^$]*\$' : '');
215 213
         // should always match
216 214
         \preg_match('(' . \preg_quote($delimiter) . "\\s*|$parse)", $queries, $match, PREG_OFFSET_CAPTURE, $offset);
@@ -223,8 +221,7 @@  discard block
 block discarded – undo
223 221
 
224 222
         if (!empty($found) && \rtrim($found) != $delimiter) {
225 223
             // find matching quote or comment end
226
-            while (\preg_match('(' . ($found == '/*' ? '\*/' : ($found == '[' ? ']' :
227
-                (\preg_match('~^-- |^#~', $found) ? "\n" : \preg_quote($found) . "|\\\\."))) . '|$)s',
224
+            while (\preg_match('(' . ($found == '/*' ? '\*/' : ($found == '[' ? ']' : (\preg_match('~^-- |^#~', $found) ? "\n" : \preg_quote($found) . "|\\\\."))) . '|$)s',
228 225
                 $queries, $match, PREG_OFFSET_CAPTURE, $offset)) {
229 226
                 //! respect sql_mode NO_BACKSLASH_ESCAPES
230 227
                 $s = $match[0][0];
@@ -324,7 +321,7 @@  discard block
 block discarded – undo
324 321
                 \ini_set('memory_limit', \max($this->util->iniBytes('memory_limit'),
325 322
                     2 * \strlen($queries) + \memory_get_usage() + 8e6));
326 323
             }
327
-            catch(\Exception $e) {
324
+            catch (\Exception $e) {
328 325
                 // Do nothing if the option is not modified.
329 326
             }
330 327
         }
@@ -380,7 +377,7 @@  discard block
 block discarded – undo
380 377
         if ($empty) {
381 378
             $messages[] = $this->trans->lang('No commands to execute.');
382 379
         } elseif ($onlyErrors) {
383
-            $messages[] =  $this->trans->lang('%d query(s) executed OK.', $commands - $errors);
380
+            $messages[] = $this->trans->lang('%d query(s) executed OK.', $commands - $errors);
384 381
             // $timestamps[] = $this->trans->formatTime($total_start);
385 382
         }
386 383
 
Please login to merge, or discard this patch.