Test Failed
Push — master ( 324ce1...c0782f )
by Sébastien
09:01
created
src/Entity/Extensions/ArrayInjector.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
         }
27 27
 
28 28
         foreach ($data as $attribute => $value) {
29
-            $method = 'set' . ucfirst($attribute);
29
+            $method = 'set'.ucfirst($attribute);
30 30
             $exists = property_exists($this, $attribute);
31 31
             
32 32
             if ($exists && $this->$attribute instanceof ImportableInterface && !$value instanceof ImportableInterface) {
Please login to merge, or discard this patch.
src/Entity/Hydrator/ArrayHydrator.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
      */
21 21
     public function hydrate($object, array $data)
22 22
     {
23
-        $privatePrefix = "\0" . get_class($object) . "\0";
23
+        $privatePrefix = "\0".get_class($object)."\0";
24 24
         $privatePrefixLen = strlen($privatePrefix);
25 25
 
26 26
         foreach ((array) $object as $name => $property) {
@@ -38,8 +38,8 @@  discard block
 block discarded – undo
38 38
 
39 39
             if ($property instanceof ImportableInterface && is_array($value)) {
40 40
                 $property->import($value);
41
-            } elseif (method_exists($object, 'set' . ucfirst($name))) {
42
-                $object->{'set' . ucfirst($name)}($value);
41
+            } elseif (method_exists($object, 'set'.ucfirst($name))) {
42
+                $object->{'set'.ucfirst($name)}($value);
43 43
             } else {
44 44
                 $object->$name = $value;
45 45
             }
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
         $values = [];
55 55
         $attributes = array_flip($attributes);
56 56
 
57
-        $privatePrefix = "\0" . get_class($object) . "\0";
57
+        $privatePrefix = "\0".get_class($object)."\0";
58 58
         $privatePrefixLen = strlen($privatePrefix);
59 59
 
60 60
         foreach ((array) $object as $name => $property) {
Please login to merge, or discard this patch.
src/Entity/Hydrator/HydratorGenerator.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
      */
125 125
     public function hydratorClassName()
126 126
     {
127
-        return 'Hydrator_' . str_replace('\\', '_', $this->className);
127
+        return 'Hydrator_'.str_replace('\\', '_', $this->className);
128 128
     }
129 129
 
130 130
     /**
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
      */
135 135
     public function hydratorFullClassName()
136 136
     {
137
-        return $this->hydratorNamespace() . '\\' . $this->hydratorClassName();
137
+        return $this->hydratorNamespace().'\\'.$this->hydratorClassName();
138 138
     }
139 139
 
140 140
     /**
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
                 if (!isset($classes[$class])) {
167 167
                     $classes[$class] = true;
168 168
 
169
-                    $property = '__' . str_replace('\\', '_', $class) . '_hydrator';
169
+                    $property = '__'.str_replace('\\', '_', $class).'_hydrator';
170 170
                     $this->embeddedHydrators[$class] = $property;
171 171
                 }
172 172
             }
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
     protected function generateEmbeddedHydrate(AttributeInfo $attribute)
259 259
     {
260 260
         // We can have multiple entity classes for one attribute : morph
261
-        $varName = '$__rel_' . str_replace('.', '_', $attribute->name());
261
+        $varName = '$__rel_'.str_replace('.', '_', $attribute->name());
262 262
 
263 263
         $hydrators = [];
264 264
 
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
             return '$this';
294 294
         }
295 295
 
296
-        return '$this->' . $this->embeddedHydrators[$class];
296
+        return '$this->'.$this->embeddedHydrators[$class];
297 297
     }
298 298
 
299 299
     /**
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
      */
306 306
     protected function normalizeClassName($className)
307 307
     {
308
-        return '\\' . ltrim($className, '\\');
308
+        return '\\'.ltrim($className, '\\');
309 309
     }
310 310
 
311 311
     /**
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
             $lines[] = "'{$attribute->name()}' => ({$this->generateExtractValue($attribute)})";
349 349
         }
350 350
 
351
-        return 'return [' . implode(', ', $lines) . '];';
351
+        return 'return ['.implode(', ', $lines).'];';
352 352
     }
353 353
 
354 354
     /**
@@ -391,8 +391,8 @@  discard block
 block discarded – undo
391 391
         $line = '';
392 392
 
393 393
         if ($attribute->isEmbedded()) {
394
-            $varName = '$__rel_' . str_replace('.', '_', $attribute->name());
395
-            $line .= '(' . $varName . ' = '.$this->accessor->getter('$object', $attribute->property()) . ") === null ? null : ";
394
+            $varName = '$__rel_'.str_replace('.', '_', $attribute->name());
395
+            $line .= '('.$varName.' = '.$this->accessor->getter('$object', $attribute->property()).") === null ? null : ";
396 396
 
397 397
             foreach ($attribute->embedded()->classes() as $class) {
398 398
                 if ($this->resolver->isImportable($class)) {
@@ -626,7 +626,7 @@  discard block
 block discarded – undo
626 626
      */
627 627
     protected function generateExtractOneCaseEmbedded(EmbeddedInfo $embedded)
628 628
     {
629
-        $varName = '$__' . str_replace('.', '_', $embedded->path());
629
+        $varName = '$__'.str_replace('.', '_', $embedded->path());
630 630
         $code = $this->accessors->embedded($embedded)->getEmbedded($varName, false);
631 631
 
632 632
         return $this->code->lines([$code, 'return '.$varName.';']);
Please login to merge, or discard this patch.
src/Entity/Hydrator/Generator/AttributesResolver.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -317,7 +317,7 @@
 block discarded – undo
317 317
                 return array_unique($classes);
318 318
 
319 319
             default:
320
-                throw new HydratorException($this->mapper->getEntityClass(), 'Cannot handle relation type ' . $relation['type']);
320
+                throw new HydratorException($this->mapper->getEntityClass(), 'Cannot handle relation type '.$relation['type']);
321 321
         }
322 322
     }
323 323
 }
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) { return '$'.$p; }, $properties));
72
+        $parameters = implode(', ', array_map(function($p) { return '$'.$p; }, $properties));
73 73
         $content = '';
