Passed
Push — master ( bb1547...2e64cc )
by P.R.
03:46
created
src/MySqlDataLayer.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1000,7 +1000,7 @@
 block discarded – undo
1000 1000
       if (!$success) throw $this->queryError('mysqli::real_query', $query);
1001 1001
 
1002 1002
       $this->queryLog[] = ['query' => $query,
1003
-                           'time'  => microtime(true) - $time0];
1003
+                            'time'  => microtime(true) - $time0];
1004 1004
     }
1005 1005
     else
1006 1006
     {
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -302,8 +302,8 @@  discard block
 block discarded – undo
302 302
           $line = '';
303 303
           foreach ($row as $i => $field)
304 304
           {
305
-            if ($i>0) $line .= ' ';
306
-            $line .= str_pad((string)$field, $fields[$i]->max_length);
305
+            if ($i > 0) $line .= ' ';
306
+            $line .= str_pad((string) $field, $fields[$i]->max_length);
307 307
           }
308 308
           echo date('Y-m-d H:i:s'), ' ', $line, "\n";
309 309
           $n++;
@@ -640,10 +640,10 @@  discard block
 block discarded – undo
640 640
       // with size $maxAllowedPacket bytes (but only $maxAllowedPacket - 8 bytes). But when setting the size of
641 641
       // $chunkSize less than $maxAllowedPacket than it is possible to transmit a LOB with size
642 642
       // $maxAllowedPacket bytes.
643
-      $this->chunkSize = (int)min($this->maxAllowedPacket - 8, 1024 * 1024);
643
+      $this->chunkSize = (int) min($this->maxAllowedPacket - 8, 1024 * 1024);
644 644
     }
645 645
 
646
-    return (int)$this->maxAllowedPacket;
646
+    return (int) $this->maxAllowedPacket;
647 647
   }
648 648
 
649 649
   //--------------------------------------------------------------------------------------------------------------------
@@ -723,7 +723,7 @@  discard block
 block discarded – undo
723 723
   {
724 724
     if ($value===null || $value==='') return 'null';
725 725
 
726
-    if (is_int($value) || is_float($value)) return (string)$value;
726
+    if (is_int($value) || is_float($value)) return (string) $value;
727 727
 
728 728
     return "'".$this->mysqli->real_escape_string($value)."'";
729 729
   }
@@ -740,7 +740,7 @@  discard block
 block discarded – undo
740 740
   {
741 741
     if ($value===null) return 'null';
742 742
 
743
-    return (string)$value;
743
+    return (string) $value;
744 744
   }
745 745
 
746 746
   //--------------------------------------------------------------------------------------------------------------------
@@ -755,7 +755,7 @@  discard block
 block discarded – undo
755 755
   {
756 756
     if ($value===null) return 'null';
757 757
 
758
-    return (string)$value;
758
+    return (string) $value;
759 759
   }
760 760
 
761 761
   //--------------------------------------------------------------------------------------------------------------------
@@ -1027,7 +1027,7 @@  discard block
 block discarded – undo
