Passed
Push — 2.0 ( 99ad58...e26ade )
by Vincent
03:00 queued 15s
created
src/Test/RepositoryAssertion.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -68,15 +68,15 @@
 block discarded – undo
68 68
     }
69 69
 
70 70
     /**
71
-    * Assert that two array of entities are equal
72
-    *
73
-    * @param array $expectedEntities
74
-    * @param array $actualEntities
75
-    * @param int   $dateTimeDelta
76
-    * @param string $message
71
+     * Assert that two array of entities are equal
72
+     *
73
+     * @param array $expectedEntities
74
+     * @param array $actualEntities
75
+     * @param int   $dateTimeDelta
76
+     * @param string $message
77 77
      *
78 78
      * @throws \Exception
79
-    */
79
+     */
80 80
     public function assertEntities($expectedEntities, $actualEntities, $dateTimeDelta = 5, $message = '')
81 81
     {
82 82
         if (is_string($dateTimeDelta)) {
Please login to merge, or discard this patch.
src/Migration/MigrationManager.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@
 block discarded – undo
112 112
             return $migrations;
113 113
         }
114 114
 
115
-        return array_filter($migrations, function (MigrationInterface $migration) use ($stage) {
115
+        return array_filter($migrations, function(MigrationInterface $migration) use ($stage) {
116 116
             return $migration->stage() === $stage;
117 117
         });
118 118
     }
Please login to merge, or discard this patch.
src/Migration/Provider/FileMigrationProvider.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -88,8 +88,8 @@  discard block
 block discarded – undo
88 88
         }
89 89
 
90 90
         $content = $stage === MigrationInterface::STAGE_DEFAULT
91
-            ? file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . 'stubs' . DIRECTORY_SEPARATOR . 'migration.stub')
92
-            : file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . 'stubs' . DIRECTORY_SEPARATOR . 'migration-staged.stub')
91
+            ? file_get_contents(__DIR__.DIRECTORY_SEPARATOR.'stubs'.DIRECTORY_SEPARATOR.'migration.stub')
92
+            : file_get_contents(__DIR__.DIRECTORY_SEPARATOR.'stubs'.DIRECTORY_SEPARATOR.'migration-staged.stub')
93 93
         ;
94 94
 