74 74
 
75 75
         foreach ($properties as $property) {
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
                 $content .= $this->eol;
78 78
             }
79 79
 
80
-            $content .= '$this->' . $property . ' = $' . $property . ';';
80
+            $content .= '$this->'.$property.' = $'.$property.';';
81 81
         }
82 82
 
83 83
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
     {
102 102
         $spaces = str_repeat($this->tab, $tabs);
103 103
 
104
-        return $spaces . str_replace($this->eol, $this->eol.$spaces, $code);
104
+        return $spaces.str_replace($this->eol, $this->eol.$spaces, $code);
105 105
     }
106 106
 
107 107
     /**
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
      *
160 160
      * @return string
161 161
      */
162
-    public function switch($varName, array $cases, $default = null)
162
+    public function switch ($varName, array $cases, $default = null)
163 163
     {
164 164
         $code = 'switch ('.$varName.') {'.$this->eol;
165 165
 
Please login to merge, or discard this patch.
src/Entity/Hydrator/Generator/ClassAccessor.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
             }
88 88
         }
89 89
 
90
-        throw new HydratorException($this->className, 'Cannot get the value of property "' . $attribute . '"');
90
+        throw new HydratorException($this->className, 'Cannot get the value of property "'.$attribute.'"');
91 91
     }
92 92
 