1027 1027
     {
1028 1028
       $n = strlen($data);
1029 1029
       $p = 0;
1030
-      while ($p<$n)
1030
+      while ($p < $n)
1031 1031
       {
1032 1032
         $success = @$statement->send_long_data($paramNr, substr($data, $p, $this->chunkSize));
1033 1033
         if (!$success) throw $this->dataLayerError('mysqli_stmt::send_long_data');
@@ -1067,13 +1067,13 @@  discard block
 block discarded – undo
1067 1067
     foreach ($columns as $column)
1068 1068
     {
1069 1069
       $separator .= str_repeat('-', $column['length'] + 2).'+';
1070
-      $spaces    = ($column['length'] + 2) - mb_strlen((string)$column['header']);
1070
+      $spaces = ($column['length'] + 2) - mb_strlen((string) $column['header']);
1071 1071
 
1072
-      $spacesLeft  = (int)floor($spaces / 2);
1073
-      $spacesRight = (int)ceil($spaces / 2);
1072
+      $spacesLeft  = (int) floor($spaces / 2);
1073
+      $spacesRight = (int) ceil($spaces / 2);
1074 1074
 
1075
-      $fillerLeft  = ($spacesLeft>0) ? str_repeat(' ', $spacesLeft) : '';
1076
-      $fillerRight = ($spacesRight>0) ? str_repeat(' ', $spacesRight) : '';
1075
+      $fillerLeft  = ($spacesLeft > 0) ? str_repeat(' ', $spacesLeft) : '';
1076
+      $fillerRight = ($spacesRight > 0) ? str_repeat(' ', $spacesRight) : '';
1077 1077
 
1078 1078
       $header .= $fillerLeft.$column['header'].$fillerRight.'|';
1079 1079
     }
@@ -1092,7 +1092,7 @@  discard block
 block discarded – undo
1092 1092
    */
1093 1093
   private function executeTableShowTableColumn(array $column, $value): void
1094 1094
   {
1095
-    $spaces = str_repeat(' ', $column['length'] - mb_strlen((string)$value));
1095
+    $spaces = str_repeat(' ', $column['length'] - mb_strlen((string) $value));
1096 1096
 
1097 1097
     switch ($column['type'])
1098 1098
     {
Please login to merge, or discard this patch.
src/MySqlMetaDataLayer.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -545,8 +545,8 @@  discard block
 block discarded – undo
545 545
 where  TABLE_SCHEMA = %s
546 546
 and    TABLE_NAME   = %s
547 547
 order by ORDINAL_POSITION',
548
-                   $this->dl->quoteString($schemaName),
549
-                   $this->dl->quoteString($tableName));
548
+                    $this->dl->quoteString($schemaName),
549
+                    $this->dl->quoteString($tableName));
550 550
 
551 551
     return $this->executeRows($sql);
552 552
   }
@@ -567,8 +567,8 @@  discard block
 block discarded – undo
567 567
     $sql = sprintf('
568 568
 show index from `%s`.`%s`
569 569
 where Key_name = \'PRIMARY\'',
570
-                   $schemaName,
571
-                   $tableName);
570
+                    $schemaName,
571
+                    $tableName);
572 572
 
573 573
     return $this->executeRows($sql);
574 574
   }
@@ -589,8 +589,8 @@  discard block
 block discarded – undo
589 589
     $sql = sprintf('
590 590
 show index from `%s`.`%s`
591 591
 where Non_unique = 0',
592
-                   $schemaName,
593
-                   $tableName);
592
+                    $schemaName,
593
+                    $tableName);
594 594
 
595 595
     return $this->executeRows($sql);
596 596
   }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -400,7 +400,7 @@
 block discarded – undo
400 400
   {
401 401
     $sql = 'select @@sql_mode';
402 402
 
403
-    return (string)$this->executeSingleton1($sql);
403
+    return (string) $this->executeSingleton1($sql);
404 404
   }
405 405
 
406 406
   //--------------------------------------------------------------------------------------------------------------------
Please login to merge, or discard this patch.
src/Wrapper/FunctionWrapper.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -46,14 +46,14 @@
 block discarded – undo
46 46
     if ($this->routine['return']=='bool')
47 47
     {
48 48
       $this->codeStore->append(sprintf("return !empty(\$this->executeSingleton0('select %s(%s)'));",
49
-                                       $this->routine['routine_name'],
50
-                                       $this->getRoutineArgs()));
49
+                                        $this->routine['routine_name'],
50
+                                        $this->getRoutineArgs()));
51 51
     }
52 52
     else
53 53
     {
54 54
       $this->codeStore->append(sprintf("return \$this->executeSingleton0('select %s(%s)');",
55
-                                       $this->routine['routine_name'],
56
-                                       $this->getRoutineArgs()));
55
+                                        $this->routine['routine_name'],
56
+                                        $this->getRoutineArgs()));
57 57
     }
58 58
   }
59 59
 
Please login to merge, or discard this patch.
src/Wrapper/Wrapper.php 3 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -264,7 +264,7 @@
 block discarded – undo
264 264
       }
265 265
     }
266 266
 
267
-    if ($blobArgumentIndex>0)
267
+    if ($blobArgumentIndex > 0)
268 268
     {
269 269
       $this->codeStore->append('');
270 270
     }
Please login to merge, or discard this patch.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -483,9 +483,9 @@  discard block
 block discarded – undo
483 483
       $mangledName = $this->nameMangler->getParameterName($parameter['parameter_name']);
484 484
 
485 485
       $parameters[] = ['php_name'             => '$'.$mangledName,
486
-                       'description'          => $parameter['description'],
487
-                       'php_type'             => $parameter['php_type'],
488
-                       'data_type_descriptor' => $parameter['data_type_descriptor']];
486
+                        'description'          => $parameter['description'],
487
+                        'php_type'             => $parameter['php_type'],
488
+                        'data_type_descriptor' => $parameter['data_type_descriptor']];
489 489
     }