95 95
         // Try to write the migration file
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
     {
149 149
         $this->migrations = [];
150 150
 
151
-        $paths = glob(realpath($this->path) . DIRECTORY_SEPARATOR . '*.php');
151
+        $paths = glob(realpath($this->path).DIRECTORY_SEPARATOR.'*.php');
152 152
 
153 153
         foreach ($paths as $path) {
154 154
             list($version, $className) = $this->parseFilename($path);
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
         }
189 189
 
190 190
         // Check if migration name already exists
191
-        $definedMigration = array_search($className, array_map(function (MigrationInterface $migration) {
191
+        $definedMigration = array_search($className, array_map(function(MigrationInterface $migration) {
192 192
             return $migration->name();
193 193
         }, $this->migrations));
194 194
 
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
      */
234 234
     private function createFilename($version, $className)
235 235
     {
236
-        return $this->path . DIRECTORY_SEPARATOR . $version . '_' . $className . '.php';
236
+        return $this->path.DIRECTORY_SEPARATOR.$version.'_'.$className.'.php';
237 237
     }
238 238
 
239 239
     /**
Please login to merge, or discard this patch.
src/Migration/Version/DbVersionRepository.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
     {
102 102
         $versions = $this->all();
103 103
 
104
-        return (string)end($versions);
104
+        return (string) end($versions);
105 105
     }
106 106
 
107 107
     /**
@@ -188,10 +188,10 @@  discard block
 block discarded – undo
188 188
         $schemaManager = $this->connection->schema();
189 189
 
190 190
         if (!$schemaManager instanceof TableManagerInterface) {
191
-            throw new \LogicException('The connection "' . $this->connection->getName() . '" do not supports table configuration');
191
+            throw new \LogicException('The connection "'.$this->connection->getName().'" do not supports table configuration');
192 192
         }
193 193
 
194
-        $schemaManager->table($this->tableName, function ($table) {
194
+        $schemaManager->table($this->tableName, function($table) {
195 195
             $table->string('version');
196 196
         });
197 197
 
Please login to merge, or discard this patch.
src/Repository/EntityRepository.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
     #[ReadOperation]
341 341
     public function loadRelations($entity, $relations): void
342 342
     {
343
-        foreach (Relation::sanitizeRelations((array)$relations) as $relationName => $meta) {
343
+        foreach (Relation::sanitizeRelations((array) $relations) as $relationName => $meta) {
344 344
             $this->relation($relationName)->loadIfNotLoaded(
345 345
                 new SingleEntityIndexer($this->mapper, $entity),
346 346
                 $meta['relations'],
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
     #[ReadOperation]
364 364
     public function reloadRelations($entity, $relations): void
365 365
     {
366
-        foreach (Relation::sanitizeRelations((array)$relations) as $relationName => $meta) {
366
+        foreach (Relation::sanitizeRelations((array) $relations) as $relationName => $meta) {
367 367
             $this->relation($relationName)->load(
368 368
                 new SingleEntityIndexer($this->mapper, $entity),
369 369
                 $meta['relations'],
@@ -403,9 +403,9 @@  discard block
 block discarded – undo
403 403
     #[WriteOperation]
404 404
     public function saveAll($entity, $relations): int
405 405
     {
406
-        $relations = Relation::sanitizeRelations((array)$relations);
406
+        $relations = Relation::sanitizeRelations((array) $relations);
407 407
 
408
-        return $this->transaction(function () use ($entity, $relations) {
408
+        return $this->transaction(function() use ($entity, $relations) {
409 409
             $nb = $this->save($entity);
410 410
 
411 411
             foreach ($relations as $relationName => $info) {
@@ -422,9 +422,9 @@  discard block
 block discarded – undo
422 422
     #[WriteOperation]
423 423
     public function deleteAll($entity, $relations): int
424 424
     {
425
-        $relations = Relation::sanitizeRelations((array)$relations);
425
+        $relations = Relation::sanitizeRelations((array) $relations);
426 426
 
427
-        return $this->transaction(function () use ($entity, $relations) {
427
+        return $this->transaction(function() use ($entity, $relations) {
428 428
             $nb = $this->delete($entity);
429 429
 
430 430
             foreach ($relations as $relationName => $info) {
Please login to merge, or discard this patch.
src/Entity/Hydrator/Generator/CodeGenerator.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
             return '';
39 39
         }
40 40
 
41
-        return 'namespace ' . $namespace . ';';
41
+        return 'namespace '.$namespace.';';
42 42
     }
43 43
 
44 44
     /**
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
         $out = '';
55 55
 
56 56
         foreach ($names as $property) {
57
-            $out .= $visibility.' $' . $property . ';'.$this->eol;
57
+            $out .= $visibility.' $'.$property.';'.$this->eol;
58 58
         }
59 59
 
60 60
         return $out;
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
      */
70 70
     public function simpleConstructor($properties)
71 71
     {
72
-        $parameters = implode(', ', array_map(function ($p) {
72
+        $parameters = implode(', ', array_map(function($p) {
73 73
             return '$'.$p;
74 74
         }, $properties));
75 75
         $content = '';
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
                 $content .= $this->eol;
80 80
             }
81 81
 
82
-            $content .= '$this->' . $property . ' = $' . $property . ';';
82
+            $content .= '$this->'.$property.' = $'.$property.';';
83 83
         }
84 84
 
85 85
 
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
     {
104 104
         $spaces = str_repeat($this->tab, $tabs);
105 105
 
106
-        return $spaces . str_replace($this->eol, $this->eol.$spaces, $code);
106
+        return $spaces.str_replace($this->eol, $this->eol.$spaces, $code);
107 107
     }
108 108
 
109 109
     /**
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
      *
161 161
      * @return string
162 162
      */
163
-    public function switch($varName, array $cases, $default = null)
163
+    public function switch ($varName, array $cases, $default = null)
164 164
     {
165 165
         $code = 'switch ('.$varName.') {'.$this->eol;
166 166
 
Please login to merge, or discard this patch.
src/Entity/EntityGenerator.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -772,13 +772,13 @@
 block discarded – undo
772 772
         }
773 773
 
774 774
         $replacements = [
775
-          '<description>'       => ucfirst($type).' '.$variableName,
776
-          '<methodTypeHint>'    => $methodTypeHint,
777
-          '<variableType>'      => $variableType,
778
-          '<variableName>'      => $variableName,
779
-          '<methodName>'        => $methodName,
780
-          '<fieldName>'         => $fieldName,
781
-          '<variableDefault>'   => ($defaultValue !== null) ? (' = '.$defaultValue) : ''
775
+            '<description>'       => ucfirst($type).' '.$variableName,
776
+            '<methodTypeHint>'    => $methodTypeHint,
777
+            '<variableType>'      => $variableType,
778
+            '<variableName>'      => $variableName,
779
+            '<methodName>'        => $methodName,
780
+            '<fieldName>'         => $fieldName,
781
+            '<variableDefault>'   => ($defaultValue !== null) ? (' = '.$defaultValue) : ''
782 782
         ];
783 783
 
784 784
         $method = str_replace(
Please login to merge, or discard this patch.
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
         $body = str_replace('<spaces>', $this->spaces, $body);
387 387
         $last = strrpos($currentCode, '}');
388 388
 
389
-        return substr($currentCode, 0, $last) . $body . (strlen($body) > 0 ? "\n" : '') . "}\n";
389
+        return substr($currentCode, 0, $last).$body.(strlen($body) > 0 ? "\n" : '')."}\n";
390 390
     }
391 391
 
392 392
     /**
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
     protected function generateEntityNamespace(): string
396 396
     {
397 397
         if ($this->hasNamespace($this->mapperInfo->className())) {
398
-            return 'namespace ' . $this->getNamespace($this->mapperInfo->className()) .';' . "\n\n";
398
+            return 'namespace '.$this->getNamespace($this->mapperInfo->className()).';'."\n\n";
399 399
         }
400 400
 
401 401
         return '';
@@ -411,18 +411,18 @@  discard block
 block discarded – undo
411 411
         $use = [];
412 412
 
413 413
         if (($parentClass = $this->getClassToExtend()) && $this->hasNamespace($parentClass)) {
414
-            $use[$parentClass] = 'use ' . $parentClass . ';';
414
+            $use[$parentClass] = 'use '.$parentClass.';';
415 415
         }
416 416
 
417 417
         foreach ($this->interfaces as $interface) {
418 418
             if ($this->hasNamespace($interface)) {
419
-                $use[$interface] = 'use ' . $interface . ';';
419
+                $use[$interface] = 'use '.$interface.';';
420 420
             }
421 421
         }
422 422
 
423 423
         foreach ($this->traits as $trait) {
424 424
             if ($this->hasNamespace($trait)) {
425
-                $use[$trait] = 'use ' . $trait . ';';
425
+                $use[$trait] = 'use '.$trait.';';
426 426
             }
427 427
         }
428 428
 
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
 
453 453
         sort($use);
454 454
 
455
-        return implode("\n", $use) . "\n\n";
455
+        return implode("\n", $use)."\n\n";
456 456
     }
457 457
 
458 458
     /**
@@ -460,9 +460,9 @@  discard block
 block discarded – undo
460 460
      */
461 461
     protected function generateEntityClassName()
462 462
     {
463
-        return 'class ' . $this->getClassName($this->mapperInfo->className()) .
464
-            ($this->classToExtend ? ' extends ' . $this->getClassToExtendName() : null) .
465
-            ($this->interfaces ? ' implements ' . $this->getInterfacesToImplement() : null);
463
+        return 'class '.$this->getClassName($this->mapperInfo->className()).
464
+            ($this->classToExtend ? ' extends '.$this->getClassToExtendName() : null).
465
+            ($this->interfaces ? ' implements '.$this->getInterfacesToImplement() : null);
466 466
     }
467 467
 
468 468
     /**
@@ -477,10 +477,10 @@  discard block
 block discarded – undo
477 477
         $traits = '';
478 478
 
479 479
         foreach ($this->traits as $trait) {
480
-            $traits .= $this->spaces . 'use ' . $this->getRelativeClassName($trait) . ';' . "\n";
480
+            $traits .= $this->spaces.'use '.$this->getRelativeClassName($trait).';'."\n";
481 481
         }
482 482
 
483
-        return $traits . "\n";
483
+        return $traits."\n";
484 484
     }
485 485
 
486 486
     /**
@@ -585,7 +585,7 @@  discard block
 block discarded – undo
585 585
     {
586 586
         $lines = [];
587 587
         $lines[] = '/**';
588
-        $lines[] = ' * ' . $this->getClassName($this->mapperInfo->className());
588
+        $lines[] = ' * '.$this->getClassName($this->mapperInfo->className());
589 589
         $lines[] = ' */';
590 590
 
591 591
         return implode("\n", $lines);
@@ -685,7 +685,7 @@  discard block
 block discarded – undo
685 685
 
686 686
             if (!$property->isRelation()) {
687 687
                 $lines[] = $this->generateEmbeddedPropertyDocBlock($property);
688
-                $lines[] = $this->spaces . $this->fieldVisibility . $this->getPropertyTypeHintForObject($property) . ' $'.$property->name().";\n";
688
+                $lines[] = $this->spaces.$this->fieldVisibility.$this->getPropertyTypeHintForObject($property).' $'.$property->name().";\n";
689 689
             } else {
690 690
                 $name = $property->name();
691 691
                 $default = '';
@@ -701,7 +701,7 @@  discard block
 block discarded – undo
701 701
                 }
702 702
 
703 703
                 $lines[] = $this->generateEmbeddedPropertyDocBlock($property);
704
-                $lines[] = $this->spaces . $this->fieldVisibility . $this->getPropertyTypeHintForObject($property) . ' $' . $name . $default .";\n";
704
+                $lines[] = $this->spaces.$this->fieldVisibility.$this->getPropertyTypeHintForObject($property).' $'.$name.$default.";\n";
705 705
             }
706 706
         }
707 707
 
@@ -729,7 +729,7 @@  discard block
 block discarded – undo
729 729
             $variableName = $this->inflector->camelize($fieldName);
730 730
             $methodName = $variableName;
731 731
         } else {
732
-            $methodName = $type . $this->inflector->classify($fieldName);
732
+            $methodName = $type.$this->inflector->classify($fieldName);
733 733
             $variableName = $this->inflector->camelize($fieldName);
734 734
         }
735 735
 
@@ -747,7 +747,7 @@  discard block
 block discarded – undo
747 747
         if ($propertyInfo->isObject()) {
748 748
             /** @var ObjectPropertyInfo $propertyInfo */
749 749
             $variableType = $this->getRelativeClassName($propertyInfo->className());
750
-            $methodTypeHint =  $variableType.' ';
750
+            $methodTypeHint = $variableType.' ';
751 751
         } else {
752 752
             /** @var PropertyInfo $propertyInfo */
753 753
             $variableType = $propertyInfo->phpType();
@@ -854,9 +854,9 @@  discard block
 block discarded – undo
854 854
     protected function generateFieldMappingPropertyDocBlock($property)
855 855
     {
856 856
         $lines = [];
857
-        $lines[] = $this->spaces . '/**';
858
-        $lines[] = $this->spaces . ' * @var '.$property->phpType();
859
-        $lines[] = $this->spaces . ' */';
857
+        $lines[] = $this->spaces.'/**';
858
+        $lines[] = $this->spaces.' * @var '.$property->phpType();
859
+        $lines[] = $this->spaces.' */';
860 860
 
861 861
         return implode("\n", $lines);
862 862
     }
@@ -885,9 +885,9 @@  discard block
 block discarded – undo
885 885
         }
886 886
 
887 887
         $lines = [];
888
-        $lines[] = $this->spaces . '/**';
889
-        $lines[] = $this->spaces . ' * @var '.$className;
890
-        $lines[] = $this->spaces . ' */';
888
+        $lines[] = $this->spaces.'/**';
889
+        $lines[] = $this->spaces.' * @var '.$className;
890
+        $lines[] = $this->spaces.' */';
891 891
 
892 892
         return implode("\n", $lines);
893 893
     }
@@ -928,7 +928,7 @@  discard block
 block discarded – undo
928 928
 
929 929
             if ($inClass) {
930 930
                 $inClass = false;
931
-                $lastSeenClass = $lastSeenNamespace . ($lastSeenNamespace ? '\\' : '') . $token[1];
931
+                $lastSeenClass = $lastSeenNamespace.($lastSeenNamespace ? '\\' : '').$token[1];
932 932
                 $this->staticReflection[$lastSeenClass]['properties'] = [];
933 933
                 $this->staticReflection[$lastSeenClass]['methods'] = [];
934 934
             }
@@ -936,16 +936,16 @@  discard block
 block discarded – undo
936 936
             if ($token[0] == T_NAMESPACE) {
937 937
                 $lastSeenNamespace = "";
938 938
                 $inNamespace = true;
939
-            } elseif ($token[0] == T_CLASS && $tokens[$i-1][0] != T_DOUBLE_COLON) {
939
+            } elseif ($token[0] == T_CLASS && $tokens[$i - 1][0] != T_DOUBLE_COLON) {
940 940
                 $inClass = true;
941 941
             } elseif ($token[0] == T_FUNCTION) {
942
-                if ($tokens[$i+2][0] == T_STRING) {
943
-                    $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i+2][1]);
944
-                } elseif ($tokens[$i+2] == "&" && $tokens[$i+3][0] == T_STRING) {
945
-                    $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i+3][1]);
942
+                if ($tokens[$i + 2][0] == T_STRING) {
943
+                    $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i + 2][1]);
944
+                } elseif ($tokens[$i + 2] == "&" && $tokens[$i + 3][0] == T_STRING) {
945
+                    $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i + 3][1]);
946 946
                 }