93 93
     /**
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
             return $varName.'->set'.ucfirst($attribute).'('.$value.')';
115 115
         }
116 116
 
117
-        throw new HydratorException($this->className, 'Cannot access to attribute "' . $attribute . '" on write');
117
+        throw new HydratorException($this->className, 'Cannot access to attribute "'.$attribute.'" on write');
118 118
     }
119 119
 
120 120
     /**
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
                 }
159 159
             }
160 160
         } catch (\ReflectionException $e) {
161
-            throw new HydratorException($this->className, 'Cannot access to the property ' . $prop, $e);
161
+            throw new HydratorException($this->className, 'Cannot access to the property '.$prop, $e);
162 162
         }
163 163
 
164 164
         return true;
Please login to merge, or discard this patch.
src/Entity/EntityGenerator.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
         $body = str_replace('<spaces>', $this->spaces, $body);
357 357
         $last = strrpos($currentCode, '}');
358 358
 
359
-        return substr($currentCode, 0, $last) . $body . (strlen($body) > 0 ? "\n" : '') . "}\n";
359
+        return substr($currentCode, 0, $last).$body.(strlen($body) > 0 ? "\n" : '')."}\n";
360 360
     }
361 361
 
362 362
     /**
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
     protected function generateEntityNamespace()
366 366
     {
367 367
         if ($this->hasNamespace($this->mapperInfo->className())) {
368
-            return 'namespace ' . $this->getNamespace($this->mapperInfo->className()) .';' . "\n\n";
368
+            return 'namespace '.$this->getNamespace($this->mapperInfo->className()).';'."\n\n";
369 369
         }
370 370
     }
371 371
 
@@ -379,18 +379,18 @@  discard block
 block discarded – undo
379 379
         $use = [];
380 380
         
381 381
         if ($this->hasNamespace($this->getClassToExtend())) {
382
-            $use[$this->getClassToExtend()] = 'use ' . $this->getClassToExtend() . ';';
382
+            $use[$this->getClassToExtend()] = 'use '.$this->getClassToExtend().';';
383 383
         }
384 384
         
385 385
         foreach ($this->interfaces as $interface) {
386 386
             if ($this->hasNamespace($interface)) {
387
-                $use[$interface] = 'use ' . $interface . ';';
387
+                $use[$interface] = 'use '.$interface.';';
388 388
             }
389 389
         }
390 390
         
391 391
         foreach ($this->traits as $trait) {
392 392
             if ($this->hasNamespace($trait)) {
393
-                $use[$trait] = 'use ' . $trait . ';';
393
+                $use[$trait] = 'use '.$trait.';';
394 394
             }
395 395
         }
396 396
         
@@ -420,7 +420,7 @@  discard block
 block discarded – undo
420 420
         
421 421
         sort($use);
422 422
         
423
-        return implode("\n", $use) . "\n\n";
423
+        return implode("\n", $use)."\n\n";
424 424
     }
425 425
     
426 426
     /**
@@ -428,9 +428,9 @@  discard block
 block discarded – undo
428 428
      */
429 429
     protected function generateEntityClassName()
430 430
     {
431
-        return 'class ' . $this->getClassName($this->mapperInfo->className()) .
432
-            ($this->classToExtend ? ' extends ' . $this->getClassToExtendName() : null) .
433
-            ($this->interfaces ? ' implements ' . $this->getInterfacesToImplement() : null);
431
+        return 'class '.$this->getClassName($this->mapperInfo->className()).
432
+            ($this->classToExtend ? ' extends '.$this->getClassToExtendName() : null).
433
+            ($this->interfaces ? ' implements '.$this->getInterfacesToImplement() : null);
434 434
     }
435 435
 
436 436
     /**
@@ -445,10 +445,10 @@  discard block
 block discarded – undo
445 445
         $traits = '';
446 446
         
447 447
         foreach ($this->traits as $trait) {
448
-            $traits .= $this->spaces . 'use ' . $this->getRelativeClassName($trait) . ';' . "\n";
448
+            $traits .= $this->spaces.'use '.$this->getRelativeClassName($trait).';'."\n";
449 449
         }
450 450
         
451
-        return $traits . "\n";
451
+        return $traits."\n";
452 452
     }
453 453
 
454 454
     /**
@@ -553,7 +553,7 @@  discard block
 block discarded – undo
553 553
     {
554 554
         $lines = array();
555 555
         $lines[] = '/**';
556
-        $lines[] = ' * ' . $this->getClassName($this->mapperInfo->className());
556
+        $lines[] = ' * '.$this->getClassName($this->mapperInfo->className());
557 557
         $lines[] = ' */';