490 490
 
491 491
     $this->enhancePhpDocBlockParameters($parameters);
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
 
506 506
       // Generate phpDoc for the parameters of the wrapper method.
507 507
 
508
-       foreach ($parameters as $parameter)
508
+        foreach ($parameters as $parameter)
509 509
       {
510 510
         $format = sprintf(' * %%-%ds %%-%ds %%-%ds %%s', mb_strlen('@param'), $maxTypeLength, $maxNameLength);
511 511
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -506,7 +506,7 @@
 block discarded – undo
506 506
       // Generate phpDoc for the parameters of the wrapper method.
507 507
 
508 508
        foreach ($parameters as $parameter)
509
-      {
509
+       {
510 510
         $format = sprintf(' * %%-%ds %%-%ds %%-%ds %%s', mb_strlen('@param'), $maxTypeLength, $maxNameLength);
511 511
 
512 512
         $lines = $parameter['description'];
Please login to merge, or discard this patch.
src/Helper/DataTypeHelper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -97,7 +97,7 @@
 block discarded – undo
97 97
 
98 98
       case 'decimal':
99 99
         $ret = $dataTypeInfo['numeric_precision'];
100
-        if ($dataTypeInfo['numeric_scale']>0) $ret += 1;
100
+        if ($dataTypeInfo['numeric_scale'] > 0) $ret += 1;
101 101
         break;
102 102
 
103 103
       case 'char':
Please login to merge, or discard this patch.
src/Helper/Crud/BaseRoutine.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
                                                     $this->tableName,
265 265
                                                     $column['column_name'],
266 266
                                                     '%type')),
267
-                                 false);
267
+                                  false);
268 268
       }
269 269
 
270 270
       if ($column!=end($this->tableColumns))
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
                                                     $this->tableName,
315 315
                                                     $column['column_name'],
316 316
                                                     '%type')),
317
-                                 false);
317
+                                  false);
318 318
       }
319 319
 
320 320
       if ($column!=end($columns))
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -207,7 +207,7 @@
 block discarded – undo
207 207
     $keys = $this->keyList();
208 208
     if (!empty($keys))
209 209
     {
210
-      if (sizeof($keys)>1 || !isset($keys['PRIMARY']))
210
+      if (sizeof($keys) > 1 || !isset($keys['PRIMARY']))
211 211
       {
212 212
         $this->codeStore->append(' * ', false);
213 213
         $this->codeStore->append(' * Possible keys:', false);
Please login to merge, or discard this patch.
src/Backend/MySqlRoutineLoaderWorker.php 3 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
       }
196 196
 
197 197
       $this->io->error(sprintf("The following source files would result wrapper methods with equal name '%s'",
198
-                               $method));
198
+                                $method));
199 199
       $this->io->listing($tmp);
200 200
     }
201 201
 
@@ -231,8 +231,8 @@  discard block
 block discarded – undo
231 231
       if (!isset($lookup[$oldRoutine['routine_name']]))
232 232
       {
233 233
         $this->io->logInfo('Dropping %s <dbo>%s</dbo>',
234
-                           strtolower($oldRoutine['routine_type']),
235
-                           $oldRoutine['routine_name']);
234
+                            strtolower($oldRoutine['routine_type']),
235
+                            $oldRoutine['routine_name']);
236 236
 
237 237
         $this->dl->dropRoutine($oldRoutine['routine_type'], $oldRoutine['routine_name']);
238 238
       }
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
       catch (RoutineLoaderException $e)
429 429
       {
430 430
         $messages = [$e->getMessage(),
431
-                     sprintf("Failed to load file '%s'", $filename['path_name'])];
431
+                      sprintf("Failed to load file '%s'", $filename['path_name'])];
432 432
         $this->io->error($messages);
433 433
 
434 434
         $this->errorFilenames[] = $filename['path_name'];
@@ -615,9 +615,9 @@  discard block
 block discarded – undo
615 615
           if ($max!==null)
616 616
           {
617 617
             $value = sprintf('%s(%d) character set %s',
618
-                             $column['data_type'],
619
-                             $max,
620
-                             $column['character_set_name']);
618
+                              $column['data_type'],
619
+                              $max,
620
+                              $column['character_set_name']);
621 621
           }