947
-            } elseif (in_array($token[0], [T_VAR, T_PUBLIC, T_PRIVATE, T_PROTECTED]) && $tokens[$i+2][0] != T_FUNCTION) {
948
-                $this->staticReflection[$lastSeenClass]['properties'][] = substr($tokens[$i+2][1], 1);
947
+            } elseif (in_array($token[0], [T_VAR, T_PUBLIC, T_PRIVATE, T_PROTECTED]) && $tokens[$i + 2][0] != T_FUNCTION) {
948
+                $this->staticReflection[$lastSeenClass]['properties'][] = substr($tokens[$i + 2][1], 1);
949 949
             }
950 950
         }
951 951
     }
@@ -1020,7 +1020,7 @@  discard block
 block discarded – undo
1020 1020
         if ($this->hasNamespace($className)) {
1021 1021
             return $this->getClassName($className);
1022 1022
         } else {
1023
-            return '\\' . $className;
1023
+            return '\\'.$className;
1024 1024
         }
1025 1025
     }
1026 1026
 
@@ -1121,8 +1121,8 @@  discard block
 block discarded – undo
1121 1121
         $lines = explode("\n", $code);
1122 1122
 
1123 1123
         foreach ($lines as $key => $value) {
1124
-            if (! empty($value)) {
1125
-                $lines[$key] = str_repeat($this->spaces, $num) . $lines[$key];
1124
+            if (!empty($value)) {
1125
+                $lines[$key] = str_repeat($this->spaces, $num).$lines[$key];
1126 1126
             }
1127 1127
         }
1128 1128
 
@@ -1151,7 +1151,7 @@  discard block
 block discarded – undo
1151 1151
         }
