Passed
Pull Request — 1.0 (#47)
by Vincent
16:04 queued 06:48
created
src/Relations/Relation.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -245,7 +245,7 @@
 block discarded – undo
245 245
                 break;
246 246
 
247 247
             default:
248
-                throw new RuntimeException('Unknown type from relation "' . $relationName . '" in ' . $repository->entityName());
248
+                throw new RuntimeException('Unknown type from relation "'.$relationName.'" in '.$repository->entityName());
249 249
         }
250 250
 
251 251
         return $relation->setOptions($relationMeta);
Please login to merge, or discard this patch.
src/Schema/Visitor/Graphviz.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -40,10 +40,10 @@
 block discarded – undo
40 40
      */
41 41
     public function acceptSchema(Schema $schema)
42 42
     {
43
-        $this->output  = 'digraph "' . sha1((string) mt_rand()) . '" {' . "\n";
44
-        $this->output .= 'graph [fontname="helvetica", fontsize=12];' . "\n";
45
-        $this->output .= 'node [fontname="helvetica", fontsize=12];' . "\n";
46
-        $this->output .= 'edge [fontname="helvetica", fontsize=12];' . "\n";
43
+        $this->output  = 'digraph "'.sha1((string) mt_rand()).'" {'."\n";
44
+        $this->output .= 'graph [fontname="helvetica", fontsize=12];'."\n";
45
+        $this->output .= 'node [fontname="helvetica", fontsize=12];'."\n";
46
+        $this->output .= 'edge [fontname="helvetica", fontsize=12];'."\n";
47 47
 //        $this->output .= 'splines = true;' . "\n";
48 48
 //        $this->output .= 'overlap = false;' . "\n";
49 49
 //        $this->output .= 'outputorder=edgesfirst;'."\n";
Please login to merge, or discard this patch.
src/Schema/Resolver.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
     public function diff($listDrop = true)
74 74
     {
75 75
         $queries = $this->schema()
76
-            ->simulate(function (SchemaManagerInterface $schema) use ($listDrop) {
76
+            ->simulate(function(SchemaManagerInterface $schema) use ($listDrop) {
77 77
                 $schema->useDrop($listDrop);
78 78
                 $schema->add($this->table());
79 79
             })
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
         }
85 85
 
86 86
         $sequenceQueries = $schemaSequence
87
-            ->simulate(function (SchemaManagerInterface $schema) use ($listDrop) {
87
+            ->simulate(function(SchemaManagerInterface $schema) use ($listDrop) {
88 88
                 $schema->useDrop($listDrop);
89 89
                 $schema->add($this->sequence());
90 90
             })
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 
160 160
         /** @var ConnectionInterface&\Doctrine\DBAL\Connection $connection */
161 161
         $connection = $this->connection($this->metadata->sequence['connection']);
162
-        $table  = $this->metadata->sequence['table'];
162
+        $table = $this->metadata->sequence['table'];
163 163
 
164 164
         /** @psalm-suppress UndefinedInterfaceMethod */
165 165
         $nb = $connection->from($table)->count();
Please login to merge, or discard this patch.
src/Schema/Adapter/Metadata/MetadataIndexSet.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
      */
43 43
     public function all()
44 44
     {
45
-        $indexes =  $this->extractIndexes($this->metadata->indexes);
45
+        $indexes = $this->extractIndexes($this->metadata->indexes);
46 46
 
47 47
         if ($primary = $this->primary()) {
48 48
             $indexes[$primary->name()] = $primary;
Please login to merge, or discard this patch.
src/Sharding/ShardingQuery.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
         $count = 0;
114 114
 
115 115
         foreach ($this->execute() as $result) {
116
-            $count += (int)$result['aggregate'];
116
+            $count += (int) $result['aggregate'];
117 117
         }
118 118
 
119 119
         $this->compilerState->invalidate(['columns', 'orders']);
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
     #[ReadOperation]
129 129
     public function count(?string $column = null): int
130 130
     {
131
-        return (int)array_sum($this->aggregate(__FUNCTION__, $column));
131
+        return (int) array_sum($this->aggregate(__FUNCTION__, $column));
132 132
     }
133 133
 
134 134
     /**
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
     {
140 140
         $numbers = $this->aggregate(__FUNCTION__, $column);
141 141
 
142
-        return array_sum($numbers)/count($numbers);
142
+        return array_sum($numbers) / count($numbers);
143 143
     }
144 144
 
145 145
     /**
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
     #[ReadOperation]
167 167
     public function sum(?string $column = null): float
168 168
     {
169
-        return (float)array_sum($this->aggregate(__FUNCTION__, $column));
169
+        return (float) array_sum($this->aggregate(__FUNCTION__, $column));
170 170
     }
171 171
 
172 172
     /**
Please login to merge, or discard this patch.
src/Test/TestPack.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
      * @var array{persistent:object[], non-persistent: object[]}
33 33
      */
34 34
     protected $testPacks = [
35
-        'persistent'        => [],  // Entités créées non modifiables
35
+        'persistent'        => [], // Entités créées non modifiables
36 36
         'non-persistent'    => []   // Entités créées et détruites aprés un test
37 37
     ];
38 38
 
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 
161 161
         // On ajoute la classe de l'entité uniquement si elle n'est pas déjà dans le tableau et si le test pack n'a pas démarré de savepoint
162 162
         foreach ($entityClasses as $entityClassName) {
163
-            if (! in_array($entityClassName, $this->entityClasses)) {
163
+            if (!in_array($entityClassName, $this->entityClasses)) {
164 164
                 if ($this->initialized) {
165 165
                     $this->create([$entityClassName]);
166 166
                 } else {
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
      */
221 221
     public function onInit(callable $callback)
222 222
     {
223
-        if (! $this->initialized) {
223
+        if (!$this->initialized) {
224 224
             $this->once('testpack.initialized', $callback);
225 225
         }
226 226
 
Please login to merge, or discard this patch.
src/Repository/EntityRepository.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
     #[ReadOperation]
325 325
     public function loadRelations($entity, $relations): void
326 326
     {
327
-        foreach (Relation::sanitizeRelations((array)$relations) as $relationName => $meta) {
327
+        foreach (Relation::sanitizeRelations((array) $relations) as $relationName => $meta) {
328 328
             $this->relation($relationName)->loadIfNotLoaded(
329 329
                 new SingleEntityIndexer($this->mapper, $entity),
330 330
                 $meta['relations'],
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
     #[ReadOperation]
348 348
     public function reloadRelations($entity, $relations): void
349 349
     {
350
-        foreach (Relation::sanitizeRelations((array)$relations) as $relationName => $meta) {
350
+        foreach (Relation::sanitizeRelations((array) $relations) as $relationName => $meta) {
351 351
             $this->relation($relationName)->load(
352 352
                 new SingleEntityIndexer($this->mapper, $entity),
353 353
                 $meta['relations'],
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
     #[WriteOperation]
388 388
     public function saveAll($entity, $relations): int
389 389
     {
390
-        $relations = Relation::sanitizeRelations((array)$relations);
390
+        $relations = Relation::sanitizeRelations((array) $relations);
391 391
 
392 392
         return $this->transaction(function() use($entity, $relations) {
393 393
             $nb = $this->save($entity);
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
     #[WriteOperation]
407 407
     public function deleteAll($entity, $relations): int
408 408
     {
409
-        $relations = Relation::sanitizeRelations((array)$relations);
409
+        $relations = Relation::sanitizeRelations((array) $relations);
410 410
 
411 411
         return $this->transaction(function() use($entity, $relations) {
412 412
             $nb = $this->delete($entity);
Please login to merge, or discard this patch.
src/Mapper/Mapper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
     public function setGenerator($generator): void
289 289
     {
290 290
         if (!is_string($generator) && !$generator instanceof GeneratorInterface) {
291
-            throw new LogicException('Trying to set an invalid generator in "' . get_class($this) . '"');
291
+            throw new LogicException('Trying to set an invalid generator in "'.get_class($this).'"');
292 292
         }
293 293
         
294 294
         $this->generator = $generator;
@@ -514,7 +514,7 @@  discard block
 block discarded – undo
514 514
         $relations = $this->relations();
515 515
         
516 516
         if (!isset($relations[$relationName])) {
517
-            throw new RelationNotFoundException('Relation "' . $relationName . '" is not set in ' . $this->metadata->entityName);
517
+            throw new RelationNotFoundException('Relation "'.$relationName.'" is not set in '.$this->metadata->entityName);
518 518
         }
519 519
         
520 520
         return $relations[$relationName];
@@ -688,7 +688,7 @@  discard block
 block discarded – undo
688 688
      */
689 689
     public function scopes()
690 690
     {
691
-        throw new LogicException('No scopes have been defined in "' . get_class($this) . '"');
691
+        throw new LogicException('No scopes have been defined in "'.get_class($this).'"');
692 692
     }
693 693
 
694 694
     /**
Please login to merge, or discard this patch.
src/Mapper/Metadata.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -890,7 +890,7 @@  discard block
 block discarded – undo
890 890
             $attributePath = $attribute;
891 891
             $path          = null;
892 892
         } else {
893
-            $attributePath = $embeddedMeta['path'] . '.' . $attribute;
893
+            $attributePath = $embeddedMeta['path'].'.'.$attribute;
894 894
             $path          = $embeddedMeta['path'];
895 895
         }
896 896
 
@@ -944,7 +944,7 @@  discard block
 block discarded – undo
944 944
         
945 945
         $this->sequence = [
946 946
             'connection' => $sequence['connection'] ?? $this->connection,
947
-            'table'      => $sequence['table'] ?? $this->table . '_seq',
947
+            'table'      => $sequence['table'] ?? $this->table.'_seq',
948 948
             'column'     => $sequence['column'] ?? 'id',
949 949
             'options'    => $sequence['tableOptions'] ?? [],
950 950
         ];
Please login to merge, or discard this patch.