558 558
         
559 559
         return implode("\n", $lines);
@@ -684,7 +684,7 @@  discard block
 block discarded – undo
684 684
             $variableName = Inflector::camelize($fieldName);
685 685
             $methodName = $variableName;
686 686
         } else {
687
-            $methodName = $type . Inflector::classify($fieldName);
687
+            $methodName = $type.Inflector::classify($fieldName);
688 688
             $variableName = Inflector::camelize($fieldName);
689 689
         }
690 690
         
@@ -701,7 +701,7 @@  discard block
 block discarded – undo
701 701
 
702 702
         if ($propertyInfo->isObject()) {
703 703
             $variableType = $this->getRelativeClassName($propertyInfo->className());
704
-            $methodTypeHint =  $variableType.' ';
704
+            $methodTypeHint = $variableType.' ';
705 705
         } else {
706 706
             $variableType = $propertyInfo->phpType();
707 707
             $methodTypeHint = null;
@@ -730,7 +730,7 @@  discard block
 block discarded – undo
730 730
           '<variableName>'      => $variableName,
731 731
           '<methodName>'        => $methodName,
732 732
           '<fieldName>'         => $fieldName,
733
-          '<variableDefault>'   => ($defaultValue !== null ) ? (' = '.$defaultValue) : ''
733
+          '<variableDefault>'   => ($defaultValue !== null) ? (' = '.$defaultValue) : ''
734 734
         );
735 735
 
736 736
         $method = str_replace(
@@ -805,9 +805,9 @@  discard block
 block discarded – undo
805 805
     protected function generateFieldMappingPropertyDocBlock($property)
806 806
     {
807 807
         $lines = array();
808
-        $lines[] = $this->spaces . '/**';
809
-        $lines[] = $this->spaces . ' * @var '.$property->phpType();
810
-        $lines[] = $this->spaces . ' */';
808
+        $lines[] = $this->spaces.'/**';
809
+        $lines[] = $this->spaces.' * @var '.$property->phpType();
810
+        $lines[] = $this->spaces.' */';
811 811
 
812 812
         return implode("\n", $lines);
813 813
     }
@@ -836,9 +836,9 @@  discard block
 block discarded – undo
836 836
         }
837 837
         
838 838
         $lines = array();
839
-        $lines[] = $this->spaces . '/**';
840
-        $lines[] = $this->spaces . ' * @var '.$className;
841
-        $lines[] = $this->spaces . ' */';
839
+        $lines[] = $this->spaces.'/**';
840
+        $lines[] = $this->spaces.' * @var '.$className;
841
+        $lines[] = $this->spaces.' */';
842 842
 
843 843
         return implode("\n", $lines);
844 844
     }
@@ -879,7 +879,7 @@  discard block
 block discarded – undo
879 879
 
880 880
             if ($inClass) {
881 881
                 $inClass = false;
882
-                $lastSeenClass = $lastSeenNamespace . ($lastSeenNamespace ? '\\' : '') . $token[1];
882
+                $lastSeenClass = $lastSeenNamespace.($lastSeenNamespace ? '\\' : '').$token[1];
883 883
                 $this->staticReflection[$lastSeenClass]['properties'] = array();
884 884
                 $this->staticReflection[$lastSeenClass]['methods'] = array();
885 885
             }
@@ -887,16 +887,16 @@  discard block
 block discarded – undo