622 622
           else
623 623
           {
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -401,7 +401,8 @@
 block discarded – undo
401 401
   {
402 402
     $this->io->writeln('');
403 403
 
404
-    usort($this->sources, function ($a, $b) {
404
+    usort($this->sources, function ($a, $b)
405
+    {
405 406
       return strcmp($a['routine_name'], $b['routine_name']);
406 407
     });
407 408
 
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
     $duplicatesMethods = [];
310 310
     foreach ($this->sources as $source)
311 311
     {
312
-      if (sizeof($lookup[$source['method_name']])>1)
312
+      if (sizeof($lookup[$source['method_name']]) > 1)
313 313
       {
314 314
         $duplicatesSources[$source['path_name']]   = $source;
315 315
         $duplicatesMethods[$source['method_name']] = $lookup[$source['method_name']];
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
   {
401 401
     $this->io->writeln('');
402 402
 
403
-    usort($this->sources, function ($a, $b) {
403
+    usort($this->sources, function($a, $b) {
404 404
       return strcmp($a['routine_name'], $b['routine_name']);
405 405
     });
406 406
 
@@ -480,7 +480,7 @@  discard block
 block discarded – undo
480 480
 
481 481
     $size = $this->characterSets[$key]['maxlen'];
482 482
 
483
-    return (int)floor(self::MAX_COLUMN_SIZE / $size);
483
+    return (int) floor(self::MAX_COLUMN_SIZE / $size);
484 484
   }
485 485
 
486 486
   //--------------------------------------------------------------------------------------------------------------------
@@ -514,7 +514,7 @@  discard block
 block discarded – undo
514 514
   {
515 515
     if (file_exists($this->phpStratumMetadataFilename))
516 516
     {
517
-      $this->phpStratumMetadata = (array)json_decode(file_get_contents($this->phpStratumMetadataFilename), true);
517
+      $this->phpStratumMetadata = (array) json_decode(file_get_contents($this->phpStratumMetadataFilename), true);
518 518
       if (json_last_error()!==JSON_ERROR_NONE)
519 519
       {
520 520
         throw new RuntimeException("Error decoding JSON: '%s'.", json_last_error_msg());
Please login to merge, or discard this patch.
src/Helper/RoutineLoaderHelper.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -563,9 +563,9 @@  discard block
 block discarded – undo
563 563
     foreach ($this->parameters as $parameter)
564 564
     {
565 565
       $parameters[] = ['parameter_name'       => $parameter['parameter_name'],
566
-                       'php_type'             => DataTypeHelper::columnTypeToPhpTypeHinting($parameter).'|null',
567
-                       'data_type_descriptor' => $parameter['data_type_descriptor'],
568
-                       'description'          => $lookup[($parameter['parameter_name'])] ?? []];
566
+                        'php_type'             => DataTypeHelper::columnTypeToPhpTypeHinting($parameter).'|null',
567
+                        'data_type_descriptor' => $parameter['data_type_descriptor'],
568
+                        'description'          => $lookup[($parameter['parameter_name'])] ?? []];
569 569
     }
570 570
 
571 571
     return ['sort_description' => $this->docBlockReflection->getShortDescription(),
@@ -601,10 +601,10 @@  discard block
 block discarded – undo
601 601
       }
602 602
 
603 603
       $this->extendedParameters[$parameterName] = ['name'      => $parameterName,
604
-                                                   'data_type' => $dataType,
605
-                                                   'delimiter' => $delimiter,
606
-                                                   'enclosure' => $enclosure,
607
-                                                   'escape'    => $escape];
604
+                                                    'data_type' => $dataType,
605
+                                                    'delimiter' => $delimiter,
606
+                                                    'enclosure' => $enclosure,
607
+                                                    'escape'    => $escape];
608 608
     }
609 609
   }
610 610
 
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -473,7 +473,7 @@  discard block
 block discarded – undo
473 473
     {
474 474
       throw new RoutineLoaderException('Tag @type not found in DocBlock.');
475 475
     }
476
-    elseif (count($tags)>1)
476
+    elseif (count($tags) > 1)
477 477
     {
478 478
       throw new RoutineLoaderException('Multiple @type tags found in DocBlock.');
479 479
     }
@@ -707,7 +707,7 @@  discard block
 block discarded – undo
707 707
         $key1 = $this->findFirstMatchingLine('/^\s*(as|is)\s*$/i');
708 708
         $key2 = $this->findFirstMatchingLine('/^\s*begin\s*$/i');
709 709
 
710
-        if ($key1!==null && $key2!==null && $key1<$key2)
710
+        if ($key1!==null && $key2!==null && $key1 < $key2)
711 711
         {
712 712
           $this->syntax = self::PL_SQL_SYNTAX;
713 713
         }
@@ -856,11 +856,11 @@  discard block
 block discarded – undo
856 856
     }
857 857
 
858 858
     $start = $this->findFirstMatchingLine('/^\s*\/\*\*\s*$/');
859
-    $end   = $this->findFirstMatchingLine('/^\s*\*\/\s*$/');;
860
-    if ($start!==null && $end!==null && $start<$end)
859
+    $end   = $this->findFirstMatchingLine('/^\s*\*\/\s*$/'); ;
860
+    if ($start!==null && $end!==null && $start < $end)
861 861
     {
862 862
       $lines    = array_slice($this->routineSourceCodeLines, $start, $end - $start + 1);
863
-      $docBlock = implode(PHP_EOL, (array)$lines);
863
+      $docBlock = implode(PHP_EOL, (array) $lines);
864 864
     }
865 865
     else
866 866
     {
Please login to merge, or discard this patch.
src/Backend/MysqlConstantWorker.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -364,8 +364,8 @@
 block discarded – undo
364 364
           if ($n==0)
365 365
           {
366 366
             throw new RuntimeException("Illegal format at line %d in file '%s'.",
367
-                                       $lineNumber,
368
-                                       $this->constantsFilename);
367
+                                        $lineNumber,
368
+                                        $this->constantsFilename);
369 369
           }
370 370
 
371 371
           if (isset($matches[6]))
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
             if ($token[0]==T_WHITESPACE)
222 222
             {
223 223
               $line2 = $token[2];
224
-              if (substr_count($token[1], "\n")>1)
224
+              if (substr_count($token[1], "\n") > 1)
225 225
               {
226 226
                 // Whitespace contains new line: end doc block without constants.
227 227
                 $step = 4;
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
           {
249 249
             if ($token[0]==T_WHITESPACE)
250 250
             {
251
-              if (substr_count($token[1], "\n")<=1)
251
+              if (substr_count($token[1], "\n") <= 1)
252 252
               {
253 253
                 // Ignore whitespace.
254 254
                 $line3 = $token[2];
@@ -430,7 +430,7 @@  discard block
 block discarded – undo
430 430
     foreach ($this->constants as $constant => $value)
431 431
     {
432 432
       $width1 = max(mb_strlen($constant), $width1);
433
-      $width2 = max(mb_strlen((string)$value), $width2);
433
+      $width2 = max(mb_strlen((string) $value), $width2);
434 434
     }
435 435
 
436 436
     $format = sprintf('  const %%-%ds = %%%dd;', $width1, $width2);
@@ -477,7 +477,7 @@  discard block
 block discarded – undo
477 477
       foreach ($table as $column)
478 478
       {
479 479
         $width1 = max(mb_strlen($column['column_name']), $width1);
480
-        $width2 = max(mb_strlen((string)$column['length']), $width2);
480
+        $width2 = max(mb_strlen((string) $column['length']), $width2);
481 481
       }
482 482
 
483 483
       foreach ($table as $column)
@@ -486,7 +486,7 @@  discard block
 block discarded – undo
486 486
         {
487 487
           if (isset($column['constant_name']))
488 488
           {
489
-            $format  = sprintf("%%s.%%-%ds %%%dd %%s\n", $width1, $width2);
489
+            $format = sprintf("%%s.%%-%ds %%%dd %%s\n", $width1, $width2);
490 490
             $content .= sprintf($format,
491 491
                                 $column['table_name'],
492 492
                                 $column['column_name'],
@@ -495,7 +495,7 @@  discard block
 block discarded – undo
495 495
           }
496 496
           else
497 497
           {
498
-            $format  = sprintf("%%s.%%-%ds %%%dd\n", $width1, $width2);
498
+            $format = sprintf("%%s.%%-%ds %%%dd\n", $width1, $width2);
499 499
             $content .= sprintf($format,
500 500
                                 $column['table_name'],
501 501
                                 $column['column_name'],
Please login to merge, or discard this patch.