Passed
Push — master ( e0c5e8...7926db )
by P.R.
04:00
created
src/MySqlDataLayer.php 1 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 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -236,7 +236,7 @@
 block discarded – undo
236 236
 
237 237
     $sql = 'select @@sql_mode';
238 238
 
239
-    return (string)$this->executeSingleton1($sql);
239
+    return (string) $this->executeSingleton1($sql);
240 240
   }
241 241
 
242 242
   //--------------------------------------------------------------------------------------------------------------------
Please login to merge, or discard this patch.
src/Backend/MySqlRoutineWrapperGeneratorWorker.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -176,7 +176,7 @@
 block discarded – undo
176 176
   {
177 177
     $data = file_get_contents($this->metadataFilename);
178 178
 
179
-    $routines = (array)json_decode($data, true);
179
+    $routines = (array) json_decode($data, true);
180 180
     if (json_last_error()!=JSON_ERROR_NONE)
181 181
     {
182 182
       throw new RuntimeException("Error decoding JSON: '%s'.", json_last_error_msg());
Please login to merge, or discard this patch.
src/Backend/MySqlRoutineLoaderWorker.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
     $duplicates_methods = [];
319 319
     foreach ($this->sources as $source)
320 320
     {
321
-      if (sizeof($lookup[$source['method_name']])>1)
321
+      if (sizeof($lookup[$source['method_name']]) > 1)
322 322
       {
323 323
         $duplicates_sources[$source['path_name']]   = $source;
324 324
         $duplicates_methods[$source['method_name']] = $lookup[$source['method_name']];
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
     $this->io->writeln('');
413 413
 
414 414
     // Sort the sources by routine name.
415
-    usort($this->sources, function ($a, $b) {
415
+    usort($this->sources, function($a, $b) {
416 416
       return strcmp($a['routine_name'], $b['routine_name']);
417 417
     });
418 418
 
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
 
486 486
     $size = $this->characterSets[$key]['maxlen'];
487 487
 
488
-    return (int)floor(self::MAX_COLUMN_SIZE  / $size);
488
+    return (int) floor(self::MAX_COLUMN_SIZE / $size);
489 489
   }
490 490
 
491 491
   //--------------------------------------------------------------------------------------------------------------------
@@ -519,7 +519,7 @@  discard block
 block discarded – undo
519 519
   {
520 520
     if (file_exists($this->phpStratumMetadataFilename))
521 521
     {
522
-      $this->phpStratumMetadata = (array)json_decode(file_get_contents($this->phpStratumMetadataFilename), true);
522
+      $this->phpStratumMetadata = (array) json_decode(file_get_contents($this->phpStratumMetadataFilename), true);
523 523
       if (json_last_error()!=JSON_ERROR_NONE)
524 524
       {
525 525
         throw new RuntimeException("Error decoding JSON: '%s'.", json_last_error_msg());
Please login to merge, or discard this patch.
src/Backend/MysqlConstantWorker.php 1 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
     $line_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)
@@ -487,7 +487,7 @@  discard block
 block discarded – undo
487 487
           if (isset($column['constant_name']))
488 488
           {
489 489
             $line_format = sprintf("%%s.%%-%ds %%%dd %%s\n", $width1, $width2);
490
-            $content     .= sprintf($line_format,
490
+            $content .= sprintf($line_format,
491 491
                                     $column['table_name'],
492 492
                                     $column['column_name'],
493 493
                                     $column['length'],
@@ -496,7 +496,7 @@  discard block
 block discarded – undo
496 496
           else
497 497
           {
498 498
             $line_format = sprintf("%%s.%%-%ds %%%dd\n", $width1, $width2);
499
-            $content     .= sprintf($line_format,
499
+            $content .= sprintf($line_format,
500 500
                                     $column['table_name'],
501 501
                                     $column['column_name'],
502 502
                                     $column['length']);
Please login to merge, or discard this patch.
src/Wrapper/Wrapper.php 1 patch
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.
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 1 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/Helper/RoutineLoaderHelper.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
         case 'int':
270 270
         case 'bigint':
271 271
           preg_match('/^\((\d+)\)/', $parts1[2], $parts2);
272
-          $tmp['numeric_precision'] = (int)$parts2[1];
272
+          $tmp['numeric_precision'] = (int) $parts2[1];
273 273
           $tmp['numeric_scale']     = 0;
274 274
           break;
275 275
 
@@ -294,8 +294,8 @@  discard block
 block discarded – undo
294 294
 
295 295
         case 'decimal':
296 296
           preg_match('/^\((\d+),(\d+)\)$/', $parts1[2], $parts2);
297
-          $tmp['numeric_precision'] = (int)$parts2[1];
298
-          $tmp['numeric_scale']     = (int)$parts2[2];;
297
+          $tmp['numeric_precision'] = (int) $parts2[1];
298
+          $tmp['numeric_scale']     = (int) $parts2[2]; ;
299 299
           break;
300 300
 
301 301
         case 'time':
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
 
313 313
         case 'bit':
314 314
           preg_match('/^\((\d+)\)$/', $parts1[2], $parts2);
315
-          $tmp['numeric_precision'] = (int)$parts2[1];
315
+          $tmp['numeric_precision'] = (int) $parts2[1];
316 316
           break;
317 317
 
318 318
         case 'tinytext':
@@ -445,7 +445,7 @@  discard block
 block discarded – undo
445 445
 
446 446
     if ($key!==false)
447 447
     {
448
-      for ($i = 1; $i<$key; $i++)
448
+      for ($i = 1; $i < $key; $i++)
449 449
       {
450 450
         $n = preg_match('/^\s*--\s+type:\s*(\w+)\s*(.+)?\s*$/',
451 451
                         $this->routineSourceCodeLines[$key - $i],
@@ -565,7 +565,7 @@  discard block
 block discarded – undo
565 565
 
566 566
     if ($key!==false)
567 567
     {
568
-      for ($i = 1; $i<$key; $i++)
568
+      for ($i = 1; $i < $key; $i++)
569 569
       {
570 570
         $k = preg_match('/^\s*--\s+param:(?:\s*(\w+)\s+(\w+)(?:(?:\s+([^\s-])\s+([^\s-])\s+([^\s-])\s*$)|(?:\s*$)))?/',
571 571
                         $this->routineSourceCodeLines[$key - $i + 1],
@@ -656,7 +656,7 @@  discard block
 block discarded – undo
656 656
 
657 657
     if ($key!==false)
658 658
     {
659
-      for ($i = 1; $i<$key; $i++)
659
+      for ($i = 1; $i < $key; $i++)
660 660
       {
661 661
         $n = preg_match('/^\s*--\s+return:\s*((\w|\|)+)\s*$/',
662 662
                         $this->routineSourceCodeLines[$key - $i],
Please login to merge, or discard this patch.