887 887
             if ($token[0] == T_NAMESPACE) {
888 888
                 $lastSeenNamespace = "";
889 889
                 $inNamespace = true;
890
-            } elseif ($token[0] == T_CLASS && $tokens[$i-1][0] != T_DOUBLE_COLON) {
890
+            } elseif ($token[0] == T_CLASS && $tokens[$i - 1][0] != T_DOUBLE_COLON) {
891 891
                 $inClass = true;
892 892
             } elseif ($token[0] == T_FUNCTION) {
893
-                if ($tokens[$i+2][0] == T_STRING) {
894
-                    $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i+2][1]);
895
-                } elseif ($tokens[$i+2] == "&" && $tokens[$i+3][0] == T_STRING) {
896
-                    $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i+3][1]);
893
+                if ($tokens[$i + 2][0] == T_STRING) {
894
+                    $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i + 2][1]);
895
+                } elseif ($tokens[$i + 2] == "&" && $tokens[$i + 3][0] == T_STRING) {
896
+                    $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i + 3][1]);
897 897
                 }
898
-            } elseif (in_array($token[0], array(T_VAR, T_PUBLIC, T_PRIVATE, T_PROTECTED)) && $tokens[$i+2][0] != T_FUNCTION) {
899
-                $this->staticReflection[$lastSeenClass]['properties'][] = substr($tokens[$i+2][1], 1);
898
+            } elseif (in_array($token[0], array(T_VAR, T_PUBLIC, T_PRIVATE, T_PROTECTED)) && $tokens[$i + 2][0] != T_FUNCTION) {
899
+                $this->staticReflection[$lastSeenClass]['properties'][] = substr($tokens[$i + 2][1], 1);
900 900
             }
901 901
         }
902 902
     }
@@ -971,7 +971,7 @@  discard block
 block discarded – undo
971 971
         if ($this->hasNamespace($className)) {
972 972
             return $this->getClassName($className);
973 973
         } else {
974
-            return '\\' . $className;
974
+            return '\\'.$className;
975 975
         }
976 976
     }
977 977
     
@@ -1072,8 +1072,8 @@  discard block
 block discarded – undo
1072 1072
         $lines = explode("\n", $code);
1073 1073
 
1074 1074
         foreach ($lines as $key => $value) {
1075
-            if ( ! empty($value)) {
1076
-                $lines[$key] = str_repeat($this->spaces, $num) . $lines[$key];
1075
+            if (!empty($value)) {
1076
+                $lines[$key] = str_repeat($this->spaces, $num).$lines[$key];
1077 1077
             }
1078 1078
         }
1079 1079
 
@@ -1102,7 +1102,7 @@  discard block
 block discarded – undo
1102 1102
         }
1103 1103
         
1104 1104
         if (is_string($value)) {
1105
-            return "'" . $value . "'";
1105
+            return "'".$value."'";
1106 1106
         }
1107 1107
         
1108 1108
         if (is_bool($value)) {
@@ -1239,7 +1239,7 @@  discard block
 block discarded – undo
1239 1239
     public function setFieldVisibility(string $visibility): void
1240 1240
     {
1241 1241
         if ($visibility !== static::FIELD_VISIBLE_PRIVATE && $visibility !== static::FIELD_VISIBLE_PROTECTED) {
1242
-            throw new \InvalidArgumentException('Invalid provided visibility (only private and protected are allowed): ' . $visibility);
1242
+            throw new \InvalidArgumentException('Invalid provided visibility (only private and protected are allowed): '.$visibility);
1243 1243
         }
1244 1244
 
1245 1245
         $this->fieldVisibility = $visibility;
Please login to merge, or discard this patch.
src/Relations/MorphTo.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@
 block discarded – undo
91 91
      */
92 92
     public function join($query, $alias = null)
93 93
     {
94
-        $parts = explode('#', (string)$alias);
94
+        $parts = explode('#', (string) $alias);
95 95
 
96 96
         if (!isset($parts[1])) {
97 97
             throw new \LogicException('Joins are not supported on polymorph without discriminator');
Please login to merge, or discard this patch.
src/Entity/Hydrator/Generator/TypeAccessor.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
      *
40 40
      * @param string $type
41 41
      */
42
-    public function declare(string $type): void
42
+    public function declare(string$type): void
43 43
     {
44 44
         if (isset($this->declaredTypes[$type])) {
45 45
             return;
Please login to merge, or discard this patch.