1152 1152
 
1153 1153
         if (is_string($value)) {
1154
-            return "'" . $value . "'";
1154
+            return "'".$value."'";
1155 1155
         }
1156 1156
 
1157 1157
         if (is_bool($value)) {
@@ -1184,7 +1184,7 @@  discard block
 block discarded – undo
1184 1184
             $type = self::PROPERTY_TYPE_MAP[$type] ?? $type;
1185 1185
         }
1186 1186
 
1187
-        return ($nullable ? '?' : '') . $type;
1187
+        return ($nullable ? '?' : '').$type;
1188 1188
     }
1189 1189
 
1190 1190
     /**
@@ -1203,7 +1203,7 @@  discard block
 block discarded – undo
1203 1203
             return '';
1204 1204
         }
1205 1205
 
1206
-        return ' ' . $this->getPropertyTypeHint($property->phpType(), $property->isNullable());
1206
+        return ' '.$this->getPropertyTypeHint($property->phpType(), $property->isNullable());
1207 1207
     }
1208 1208
 
1209 1209
     /**
@@ -1237,7 +1237,7 @@  discard block
 block discarded – undo
1237 1237
             }
1238 1238
         }
1239 1239
 
1240
-        return ' ' . $this->getPropertyTypeHint($type, $property->isRelation());
1240
+        return ' '.$this->getPropertyTypeHint($type, $property->isRelation());
1241 1241
     }
1242 1242
 
1243 1243
     //---------------------- mutators
@@ -1371,7 +1371,7 @@  discard block
 block discarded – undo
1371 1371
     public function setFieldVisibility(string $visibility): void
1372 1372
     {
1373 1373
         if ($visibility !== static::FIELD_VISIBLE_PRIVATE && $visibility !== static::FIELD_VISIBLE_PROTECTED) {
1374
-            throw new \InvalidArgumentException('Invalid provided visibility (only private and protected are allowed): ' . $visibility);
1374
+            throw new \InvalidArgumentException('Invalid provided visibility (only private and protected are allowed): '.$visibility);
1375 1375
         }
1376 1376
 
1377 1377
         $this->fieldVisibility = $visibility;
Please login to merge, or discard this patch.
src/Query/Expression/Raw.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
      */
37 37
     public function __toString()
38 38
     {
39
-        return (string)$this->value;
39
+        return (string) $this->value;
40 40
     }
41 41
 
42 42
     /**
Please login to merge, or discard this patch.
src/Query/Extension/CachableTrait.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -51,10 +51,10 @@
 block discarded – undo
51 51
     {
52 52
         if ($this->cacheKey === null) {
53 53
             $this->cacheKey = new CacheKey(
54
-                function () {
54
+                function() {
55 55
                     return $this->cacheNamespace();
56 56
                 },
57
-                $key ?? function () {
57
+                $key ?? function() {
58 58
                     return $this->cacheKey();
59 59
                 },
60 60
                 $lifetime
Please login to merge, or discard this patch.