Passed
Push — fix-FRAM-102-disallow-using-sa... ( a4f1ec...3b9f7b )
by Vincent
23:20 queued 17:19
created
src/Entity/EntityGenerator.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 
254 254
         foreach ($file->getNamespaces() as $foundNs) {
255 255
             foreach ($foundNs->getClasses() as $foundClass) {
256
-                if ($this->mapperInfo->className() === $foundNs->getName() . '\\' . $foundClass->getName()) {
256
+                if ($this->mapperInfo->className() === $foundNs->getName().'\\'.$foundClass->getName()) {
257 257
                     $namespace = $foundNs;
258 258
                     $class = $foundClass;
259 259
                     break;
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
         }
263 263
 
264 264
         if (!$namespace || !$class) {
265
-            throw new \InvalidArgumentException('The file do not contains class definition of ' . $this->mapperInfo->className());
265
+            throw new \InvalidArgumentException('The file do not contains class definition of '.$this->mapperInfo->className());
266 266
         }
267 267
 
268 268
         $this->generateEntityBody(new EntityClassGenerator($class, $namespace));
@@ -549,7 +549,7 @@  discard block
 block discarded – undo
549 549
                 case $property->isArray() && $property->wrapper() === null:
550 550
                     // Simple array relation
551 551
                     $generator->setDefaultValue([]);
552
-                    $generator->setVarTag($property->className() . '[]');
552
+                    $generator->setVarTag($property->className().'[]');
553 553
 
554 554
                     if ($this->useTypedProperties) {
555 555
                         $generator->setTypeHint('array');
@@ -559,7 +559,7 @@  discard block
 block discarded – undo
559 559
                 case $property->isArray() && $property->wrapper() !== null:
560 560
                     // Array relation with wrapper
561 561
                     $repository = $this->prime->repository($property->className());
562
-                    $generator->setVarTag($repository->collectionFactory()->wrapperClass($property->wrapper()) . '|' . $property->className() . '[]');
562
+                    $generator->setVarTag($repository->collectionFactory()->wrapperClass($property->wrapper()).'|'.$property->className().'[]');
563 563
 
564 564
                     // The value is an object : so the default value must be null
565 565
                     if ($nullable) {
@@ -614,7 +614,7 @@  discard block
 block discarded – undo
614 614
             $variableName = $this->inflector->camelize($fieldName);
615 615
             $methodName = $variableName;
616 616
         } else {
617
-            $methodName = $prefix . $this->inflector->classify($fieldName);
617
+            $methodName = $prefix.$this->inflector->classify($fieldName);
618 618
             $variableName = $this->inflector->camelize($fieldName);
619 619
         }
620 620
 
@@ -646,7 +646,7 @@  discard block
 block discarded – undo
646 646
                 $repository = $this->prime->repository($propertyInfo->className());
647 647
 
648 648
                 $methodTypeHint = $repository->collectionFactory()->wrapperClass($propertyInfo->wrapper());
649
-                $variableType = $generator->simplifyType($propertyInfo->className()) . '[]|'.$generator->simplifyType($methodTypeHint);
649
+                $variableType = $generator->simplifyType($propertyInfo->className()).'[]|'.$generator->simplifyType($methodTypeHint);
650 650
             } else {
651 651
                 $methodTypeHint = 'array';
652 652
                 $variableType = $propertyInfo->isObject() ? $propertyInfo->className() : $propertyInfo->phpType();
@@ -676,14 +676,14 @@  discard block
 block discarded – undo
676 676
         }
677 677
 
678 678
         $method = $generator->addMethod($metadata['method']);
679
-        $method->addComment('Get ' . $metadata['variable']);
679
+        $method->addComment('Get '.$metadata['variable']);
680 680
         $method->addComment('');
681 681
         $method->setReturnType($metadata['typeHint']);
682 682
         $method->setReturnNullable($metadata['nullable']);
683 683
         $method->setBody('return $this->?;', [$metadata['field']]);
684 684
 
685 685
         if ($metadata['docType']) {
686
-            $method->addComment('@return ' . $metadata['docType']);
686
+            $method->addComment('@return '.$metadata['docType']);
687 687
         }
688 688
     }
689 689
 
@@ -696,11 +696,11 @@  discard block
 block discarded – undo
696 696
         }
697 697
 
698 698
         $method = $generator->addMethod($metadata['method']);
699
-        $method->addComment('Set ' . $metadata['variable']);
699
+        $method->addComment('Set '.$metadata['variable']);
700 700
         $method->addComment('');
701 701
 
702 702
         if ($metadata['docType']) {
703
-            $method->addComment('@param ' . $metadata['docType'] . ' $' . $metadata['variable']);
703
+            $method->addComment('@param '.$metadata['docType'].' $'.$metadata['variable']);
704 704
             $method->addComment('');
705 705
         }
706 706
 
@@ -725,11 +725,11 @@  discard block
 block discarded – undo
725 725
         }
726 726
 
727 727
         $method = $generator->addMethod($metadata['method']);
728
-        $method->addComment('Add ' . $metadata['variable']);
728
+        $method->addComment('Add '.$metadata['variable']);
729 729
         $method->addComment('');
730 730
 
731 731
         if ($metadata['docType']) {
732
-            $method->addComment('@param ' . $metadata['docType'] . ' $' . $metadata['variable']);
732
+            $method->addComment('@param '.$metadata['docType'].' $'.$metadata['variable']);
733 733
             $method->addComment('');
734 734
         }
735 735
 
@@ -875,7 +875,7 @@  discard block
 block discarded – undo
875 875
     public function setFieldVisibility(string $visibility): void
876 876
     {
877 877
         if ($visibility !== static::FIELD_VISIBLE_PRIVATE && $visibility !== static::FIELD_VISIBLE_PROTECTED) {
878
-            throw new \InvalidArgumentException('Invalid provided visibility (only private and protected are allowed): ' . $visibility);
878
+            throw new \InvalidArgumentException('Invalid provided visibility (only private and protected are allowed): '.$visibility);
879 879
         }
880 880
 
881 881
         $this->fieldVisibility = $visibility;
@@ -1142,7 +1142,7 @@  discard block
 block discarded – undo
1142 1142
                 continue;
1143 1143
             }
1144 1144
 
1145
-            $part = $generator->simplifyType($atomicType) . ($isArray ? '[]' : '');
1145
+            $part = $generator->simplifyType($atomicType).($isArray ? '[]' : '');
1146 1146
         }
1147 1147
 
1148 1148
         return implode('|', $types);
Please login to merge, or discard this patch.