Passed
Push — 2.8.x ( 4aa098...ca95b0 )
by Benjamin
10:30 queued 04:10
created
lib/Doctrine/ORM/Tools/EntityGenerator.php 2 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1299,7 +1299,7 @@  discard block
 block discarded – undo
1299 1299
 
1300 1300
             $lines[] = $this->generateAssociationMappingPropertyDocBlock($associationMapping, $metadata);
1301 1301
             $lines[] = $this->spaces . $this->fieldVisibility . ' $' . $associationMapping['fieldName']
1302
-                     . ($associationMapping['type'] == 'manyToMany' ? ' = array()' : null) . ";\n";
1302
+                        . ($associationMapping['type'] == 'manyToMany' ? ' = array()' : null) . ";\n";
1303 1303
         }
1304 1304
 
1305 1305
         return implode("\n", $lines);
@@ -1395,14 +1395,14 @@  discard block
 block discarded – undo
1395 1395
         }
1396 1396
 
1397 1397
         $replacements = [
1398
-          '<description>'       => ucfirst($type) . ' ' . $variableName . '.',
1399
-          '<methodTypeHint>'    => $methodTypeHint,
1400
-          '<variableType>'      => $variableType . (null !== $defaultValue ? ('|' . $defaultValue) : ''),
1401
-          '<variableName>'      => $variableName,
1402
-          '<methodName>'        => $methodName,
1403
-          '<fieldName>'         => $fieldName,
1404
-          '<variableDefault>'   => ($defaultValue !== null ) ? (' = ' . $defaultValue) : '',
1405
-          '<entity>'            => $this->getClassName($metadata)
1398
+            '<description>'       => ucfirst($type) . ' ' . $variableName . '.',
1399
+            '<methodTypeHint>'    => $methodTypeHint,
1400
+            '<variableType>'      => $variableType . (null !== $defaultValue ? ('|' . $defaultValue) : ''),
1401
+            '<variableName>'      => $variableName,
1402
+            '<methodName>'        => $methodName,
1403
+            '<fieldName>'         => $fieldName,
1404
+            '<variableDefault>'   => ($defaultValue !== null ) ? (' = ' . $defaultValue) : '',
1405
+            '<entity>'            => $this->getClassName($metadata)
1406 1406
         ];
1407 1407
 
1408 1408
         $method = str_replace(
Please login to merge, or discard this patch.
Spacing   +151 added lines, -151 removed lines patch added patch discarded remove patch
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
      */
341 341
     public function __construct()
342 342
     {
343
-        @trigger_error(self::class . ' is deprecated and will be removed in Doctrine ORM 3.0', E_USER_DEPRECATED);
343
+        @trigger_error(self::class.' is deprecated and will be removed in Doctrine ORM 3.0', E_USER_DEPRECATED);
344 344
 
345 345
         if (version_compare(\Doctrine\Common\Version::VERSION, '2.2.0-DEV', '>=')) {
346 346
             $this->annotationsPrefix = 'ORM\\';
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
      */
375 375
     public function writeEntityClass(ClassMetadataInfo $metadata, $outputDirectory)
376 376
     {
377
-        $path = $outputDirectory . '/' . str_replace('\\', DIRECTORY_SEPARATOR, $metadata->name) . $this->extension;
377
+        $path = $outputDirectory.'/'.str_replace('\\', DIRECTORY_SEPARATOR, $metadata->name).$this->extension;
378 378
         $dir = dirname($path);
379 379
 
380 380
         if ( ! is_dir($dir)) {
@@ -390,8 +390,8 @@  discard block
 block discarded – undo
390 390
         }
391 391
 
392 392
         if ($this->backupExisting && file_exists($path)) {
393
-            $backupPath = dirname($path) . DIRECTORY_SEPARATOR . basename($path) . "~";
394
-            if (!copy($path, $backupPath)) {
393
+            $backupPath = dirname($path).DIRECTORY_SEPARATOR.basename($path)."~";
394
+            if ( ! copy($path, $backupPath)) {
395 395
                 throw new \RuntimeException("Attempt to backup overwritten entity file but copy operation failed.");
396 396
             }
397 397
         }
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
         $body = str_replace('<spaces>', $this->spaces, $body);
453 453
         $last = strrpos($currentCode, '}');
454 454
 
455
-        return substr($currentCode, 0, $last) . $body . ($body ? "\n" : '') . "}\n";
455
+        return substr($currentCode, 0, $last).$body.($body ? "\n" : '')."}\n";
456 456
     }
457 457
 
458 458
     /**
@@ -516,7 +516,7 @@  discard block
 block discarded – undo
516 516
     public function setFieldVisibility($visibility)
517 517
     {
518 518
         if ($visibility !== static::FIELD_VISIBLE_PRIVATE && $visibility !== static::FIELD_VISIBLE_PROTECTED) {
519
-            throw new \InvalidArgumentException('Invalid provided visibility (only private and protected are allowed): ' . $visibility);
519
+            throw new \InvalidArgumentException('Invalid provided visibility (only private and protected are allowed): '.$visibility);
520 520
         }
521 521
 
522 522
         $this->fieldVisibility = $visibility;
@@ -613,11 +613,11 @@  discard block
 block discarded – undo
613 613
      */
614 614
     protected function generateEntityNamespace(ClassMetadataInfo $metadata)
615 615
     {
616
-        if (! $this->hasNamespace($metadata)) {
616
+        if ( ! $this->hasNamespace($metadata)) {
617 617
             return '';
618 618
         }
619 619
 
620
-        return 'namespace ' . $this->getNamespace($metadata) .';';
620
+        return 'namespace '.$this->getNamespace($metadata).';';
621 621
     }
622 622
 
623 623
     /**
@@ -625,7 +625,7 @@  discard block
 block discarded – undo
625 625
      */
626 626
     protected function generateEntityUse()
627 627
     {
628
-        if (! $this->generateAnnotations) {
628
+        if ( ! $this->generateAnnotations) {
629 629
             return '';
630 630
         }
631 631
 
@@ -639,8 +639,8 @@  discard block
 block discarded – undo
639 639
      */
640 640
     protected function generateEntityClassName(ClassMetadataInfo $metadata)
641 641
     {
642
-        return 'class ' . $this->getClassName($metadata) .
643
-            ($this->extendsClass() ? ' extends ' . $this->getClassToExtendName() : null);
642
+        return 'class '.$this->getClassName($metadata).
643
+            ($this->extendsClass() ? ' extends '.$this->getClassToExtendName() : null);
644 644
     }
645 645
 
646 646
     /**
@@ -742,13 +742,13 @@  discard block
 block discarded – undo
742 742
         $fieldMappings = array_merge($requiredFields, $optionalFields);
743 743
 
744 744
         foreach ($metadata->embeddedClasses as $fieldName => $embeddedClass) {
745
-            $paramType = '\\' . ltrim($embeddedClass['class'], '\\');
746
-            $paramVariable = '$' . $fieldName;
745
+            $paramType = '\\'.ltrim($embeddedClass['class'], '\\');
746
+            $paramVariable = '$'.$fieldName;
747 747
 
748 748
             $paramTypes[] = $paramType;
749 749
             $paramVariables[] = $paramVariable;
750
-            $params[] = $paramType . ' ' . $paramVariable;
751
-            $fields[] = '$this->' . $fieldName . ' = ' . $paramVariable . ';';
750
+            $params[] = $paramType.' '.$paramVariable;
751
+            $fields[] = '$this->'.$fieldName.' = '.$paramVariable.';';
752 752
         }
753 753
 
754 754
         foreach ($fieldMappings as $fieldMapping) {
@@ -756,27 +756,27 @@  discard block
 block discarded – undo
756 756
                 continue;
757 757
             }
758 758
 
759
-            $paramTypes[] = $this->getType($fieldMapping['type']) . (!empty($fieldMapping['nullable']) ? '|null' : '');
760
-            $param = '$' . $fieldMapping['fieldName'];
759
+            $paramTypes[] = $this->getType($fieldMapping['type']).( ! empty($fieldMapping['nullable']) ? '|null' : '');
760
+            $param = '$'.$fieldMapping['fieldName'];
761 761
             $paramVariables[] = $param;
762 762
 
763 763
             if ($fieldMapping['type'] === 'datetime') {
764
-                $param = $this->getType($fieldMapping['type']) . ' ' . $param;
764
+                $param = $this->getType($fieldMapping['type']).' '.$param;
765 765
             }
766 766
 
767
-            if (!empty($fieldMapping['nullable'])) {
767
+            if ( ! empty($fieldMapping['nullable'])) {
768 768
                 $param .= ' = null';
769 769
             }
770 770
 
771 771
             $params[] = $param;
772 772
 
773
-            $fields[] = '$this->' . $fieldMapping['fieldName'] . ' = $' . $fieldMapping['fieldName'] . ';';
773
+            $fields[] = '$this->'.$fieldMapping['fieldName'].' = $'.$fieldMapping['fieldName'].';';
774 774
         }
775 775
 
776 776
         $maxParamTypeLength = max(array_map('strlen', $paramTypes));
777 777
         $paramTags = array_map(
778
-            function ($type, $variable) use ($maxParamTypeLength) {
779
-                return '@param ' . $type . str_repeat(' ', $maxParamTypeLength - strlen($type) + 1) . $variable;
778
+            function($type, $variable) use ($maxParamTypeLength) {
779
+                return '@param '.$type.str_repeat(' ', $maxParamTypeLength - strlen($type) + 1).$variable;
780 780
             },
781 781
             $paramTypes,
782 782
             $paramVariables
@@ -784,8 +784,8 @@  discard block
 block discarded – undo
784 784
 
785 785
         // Generate multi line constructor if the signature exceeds 120 characters.
786 786
         if (array_sum(array_map('strlen', $params)) + count($params) * 2 + 29 > 120) {
787
-            $delimiter = "\n" . $this->spaces;
788
-            $params = $delimiter . implode(',' . $delimiter, $params) . "\n";
787
+            $delimiter = "\n".$this->spaces;
788
+            $params = $delimiter.implode(','.$delimiter, $params)."\n";
789 789
         } else {
790 790
             $params = implode(', ', $params);
791 791
         }
@@ -793,7 +793,7 @@  discard block
 block discarded – undo
793 793
         $replacements = [
794 794
             '<paramTags>' => implode("\n * ", $paramTags),
795 795
             '<params>'    => $params,
796
-            '<fields>'    => implode("\n" . $this->spaces, $fields),
796
+            '<fields>'    => implode("\n".$this->spaces, $fields),
797 797
         ];
798 798
 
799 799
         $constructor = str_replace(
@@ -838,7 +838,7 @@  discard block
 block discarded – undo
838 838
 
839 839
             if ($inClass) {
840 840
                 $inClass = false;
841
-                $lastSeenClass = $lastSeenNamespace . ($lastSeenNamespace ? '\\' : '') . $token[1];
841
+                $lastSeenClass = $lastSeenNamespace.($lastSeenNamespace ? '\\' : '').$token[1];
842 842
                 $this->staticReflection[$lastSeenClass]['properties'] = [];
843 843
                 $this->staticReflection[$lastSeenClass]['methods'] = [];
844 844
             }
@@ -846,16 +846,16 @@  discard block
 block discarded – undo
846 846
             if (T_NAMESPACE === $token[0]) {
847 847
                 $lastSeenNamespace = '';
848 848
                 $inNamespace = true;
849
-            } elseif (T_CLASS === $token[0] && T_DOUBLE_COLON !== $tokens[$i-1][0]) {
849
+            } elseif (T_CLASS === $token[0] && T_DOUBLE_COLON !== $tokens[$i - 1][0]) {
850 850
                 $inClass = true;
851 851
             } elseif (T_FUNCTION === $token[0]) {
852
-                if (T_STRING === $tokens[$i+2][0]) {
853
-                    $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i+2][1]);
854
-                } elseif ($tokens[$i+2] == '&' && T_STRING === $tokens[$i+3][0]) {
855
-                    $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i+3][1]);
852
+                if (T_STRING === $tokens[$i + 2][0]) {
853
+                    $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i + 2][1]);
854
+                } elseif ($tokens[$i + 2] == '&' && T_STRING === $tokens[$i + 3][0]) {
855
+                    $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i + 3][1]);
856 856
                 }
857
-            } elseif (in_array($token[0], [T_VAR, T_PUBLIC, T_PRIVATE, T_PROTECTED], true) && T_FUNCTION !== $tokens[$i+2][0]) {
858
-                $this->staticReflection[$lastSeenClass]['properties'][] = substr($tokens[$i+2][1], 1);
857
+            } elseif (in_array($token[0], [T_VAR, T_PUBLIC, T_PRIVATE, T_PROTECTED], true) && T_FUNCTION !== $tokens[$i + 2][0]) {
858
+                $this->staticReflection[$lastSeenClass]['properties'][] = substr($tokens[$i + 2][1], 1);
859 859
             }
860 860
         }
861 861
     }
@@ -868,7 +868,7 @@  discard block
 block discarded – undo
868 868
      */
869 869
     protected function hasProperty($property, ClassMetadataInfo $metadata)
870 870
     {
871
-        if ($this->extendsClass() || (!$this->isNew && class_exists($metadata->name))) {
871
+        if ($this->extendsClass() || ( ! $this->isNew && class_exists($metadata->name))) {
872 872
             // don't generate property if its already on the base class.
873 873
             $reflClass = new \ReflectionClass($this->getClassToExtend() ?: $metadata->name);
874 874
             if ($reflClass->hasProperty($property)) {
@@ -897,7 +897,7 @@  discard block
 block discarded – undo
897 897
      */
898 898
     protected function hasMethod($method, ClassMetadataInfo $metadata)
899 899
     {
900
-        if ($this->extendsClass() || (!$this->isNew && class_exists($metadata->name))) {
900
+        if ($this->extendsClass() || ( ! $this->isNew && class_exists($metadata->name))) {
901 901
             // don't generate method if its already on the base class.
902 902
             $reflClass = new \ReflectionClass($this->getClassToExtend() ?: $metadata->name);
903 903
 
@@ -928,7 +928,7 @@  discard block
 block discarded – undo
928 928
      */
929 929
     protected function getTraits(ClassMetadataInfo $metadata)
930 930
     {
931
-        if (! ($metadata->reflClass !== null || class_exists($metadata->name))) {
931
+        if ( ! ($metadata->reflClass !== null || class_exists($metadata->name))) {
932 932
             return [];
933 933
         }
934 934
 
@@ -978,7 +978,7 @@  discard block
 block discarded – undo
978 978
     {
979 979
         $refl = new \ReflectionClass($this->getClassToExtend());
980 980
 
981
-        return '\\' . $refl->getName();
981
+        return '\\'.$refl->getName();
982 982
     }
983 983
 
984 984
     /**
@@ -1011,7 +1011,7 @@  discard block
 block discarded – undo
1011 1011
     {
1012 1012
         $lines = [];
1013 1013
         $lines[] = '/**';
1014
-        $lines[] = ' * ' . $this->getClassName($metadata);
1014
+        $lines[] = ' * '.$this->getClassName($metadata);
1015 1015
 
1016 1016
         if ($this->generateAnnotations) {
1017 1017
             $lines[] = ' *';
@@ -1027,12 +1027,12 @@  discard block
 block discarded – undo
1027 1027
 
1028 1028
             foreach ($methods as $method) {
1029 1029
                 if ($code = $this->$method($metadata)) {
1030
-                    $lines[] = ' * ' . $code;
1030
+                    $lines[] = ' * '.$code;
1031 1031
                 }
1032 1032
             }
1033 1033
 
1034 1034
             if (isset($metadata->lifecycleCallbacks) && $metadata->lifecycleCallbacks) {
1035
-                $lines[] = ' * @' . $this->annotationsPrefix . 'HasLifecycleCallbacks';
1035
+                $lines[] = ' * @'.$this->annotationsPrefix.'HasLifecycleCallbacks';
1036 1036
             }
1037 1037
         }
1038 1038
 
@@ -1048,17 +1048,17 @@  discard block
 block discarded – undo
1048 1048
      */
1049 1049
     protected function generateEntityAnnotation(ClassMetadataInfo $metadata)
1050 1050
     {
1051
-        $prefix = '@' . $this->annotationsPrefix;
1051
+        $prefix = '@'.$this->annotationsPrefix;
1052 1052
 
1053 1053
         if ($metadata->isEmbeddedClass) {
1054
-            return $prefix . 'Embeddable';
1054
+            return $prefix.'Embeddable';
1055 1055
         }
1056 1056
 
1057 1057
         $customRepository = $metadata->customRepositoryClassName
1058
-            ? '(repositoryClass="' . $metadata->customRepositoryClassName . '")'
1058
+            ? '(repositoryClass="'.$metadata->customRepositoryClassName.'")'
1059 1059
             : '';
1060 1060
 
1061
-        return $prefix . ($metadata->isMappedSuperclass ? 'MappedSuperclass' : 'Entity') . $customRepository;
1061
+        return $prefix.($metadata->isMappedSuperclass ? 'MappedSuperclass' : 'Entity').$customRepository;
1062 1062
     }
1063 1063
 
1064 1064
     /**
@@ -1075,28 +1075,28 @@  discard block
 block discarded – undo
1075 1075
         $table = [];
1076 1076
 
1077 1077
         if (isset($metadata->table['schema'])) {
1078
-            $table[] = 'schema="' . $metadata->table['schema'] . '"';
1078
+            $table[] = 'schema="'.$metadata->table['schema'].'"';
1079 1079
         }
1080 1080
 
1081 1081
         if (isset($metadata->table['name'])) {
1082
-            $table[] = 'name="' . $metadata->table['name'] . '"';
1082
+            $table[] = 'name="'.$metadata->table['name'].'"';
1083 1083
         }
1084 1084
 
1085 1085
         if (isset($metadata->table['options']) && $metadata->table['options']) {
1086
-            $table[] = 'options={' . $this->exportTableOptions((array) $metadata->table['options']) . '}';
1086
+            $table[] = 'options={'.$this->exportTableOptions((array) $metadata->table['options']).'}';
1087 1087
         }
1088 1088
 
1089 1089
         if (isset($metadata->table['uniqueConstraints']) && $metadata->table['uniqueConstraints']) {
1090 1090
             $constraints = $this->generateTableConstraints('UniqueConstraint', $metadata->table['uniqueConstraints']);
1091
-            $table[] = 'uniqueConstraints={' . $constraints . '}';
1091
+            $table[] = 'uniqueConstraints={'.$constraints.'}';
1092 1092
         }
1093 1093
 
1094 1094
         if (isset($metadata->table['indexes']) && $metadata->table['indexes']) {
1095 1095
             $constraints = $this->generateTableConstraints('Index', $metadata->table['indexes']);
1096
-            $table[] = 'indexes={' . $constraints . '}';
1096
+            $table[] = 'indexes={'.$constraints.'}';
1097 1097
         }
1098 1098
 
1099
-        return '@' . $this->annotationsPrefix . 'Table(' . implode(', ', $table) . ')';
1099
+        return '@'.$this->annotationsPrefix.'Table('.implode(', ', $table).')';
1100 1100
     }
1101 1101
 
1102 1102
     /**
@@ -1111,9 +1111,9 @@  discard block
 block discarded – undo
1111 1111
         foreach ($constraints as $name => $constraint) {
1112 1112
             $columns = [];
1113 1113
             foreach ($constraint['columns'] as $column) {
1114
-                $columns[] = '"' . $column . '"';
1114
+                $columns[] = '"'.$column.'"';
1115 1115
             }
1116
-            $annotations[] = '@' . $this->annotationsPrefix . $constraintName . '(name="' . $name . '", columns={' . implode(', ', $columns) . '})';
1116
+            $annotations[] = '@'.$this->annotationsPrefix.$constraintName.'(name="'.$name.'", columns={'.implode(', ', $columns).'})';
1117 1117
         }
1118 1118
 
1119 1119
         return implode(', ', $annotations);
@@ -1130,7 +1130,7 @@  discard block
 block discarded – undo
1130 1130
             return '';
1131 1131
         }
1132 1132
 
1133
-        return '@' . $this->annotationsPrefix . 'InheritanceType("'.$this->getInheritanceTypeString($metadata->inheritanceType).'")';
1133
+        return '@'.$this->annotationsPrefix.'InheritanceType("'.$this->getInheritanceTypeString($metadata->inheritanceType).'")';
1134 1134
     }
1135 1135
 
1136 1136
     /**
@@ -1145,11 +1145,11 @@  discard block
 block discarded – undo
1145 1145
         }
1146 1146
 
1147 1147
         $discrColumn = $metadata->discriminatorColumn;
1148
-        $columnDefinition = 'name="' . $discrColumn['name']
1149
-            . '", type="' . $discrColumn['type']
1150
-            . '", length=' . $discrColumn['length'];
1148
+        $columnDefinition = 'name="'.$discrColumn['name']
1149
+            . '", type="'.$discrColumn['type']
1150
+            . '", length='.$discrColumn['length'];
1151 1151
 
1152
-        return '@' . $this->annotationsPrefix . 'DiscriminatorColumn(' . $columnDefinition . ')';
1152
+        return '@'.$this->annotationsPrefix.'DiscriminatorColumn('.$columnDefinition.')';
1153 1153
     }
1154 1154
 
1155 1155
     /**
@@ -1166,10 +1166,10 @@  discard block
 block discarded – undo
1166 1166
         $inheritanceClassMap = [];
1167 1167
 
1168 1168
         foreach ($metadata->discriminatorMap as $type => $class) {
1169
-            $inheritanceClassMap[] .= '"' . $type . '" = "' . $class . '"';
1169
+            $inheritanceClassMap[] .= '"'.$type.'" = "'.$class.'"';
1170 1170
         }
1171 1171
 
1172
-        return '@' . $this->annotationsPrefix . 'DiscriminatorMap({' . implode(', ', $inheritanceClassMap) . '})';
1172
+        return '@'.$this->annotationsPrefix.'DiscriminatorMap({'.implode(', ', $inheritanceClassMap).'})';
1173 1173
     }
1174 1174
 
1175 1175
     /**
@@ -1188,8 +1188,8 @@  discard block
 block discarded – undo
1188 1188
 
1189 1189
             $nullableField = $this->nullableFieldExpression($fieldMapping);
1190 1190
 
1191
-            if ((!$metadata->isEmbeddedClass || !$this->embeddablesImmutable)
1192
-                && (!isset($fieldMapping['id']) || ! $fieldMapping['id'] || $metadata->generatorType === ClassMetadataInfo::GENERATOR_TYPE_NONE)
1191
+            if (( ! $metadata->isEmbeddedClass || ! $this->embeddablesImmutable)
1192
+                && ( ! isset($fieldMapping['id']) || ! $fieldMapping['id'] || $metadata->generatorType === ClassMetadataInfo::GENERATOR_TYPE_NONE)
1193 1193
                 && $code = $this->generateEntityStubMethod($metadata, 'set', $fieldMapping['fieldName'], $fieldMapping['type'], $nullableField)
1194 1194
             ) {
1195 1195
                 $methods[] = $code;
@@ -1260,7 +1260,7 @@  discard block
 block discarded – undo
1260 1260
         }
1261 1261
 
1262 1262
         foreach ($joinColumns as $joinColumn) {
1263
-            if (isset($joinColumn['nullable']) && !$joinColumn['nullable']) {
1263
+            if (isset($joinColumn['nullable']) && ! $joinColumn['nullable']) {
1264 1264
                 return false;
1265 1265
             }
1266 1266
         }
@@ -1305,8 +1305,8 @@  discard block
 block discarded – undo
1305 1305
             }
1306 1306
 
1307 1307
             $lines[] = $this->generateAssociationMappingPropertyDocBlock($associationMapping, $metadata);
1308
-            $lines[] = $this->spaces . $this->fieldVisibility . ' $' . $associationMapping['fieldName']
1309
-                     . ($associationMapping['type'] == 'manyToMany' ? ' = array()' : null) . ";\n";
1308
+            $lines[] = $this->spaces.$this->fieldVisibility.' $'.$associationMapping['fieldName']
1309
+                     . ($associationMapping['type'] == 'manyToMany' ? ' = array()' : null).";\n";
1310 1310
         }
1311 1311
 
1312 1312
         return implode("\n", $lines);
@@ -1334,12 +1334,12 @@  discard block
 block discarded – undo
1334 1334
                 if ($fieldMapping['type'] === 'boolean' && $fieldMapping['options']['default'] === '1') {
1335 1335
                     $defaultValue = ' = true';
1336 1336
                 } else {
1337
-                    $defaultValue = ' = ' . var_export($fieldMapping['options']['default'], true);
1337
+                    $defaultValue = ' = '.var_export($fieldMapping['options']['default'], true);
1338 1338
                 }
1339 1339
             }
1340 1340
 
1341 1341
             $lines[] = $this->generateFieldMappingPropertyDocBlock($fieldMapping, $metadata);
1342
-            $lines[] = $this->spaces . $this->fieldVisibility . ' $' . $fieldMapping['fieldName'] . $defaultValue . ";\n";
1342
+            $lines[] = $this->spaces.$this->fieldVisibility.' $'.$fieldMapping['fieldName'].$defaultValue.";\n";
1343 1343
         }
1344 1344
 
1345 1345
         return implode("\n", $lines);
@@ -1360,7 +1360,7 @@  discard block
 block discarded – undo
1360 1360
             }
1361 1361
 
1362 1362
             $lines[] = $this->generateEmbeddedPropertyDocBlock($embeddedClass);
1363
-            $lines[] = $this->spaces . $this->fieldVisibility . ' $' . $fieldName . ";\n";
1363
+            $lines[] = $this->spaces.$this->fieldVisibility.' $'.$fieldName.";\n";
1364 1364
         }
1365 1365
 
1366 1366
         return implode("\n", $lines);
@@ -1377,7 +1377,7 @@  discard block
 block discarded – undo
1377 1377
      */
1378 1378
     protected function generateEntityStubMethod(ClassMetadataInfo $metadata, $type, $fieldName, $typeHint = null, $defaultValue = null)
1379 1379
     {
1380
-        $methodName = $type . Inflector::classify($fieldName);
1380
+        $methodName = $type.Inflector::classify($fieldName);
1381 1381
         $variableName = Inflector::camelize($fieldName);
1382 1382
         if (in_array($type, ["add", "remove"])) {
1383 1383
             $methodName = Inflector::singularize($methodName);
@@ -1397,18 +1397,18 @@  discard block
 block discarded – undo
1397 1397
         $variableType   = $typeHint ? $this->getType($typeHint) : null;
1398 1398
 
1399 1399
         if ($typeHint && ! isset($types[$typeHint])) {
1400
-            $variableType   =  '\\' . ltrim($variableType, '\\');
1401
-            $methodTypeHint =  '\\' . $typeHint . ' ';
1400
+            $variableType   = '\\'.ltrim($variableType, '\\');
1401
+            $methodTypeHint = '\\'.$typeHint.' ';
1402 1402
         }
1403 1403
 
1404 1404
         $replacements = [
1405
-          '<description>'       => ucfirst($type) . ' ' . $variableName . '.',
1405
+          '<description>'       => ucfirst($type).' '.$variableName.'.',
1406 1406
           '<methodTypeHint>'    => $methodTypeHint,
1407
-          '<variableType>'      => $variableType . (null !== $defaultValue ? ('|' . $defaultValue) : ''),
1407
+          '<variableType>'      => $variableType.(null !== $defaultValue ? ('|'.$defaultValue) : ''),
1408 1408
           '<variableName>'      => $variableName,
1409 1409
           '<methodName>'        => $methodName,
1410 1410
           '<fieldName>'         => $fieldName,
1411
-          '<variableDefault>'   => ($defaultValue !== null ) ? (' = ' . $defaultValue) : '',
1411
+          '<variableDefault>'   => ($defaultValue !== null) ? (' = '.$defaultValue) : '',
1412 1412
           '<entity>'            => $this->getClassName($metadata)
1413 1413
         ];
1414 1414
 
@@ -1437,7 +1437,7 @@  discard block
 block discarded – undo
1437 1437
         $this->staticReflection[$metadata->name]['methods'][] = $methodName;
1438 1438
 
1439 1439
         $replacements = [
1440
-            '<name>'        => $this->annotationsPrefix . ucfirst($name),
1440
+            '<name>'        => $this->annotationsPrefix.ucfirst($name),
1441 1441
             '<methodName>'  => $methodName,
1442 1442
         ];
1443 1443
 
@@ -1460,30 +1460,30 @@  discard block
 block discarded – undo
1460 1460
         $joinColumnAnnot = [];
1461 1461
 
1462 1462
         if (isset($joinColumn['name'])) {
1463
-            $joinColumnAnnot[] = 'name="' . $joinColumn['name'] . '"';
1463
+            $joinColumnAnnot[] = 'name="'.$joinColumn['name'].'"';
1464 1464
         }
1465 1465
 
1466 1466
         if (isset($joinColumn['referencedColumnName'])) {
1467
-            $joinColumnAnnot[] = 'referencedColumnName="' . $joinColumn['referencedColumnName'] . '"';
1467
+            $joinColumnAnnot[] = 'referencedColumnName="'.$joinColumn['referencedColumnName'].'"';
1468 1468
         }
1469 1469
 
1470 1470
         if (isset($joinColumn['unique']) && $joinColumn['unique']) {
1471
-            $joinColumnAnnot[] = 'unique=' . ($joinColumn['unique'] ? 'true' : 'false');
1471
+            $joinColumnAnnot[] = 'unique='.($joinColumn['unique'] ? 'true' : 'false');
1472 1472
         }
1473 1473
 
1474 1474
         if (isset($joinColumn['nullable'])) {
1475
-            $joinColumnAnnot[] = 'nullable=' . ($joinColumn['nullable'] ? 'true' : 'false');
1475
+            $joinColumnAnnot[] = 'nullable='.($joinColumn['nullable'] ? 'true' : 'false');
1476 1476
         }
1477 1477
 
1478 1478
         if (isset($joinColumn['onDelete'])) {
1479
-            $joinColumnAnnot[] = 'onDelete="' . ($joinColumn['onDelete'] . '"');
1479
+            $joinColumnAnnot[] = 'onDelete="'.($joinColumn['onDelete'].'"');
1480 1480
         }
1481 1481
 
1482 1482
         if (isset($joinColumn['columnDefinition'])) {
1483
-            $joinColumnAnnot[] = 'columnDefinition="' . $joinColumn['columnDefinition'] . '"';
1483
+            $joinColumnAnnot[] = 'columnDefinition="'.$joinColumn['columnDefinition'].'"';
1484 1484
         }
1485 1485
 
1486
-        return '@' . $this->annotationsPrefix . 'JoinColumn(' . implode(', ', $joinColumnAnnot) . ')';
1486
+        return '@'.$this->annotationsPrefix.'JoinColumn('.implode(', ', $joinColumnAnnot).')';
1487 1487
     }
1488 1488
 
1489 1489
     /**
@@ -1495,22 +1495,22 @@  discard block
 block discarded – undo
1495 1495
     protected function generateAssociationMappingPropertyDocBlock(array $associationMapping, ClassMetadataInfo $metadata)
1496 1496
     {
1497 1497
         $lines = [];
1498
-        $lines[] = $this->spaces . '/**';
1498
+        $lines[] = $this->spaces.'/**';
1499 1499
 
1500 1500
         if ($associationMapping['type'] & ClassMetadataInfo::TO_MANY) {
1501
-            $lines[] = $this->spaces . ' * @var \Doctrine\Common\Collections\Collection';
1501
+            $lines[] = $this->spaces.' * @var \Doctrine\Common\Collections\Collection';
1502 1502
         } else {
1503
-            $lines[] = $this->spaces . ' * @var \\' . ltrim($associationMapping['targetEntity'], '\\');
1503
+            $lines[] = $this->spaces.' * @var \\'.ltrim($associationMapping['targetEntity'], '\\');
1504 1504
         }
1505 1505
 
1506 1506
         if ($this->generateAnnotations) {
1507
-            $lines[] = $this->spaces . ' *';
1507
+            $lines[] = $this->spaces.' *';
1508 1508
 
1509 1509
             if (isset($associationMapping['id']) && $associationMapping['id']) {
1510
-                $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Id';
1510
+                $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Id';
1511 1511
 
1512 1512
                 if ($generatorType = $this->getIdGeneratorTypeString($metadata->generatorType)) {
1513
-                    $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'GeneratedValue(strategy="' . $generatorType . '")';
1513
+                    $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'GeneratedValue(strategy="'.$generatorType.'")';
1514 1514
                 }
1515 1515
             }
1516 1516
 
@@ -1532,15 +1532,15 @@  discard block
 block discarded – undo
1532 1532
             $typeOptions = [];
1533 1533
 
1534 1534
             if (isset($associationMapping['targetEntity'])) {
1535
-                $typeOptions[] = 'targetEntity="' . $associationMapping['targetEntity'] . '"';
1535
+                $typeOptions[] = 'targetEntity="'.$associationMapping['targetEntity'].'"';
1536 1536
             }
1537 1537
 
1538 1538
             if (isset($associationMapping['inversedBy'])) {
1539
-                $typeOptions[] = 'inversedBy="' . $associationMapping['inversedBy'] . '"';
1539
+                $typeOptions[] = 'inversedBy="'.$associationMapping['inversedBy'].'"';
1540 1540
             }
1541 1541
 
1542 1542
             if (isset($associationMapping['mappedBy'])) {
1543
-                $typeOptions[] = 'mappedBy="' . $associationMapping['mappedBy'] . '"';
1543
+                $typeOptions[] = 'mappedBy="'.$associationMapping['mappedBy'].'"';
1544 1544
             }
1545 1545
 
1546 1546
             if ($associationMapping['cascade']) {
@@ -1556,11 +1556,11 @@  discard block
 block discarded – undo
1556 1556
                     $cascades = ['"all"'];
1557 1557
                 }
1558 1558
 
1559
-                $typeOptions[] = 'cascade={' . implode(',', $cascades) . '}';
1559
+                $typeOptions[] = 'cascade={'.implode(',', $cascades).'}';
1560 1560
             }
1561 1561
 
1562 1562
             if (isset($associationMapping['orphanRemoval']) && $associationMapping['orphanRemoval']) {
1563
-                $typeOptions[] = 'orphanRemoval=' . ($associationMapping['orphanRemoval'] ? 'true' : 'false');
1563
+                $typeOptions[] = 'orphanRemoval='.($associationMapping['orphanRemoval'] ? 'true' : 'false');
1564 1564
             }
1565 1565
 
1566 1566
             if (isset($associationMapping['fetch']) && $associationMapping['fetch'] !== ClassMetadataInfo::FETCH_LAZY) {
@@ -1569,71 +1569,71 @@  discard block
 block discarded – undo
1569 1569
                     ClassMetadataInfo::FETCH_EAGER      => 'EAGER',
1570 1570
                 ];
1571 1571
 
1572
-                $typeOptions[] = 'fetch="' . $fetchMap[$associationMapping['fetch']] . '"';
1572
+                $typeOptions[] = 'fetch="'.$fetchMap[$associationMapping['fetch']].'"';
1573 1573
             }
1574 1574
 
1575
-            $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . '' . $type . '(' . implode(', ', $typeOptions) . ')';
1575
+            $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.''.$type.'('.implode(', ', $typeOptions).')';
1576 1576
 
1577 1577
             if (isset($associationMapping['joinColumns']) && $associationMapping['joinColumns']) {
1578
-                $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'JoinColumns({';
1578
+                $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'JoinColumns({';
1579 1579
 
1580 1580
                 $joinColumnsLines = [];
1581 1581
 
1582 1582
                 foreach ($associationMapping['joinColumns'] as $joinColumn) {
1583 1583
                     if ($joinColumnAnnot = $this->generateJoinColumnAnnotation($joinColumn)) {
1584
-                        $joinColumnsLines[] = $this->spaces . ' *   ' . $joinColumnAnnot;
1584
+                        $joinColumnsLines[] = $this->spaces.' *   '.$joinColumnAnnot;
1585 1585
                     }
1586 1586
                 }
1587 1587
 
1588 1588
                 $lines[] = implode(",\n", $joinColumnsLines);
1589
-                $lines[] = $this->spaces . ' * })';
1589
+                $lines[] = $this->spaces.' * })';
1590 1590
             }
1591 1591
 
1592 1592
             if (isset($associationMapping['joinTable']) && $associationMapping['joinTable']) {
1593 1593
                 $joinTable = [];
1594
-                $joinTable[] = 'name="' . $associationMapping['joinTable']['name'] . '"';
1594
+                $joinTable[] = 'name="'.$associationMapping['joinTable']['name'].'"';
1595 1595
 
1596 1596
                 if (isset($associationMapping['joinTable']['schema'])) {
1597
-                    $joinTable[] = 'schema="' . $associationMapping['joinTable']['schema'] . '"';
1597
+                    $joinTable[] = 'schema="'.$associationMapping['joinTable']['schema'].'"';
1598 1598
                 }
1599 1599
 
1600
-                $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'JoinTable(' . implode(', ', $joinTable) . ',';
1601
-                $lines[] = $this->spaces . ' *   joinColumns={';
1600
+                $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'JoinTable('.implode(', ', $joinTable).',';
1601
+                $lines[] = $this->spaces.' *   joinColumns={';
1602 1602
 
1603 1603
                 $joinColumnsLines = [];
1604 1604
 
1605 1605
                 foreach ($associationMapping['joinTable']['joinColumns'] as $joinColumn) {
1606
-                    $joinColumnsLines[] = $this->spaces . ' *     ' . $this->generateJoinColumnAnnotation($joinColumn);
1606
+                    $joinColumnsLines[] = $this->spaces.' *     '.$this->generateJoinColumnAnnotation($joinColumn);
1607 1607
                 }
1608 1608
 
1609
-                $lines[] = implode(",". PHP_EOL, $joinColumnsLines);
1610
-                $lines[] = $this->spaces . ' *   },';
1611
-                $lines[] = $this->spaces . ' *   inverseJoinColumns={';
1609
+                $lines[] = implode(",".PHP_EOL, $joinColumnsLines);
1610
+                $lines[] = $this->spaces.' *   },';
1611
+                $lines[] = $this->spaces.' *   inverseJoinColumns={';
1612 1612
 
1613 1613
                 $inverseJoinColumnsLines = [];
1614 1614
 
1615 1615
                 foreach ($associationMapping['joinTable']['inverseJoinColumns'] as $joinColumn) {
1616
-                    $inverseJoinColumnsLines[] = $this->spaces . ' *     ' . $this->generateJoinColumnAnnotation($joinColumn);
1616
+                    $inverseJoinColumnsLines[] = $this->spaces.' *     '.$this->generateJoinColumnAnnotation($joinColumn);
1617 1617
                 }
1618 1618
 
1619
-                $lines[] = implode(",". PHP_EOL, $inverseJoinColumnsLines);
1620
-                $lines[] = $this->spaces . ' *   }';
1621
-                $lines[] = $this->spaces . ' * )';
1619
+                $lines[] = implode(",".PHP_EOL, $inverseJoinColumnsLines);
1620
+                $lines[] = $this->spaces.' *   }';
1621
+                $lines[] = $this->spaces.' * )';
1622 1622
             }
1623 1623
 
1624 1624
             if (isset($associationMapping['orderBy'])) {
1625
-                $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'OrderBy({';
1625
+                $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'OrderBy({';
1626 1626
 
1627 1627
                 foreach ($associationMapping['orderBy'] as $name => $direction) {
1628
-                    $lines[] = $this->spaces . ' *     "' . $name . '"="' . $direction . '",';
1628
+                    $lines[] = $this->spaces.' *     "'.$name.'"="'.$direction.'",';
1629 1629
                 }
1630 1630
 
1631 1631
                 $lines[count($lines) - 1] = substr($lines[count($lines) - 1], 0, strlen($lines[count($lines) - 1]) - 1);
1632
-                $lines[] = $this->spaces . ' * })';
1632
+                $lines[] = $this->spaces.' * })';
1633 1633
             }
1634 1634
         }
1635 1635
 
1636
-        $lines[] = $this->spaces . ' */';
1636
+        $lines[] = $this->spaces.' */';
1637 1637
 
1638 1638
         return implode("\n", $lines);
1639 1639
     }
@@ -1647,43 +1647,43 @@  discard block
 block discarded – undo
1647 1647
     protected function generateFieldMappingPropertyDocBlock(array $fieldMapping, ClassMetadataInfo $metadata)
1648 1648
     {
1649 1649
         $lines = [];
1650
-        $lines[] = $this->spaces . '/**';
1651
-        $lines[] = $this->spaces . ' * @var '
1650
+        $lines[] = $this->spaces.'/**';
1651
+        $lines[] = $this->spaces.' * @var '
1652 1652
             . $this->getType($fieldMapping['type'])
1653 1653
             . ($this->nullableFieldExpression($fieldMapping) ? '|null' : '');
1654 1654
 
1655 1655
         if ($this->generateAnnotations) {
1656
-            $lines[] = $this->spaces . ' *';
1656
+            $lines[] = $this->spaces.' *';
1657 1657
 
1658 1658
             $column = [];
1659 1659
             if (isset($fieldMapping['columnName'])) {
1660
-                $column[] = 'name="' . $fieldMapping['columnName'] . '"';
1660
+                $column[] = 'name="'.$fieldMapping['columnName'].'"';
1661 1661
             }
1662 1662
 
1663 1663
             if (isset($fieldMapping['type'])) {
1664
-                $column[] = 'type="' . $fieldMapping['type'] . '"';
1664
+                $column[] = 'type="'.$fieldMapping['type'].'"';
1665 1665
             }
1666 1666
 
1667 1667
             if (isset($fieldMapping['length'])) {
1668
-                $column[] = 'length=' . $fieldMapping['length'];
1668
+                $column[] = 'length='.$fieldMapping['length'];
1669 1669
             }
1670 1670
 
1671 1671
             if (isset($fieldMapping['precision'])) {
1672
-                $column[] = 'precision=' .  $fieldMapping['precision'];
1672
+                $column[] = 'precision='.$fieldMapping['precision'];
1673 1673
             }
1674 1674
 
1675 1675
             if (isset($fieldMapping['scale'])) {
1676
-                $column[] = 'scale=' . $fieldMapping['scale'];
1676
+                $column[] = 'scale='.$fieldMapping['scale'];
1677 1677
             }
1678 1678
 
1679 1679
             if (isset($fieldMapping['nullable'])) {
1680
-                $column[] = 'nullable=' .  var_export($fieldMapping['nullable'], true);
1680
+                $column[] = 'nullable='.var_export($fieldMapping['nullable'], true);
1681 1681
             }
1682 1682
 
1683 1683
             $options = [];
1684 1684
 
1685 1685
             if (isset($fieldMapping['options']['default']) && $fieldMapping['options']['default']) {
1686
-                $options[] = '"default"="' . $fieldMapping['options']['default'] .'"';
1686
+                $options[] = '"default"="'.$fieldMapping['options']['default'].'"';
1687 1687
             }
1688 1688
 
1689 1689
             if (isset($fieldMapping['options']['unsigned']) && $fieldMapping['options']['unsigned']) {
@@ -1695,15 +1695,15 @@  discard block
 block discarded – undo
1695 1695
             }
1696 1696
 
1697 1697
             if (isset($fieldMapping['options']['comment']) && $fieldMapping['options']['comment']) {
1698
-                $options[] = '"comment"="' . str_replace('"', '""', $fieldMapping['options']['comment']) . '"';
1698
+                $options[] = '"comment"="'.str_replace('"', '""', $fieldMapping['options']['comment']).'"';
1699 1699
             }
1700 1700
 
1701 1701
             if (isset($fieldMapping['options']['collation']) && $fieldMapping['options']['collation']) {
1702
-                $options[] = '"collation"="' . $fieldMapping['options']['collation'] .'"';
1702
+                $options[] = '"collation"="'.$fieldMapping['options']['collation'].'"';
1703 1703
             }
1704 1704
 
1705 1705
             if (isset($fieldMapping['options']['check']) && $fieldMapping['options']['check']) {
1706
-                $options[] = '"check"="' . $fieldMapping['options']['check'] .'"';
1706
+                $options[] = '"check"="'.$fieldMapping['options']['check'].'"';
1707 1707
             }
1708 1708
 
1709 1709
             if ($options) {
@@ -1711,47 +1711,47 @@  discard block
 block discarded – undo
1711 1711
             }
1712 1712
 
1713 1713
             if (isset($fieldMapping['columnDefinition'])) {
1714
-                $column[] = 'columnDefinition="' . $fieldMapping['columnDefinition'] . '"';
1714
+                $column[] = 'columnDefinition="'.$fieldMapping['columnDefinition'].'"';
1715 1715
             }
1716 1716
 
1717 1717
             if (isset($fieldMapping['unique'])) {
1718
-                $column[] = 'unique=' . var_export($fieldMapping['unique'], true);
1718
+                $column[] = 'unique='.var_export($fieldMapping['unique'], true);
1719 1719
             }
1720 1720
 
1721
-            $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Column(' . implode(', ', $column) . ')';
1721
+            $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Column('.implode(', ', $column).')';
1722 1722
 
1723 1723
             if (isset($fieldMapping['id']) && $fieldMapping['id']) {
1724
-                $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Id';
1724
+                $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Id';
1725 1725
 
1726 1726
                 if ($generatorType = $this->getIdGeneratorTypeString($metadata->generatorType)) {
1727
-                    $lines[] = $this->spaces.' * @' . $this->annotationsPrefix . 'GeneratedValue(strategy="' . $generatorType . '")';
1727
+                    $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'GeneratedValue(strategy="'.$generatorType.'")';
1728 1728
                 }
1729 1729
 
1730 1730
                 if ($metadata->sequenceGeneratorDefinition) {
1731 1731
                     $sequenceGenerator = [];
1732 1732
 
1733 1733
                     if (isset($metadata->sequenceGeneratorDefinition['sequenceName'])) {
1734
-                        $sequenceGenerator[] = 'sequenceName="' . $metadata->sequenceGeneratorDefinition['sequenceName'] . '"';
1734
+                        $sequenceGenerator[] = 'sequenceName="'.$metadata->sequenceGeneratorDefinition['sequenceName'].'"';
1735 1735
                     }
1736 1736
 
1737 1737
                     if (isset($metadata->sequenceGeneratorDefinition['allocationSize'])) {
1738
-                        $sequenceGenerator[] = 'allocationSize=' . $metadata->sequenceGeneratorDefinition['allocationSize'];
1738
+                        $sequenceGenerator[] = 'allocationSize='.$metadata->sequenceGeneratorDefinition['allocationSize'];
1739 1739
                     }
1740 1740
 
1741 1741
                     if (isset($metadata->sequenceGeneratorDefinition['initialValue'])) {
1742
-                        $sequenceGenerator[] = 'initialValue=' . $metadata->sequenceGeneratorDefinition['initialValue'];
1742
+                        $sequenceGenerator[] = 'initialValue='.$metadata->sequenceGeneratorDefinition['initialValue'];
1743 1743
                     }
1744 1744
 
1745
-                    $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'SequenceGenerator(' . implode(', ', $sequenceGenerator) . ')';
1745
+                    $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'SequenceGenerator('.implode(', ', $sequenceGenerator).')';
1746 1746
                 }
1747 1747
             }
1748 1748
 
1749 1749
             if (isset($fieldMapping['version']) && $fieldMapping['version']) {
1750
-                $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Version';
1750
+                $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Version';
1751 1751
             }
1752 1752
         }
1753 1753
 
1754
-        $lines[] = $this->spaces . ' */';
1754
+        $lines[] = $this->spaces.' */';
1755 1755
 
1756 1756
         return implode("\n", $lines);
1757 1757
     }
@@ -1764,27 +1764,27 @@  discard block
 block discarded – undo
1764 1764
     protected function generateEmbeddedPropertyDocBlock(array $embeddedClass)
1765 1765
     {
1766 1766
         $lines = [];
1767
-        $lines[] = $this->spaces . '/**';
1768
-        $lines[] = $this->spaces . ' * @var \\' . ltrim($embeddedClass['class'], '\\');
1767
+        $lines[] = $this->spaces.'/**';
1768
+        $lines[] = $this->spaces.' * @var \\'.ltrim($embeddedClass['class'], '\\');
1769 1769
 
1770 1770
         if ($this->generateAnnotations) {
1771
-            $lines[] = $this->spaces . ' *';
1771
+            $lines[] = $this->spaces.' *';
1772 1772
 
1773
-            $embedded = ['class="' . $embeddedClass['class'] . '"'];
1773
+            $embedded = ['class="'.$embeddedClass['class'].'"'];
1774 1774
 
1775 1775
             if (isset($embeddedClass['columnPrefix'])) {
1776 1776
                 if (is_string($embeddedClass['columnPrefix'])) {
1777
-                    $embedded[] = 'columnPrefix="' . $embeddedClass['columnPrefix'] . '"';
1777
+                    $embedded[] = 'columnPrefix="'.$embeddedClass['columnPrefix'].'"';
1778 1778
                 } else {
1779
-                    $embedded[] = 'columnPrefix=' . var_export($embeddedClass['columnPrefix'], true);
1779
+                    $embedded[] = 'columnPrefix='.var_export($embeddedClass['columnPrefix'], true);
1780 1780
                 }
1781 1781
             }
1782 1782
 
1783
-            $lines[] = $this->spaces . ' * @' .
1784
-                $this->annotationsPrefix . 'Embedded(' . implode(', ', $embedded) . ')';
1783
+            $lines[] = $this->spaces.' * @'.
1784
+                $this->annotationsPrefix.'Embedded('.implode(', ', $embedded).')';
1785 1785
         }
1786 1786
 
1787
-        $lines[] = $this->spaces . ' */';
1787
+        $lines[] = $this->spaces.' */';
1788 1788
 
1789 1789
         return implode("\n", $lines);
1790 1790
     }
@@ -1798,13 +1798,13 @@  discard block
 block discarded – undo
1798 1798
         $processedClasses = [];
1799 1799
         foreach ($metadata->entityListeners as $event => $eventListeners) {
1800 1800
             foreach ($eventListeners as $eventListener) {
1801
-                $processedClasses[] = '"' . $eventListener['class'] . '"';
1801
+                $processedClasses[] = '"'.$eventListener['class'].'"';
1802 1802
             }
1803 1803
         }
1804 1804
 
1805 1805
         return \sprintf(
1806 1806
             '%s%s({%s})',
1807
-            '@' . $this->annotationsPrefix,
1807
+            '@'.$this->annotationsPrefix,
1808 1808
             'EntityListeners',
1809 1809
             \implode(',', \array_unique($processedClasses))
1810 1810
         );
@@ -1822,7 +1822,7 @@  discard block
 block discarded – undo
1822 1822
 
1823 1823
         foreach ($lines as $key => $value) {
1824 1824
             if ( ! empty($value)) {
1825
-                $lines[$key] = str_repeat($this->spaces, $num) . $lines[$key];
1825
+                $lines[$key] = str_repeat($this->spaces, $num).$lines[$key];
1826 1826
             }
1827 1827
         }
1828 1828
 
@@ -1904,9 +1904,9 @@  discard block
 block discarded – undo
1904 1904
 
1905 1905
         foreach ($options as $name => $option) {
1906 1906
             if (is_array($option)) {
1907
-                $optionsStr[] = '"' . $name . '"={' . $this->exportTableOptions($option) . '}';
1907
+                $optionsStr[] = '"'.$name.'"={'.$this->exportTableOptions($option).'}';
1908 1908
             } else {
1909
-                $optionsStr[] = '"' . $name . '"="' . (string) $option . '"';
1909
+                $optionsStr[] = '"'.$name.'"="'.(string) $option.'"';
1910 1910
             }
1911 1911
         }
1912 1912
 
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php 1 patch
Spacing   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
     {
31 31
         $this->_namespace = uniqid("doctrine_");
32 32
         $this->_tmpDir = \sys_get_temp_dir();
33
-        \mkdir($this->_tmpDir . \DIRECTORY_SEPARATOR . $this->_namespace);
33
+        \mkdir($this->_tmpDir.\DIRECTORY_SEPARATOR.$this->_namespace);
34 34
         $this->_generator = new EntityGenerator();
35 35
         $this->_generator->setAnnotationPrefix("");
36 36
         $this->_generator->setGenerateAnnotations(true);
@@ -42,14 +42,14 @@  discard block
 block discarded – undo
42 42
 
43 43
     public function tearDown()
44 44
     {
45
-        $ri = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($this->_tmpDir . '/' . $this->_namespace));
45
+        $ri = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($this->_tmpDir.'/'.$this->_namespace));
46 46
         foreach ($ri AS $file) {
47 47
             /* @var $file \SplFileInfo */
48 48
             if ($file->isFile()) {
49 49
                 \unlink($file->getPathname());
50 50
             }
51 51
         }
52
-        rmdir($this->_tmpDir . '/' . $this->_namespace);
52
+        rmdir($this->_tmpDir.'/'.$this->_namespace);
53 53
     }
54 54
 
55 55
     /** @after */
@@ -65,9 +65,9 @@  discard block
 block discarded – undo
65 65
      */
66 66
     public function generateBookEntityFixture(array $embeddedClasses = [])
67 67
     {
68
-        $metadata = new ClassMetadataInfo($this->_namespace . '\EntityGeneratorBook');
68
+        $metadata = new ClassMetadataInfo($this->_namespace.'\EntityGeneratorBook');
69 69
         $metadata->namespace = $this->_namespace;
70
-        $metadata->customRepositoryClassName = $this->_namespace  . '\EntityGeneratorBookRepository';
70
+        $metadata->customRepositoryClassName = $this->_namespace.'\EntityGeneratorBookRepository';
71 71
 
72 72
         $metadata->table['name'] = 'book';
73 73
         $metadata->table['uniqueConstraints']['name_uniq'] = ['columns' => ['name']];
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 
110 110
     private function generateEntityTypeFixture(array $field)
111 111
     {
112
-        $metadata = new ClassMetadataInfo($this->_namespace . '\EntityType');
112
+        $metadata = new ClassMetadataInfo($this->_namespace.'\EntityType');
113 113
         $metadata->namespace = $this->_namespace;
114 114
 
115 115
         $metadata->table['name'] = 'entity_type';
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
      */
131 131
     private function generateIsbnEmbeddableFixture(array $embeddedClasses = [], $columnPrefix = null)
132 132
     {
133
-        $metadata = new ClassMetadataInfo($this->_namespace . '\EntityGeneratorIsbn');
133
+        $metadata = new ClassMetadataInfo($this->_namespace.'\EntityGeneratorIsbn');
134 134
         $metadata->namespace = $this->_namespace;
135 135
         $metadata->isEmbeddedClass = true;
136 136
         $metadata->mapField(['fieldName' => 'prefix', 'type' => 'integer']);
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
      */
154 154
     private function generateTestEmbeddableFixture()
155 155
     {
156
-        $metadata = new ClassMetadataInfo($this->_namespace . '\EntityGeneratorTestEmbeddable');
156
+        $metadata = new ClassMetadataInfo($this->_namespace.'\EntityGeneratorTestEmbeddable');
157 157
         $metadata->namespace = $this->_namespace;
158 158
         $metadata->isEmbeddedClass = true;
159 159
         $metadata->mapField(['fieldName' => 'field1', 'type' => 'integer']);
@@ -196,11 +196,11 @@  discard block
 block discarded – undo
196 196
         foreach ($embeddableMetadata->embeddedClasses as $property => $embeddableClass) {
197 197
             $classMetadata->mapEmbedded(
198 198
                 [
199
-                'fieldName' => $fieldName . '.' . $property,
199
+                'fieldName' => $fieldName.'.'.$property,
200 200
                 'class' => $embeddableClass['class'],
201 201
                 'columnPrefix' => $embeddableClass['columnPrefix'],
202 202
                 'declaredField' => $embeddableClass['declaredField']
203
-                        ? $fieldName . '.' . $embeddableClass['declaredField']
203
+                        ? $fieldName.'.'.$embeddableClass['declaredField']
204 204
                         : $fieldName,
205 205
                 'originalField' => $embeddableClass['originalField'] ?: $property,
206 206
                 ]
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
     private function loadEntityClass(ClassMetadataInfo $metadata)
215 215
     {
216 216
         $className = basename(str_replace('\\', '/', $metadata->name));
217
-        $path = $this->_tmpDir . '/' . $this->_namespace . '/' . $className . '.php';
217
+        $path = $this->_tmpDir.'/'.$this->_namespace.'/'.$className.'.php';
218 218
 
219 219
         $this->assertFileExists($path);
220 220
 
@@ -274,19 +274,19 @@  discard block
 block discarded – undo
274 274
 
275 275
         $book = $this->newInstance($metadata);
276 276
         $this->assertTrue(class_exists($metadata->name), "Class does not exist.");
277
-        $this->assertTrue(method_exists($metadata->namespace . '\EntityGeneratorBook', '__construct'), "EntityGeneratorBook::__construct() missing.");
278
-        $this->assertTrue(method_exists($metadata->namespace . '\EntityGeneratorBook', 'getId'), "EntityGeneratorBook::getId() missing.");
279
-        $this->assertTrue(method_exists($metadata->namespace . '\EntityGeneratorBook', 'setName'), "EntityGeneratorBook::setName() missing.");
280
-        $this->assertTrue(method_exists($metadata->namespace . '\EntityGeneratorBook', 'getName'), "EntityGeneratorBook::getName() missing.");
281
-        $this->assertTrue(method_exists($metadata->namespace . '\EntityGeneratorBook', 'setStatus'), "EntityGeneratorBook::setStatus() missing.");
282
-        $this->assertTrue(method_exists($metadata->namespace . '\EntityGeneratorBook', 'getStatus'), "EntityGeneratorBook::getStatus() missing.");
283
-        $this->assertTrue(method_exists($metadata->namespace . '\EntityGeneratorBook', 'setAuthor'), "EntityGeneratorBook::setAuthor() missing.");
284
-        $this->assertTrue(method_exists($metadata->namespace . '\EntityGeneratorBook', 'getAuthor'), "EntityGeneratorBook::getAuthor() missing.");
285
-        $this->assertTrue(method_exists($metadata->namespace . '\EntityGeneratorBook', 'getComments'), "EntityGeneratorBook::getComments() missing.");
286
-        $this->assertTrue(method_exists($metadata->namespace . '\EntityGeneratorBook', 'addComment'), "EntityGeneratorBook::addComment() missing.");
287
-        $this->assertTrue(method_exists($metadata->namespace . '\EntityGeneratorBook', 'removeComment'), "EntityGeneratorBook::removeComment() missing.");
288
-        $this->assertTrue(method_exists($metadata->namespace . '\EntityGeneratorBook', 'setIsbn'), "EntityGeneratorBook::setIsbn() missing.");
289
-        $this->assertTrue(method_exists($metadata->namespace . '\EntityGeneratorBook', 'getIsbn'), "EntityGeneratorBook::getIsbn() missing.");
277
+        $this->assertTrue(method_exists($metadata->namespace.'\EntityGeneratorBook', '__construct'), "EntityGeneratorBook::__construct() missing.");
278
+        $this->assertTrue(method_exists($metadata->namespace.'\EntityGeneratorBook', 'getId'), "EntityGeneratorBook::getId() missing.");
279
+        $this->assertTrue(method_exists($metadata->namespace.'\EntityGeneratorBook', 'setName'), "EntityGeneratorBook::setName() missing.");
280
+        $this->assertTrue(method_exists($metadata->namespace.'\EntityGeneratorBook', 'getName'), "EntityGeneratorBook::getName() missing.");
281
+        $this->assertTrue(method_exists($metadata->namespace.'\EntityGeneratorBook', 'setStatus'), "EntityGeneratorBook::setStatus() missing.");
282
+        $this->assertTrue(method_exists($metadata->namespace.'\EntityGeneratorBook', 'getStatus'), "EntityGeneratorBook::getStatus() missing.");
283
+        $this->assertTrue(method_exists($metadata->namespace.'\EntityGeneratorBook', 'setAuthor'), "EntityGeneratorBook::setAuthor() missing.");
284
+        $this->assertTrue(method_exists($metadata->namespace.'\EntityGeneratorBook', 'getAuthor'), "EntityGeneratorBook::getAuthor() missing.");
285
+        $this->assertTrue(method_exists($metadata->namespace.'\EntityGeneratorBook', 'getComments'), "EntityGeneratorBook::getComments() missing.");
286
+        $this->assertTrue(method_exists($metadata->namespace.'\EntityGeneratorBook', 'addComment'), "EntityGeneratorBook::addComment() missing.");
287
+        $this->assertTrue(method_exists($metadata->namespace.'\EntityGeneratorBook', 'removeComment'), "EntityGeneratorBook::removeComment() missing.");
288
+        $this->assertTrue(method_exists($metadata->namespace.'\EntityGeneratorBook', 'setIsbn'), "EntityGeneratorBook::setIsbn() missing.");
289
+        $this->assertTrue(method_exists($metadata->namespace.'\EntityGeneratorBook', 'getIsbn'), "EntityGeneratorBook::getIsbn() missing.");
290 290
 
291 291
         $reflClass = new \ReflectionClass($metadata->name);
292 292
 
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
 
340 340
         $this->_generator->writeEntityClass($metadata, $this->_tmpDir);
341 341
 
342
-        $this->assertFileExists($this->_tmpDir . '/' . $this->_namespace . '/EntityGeneratorBook.php~');
342
+        $this->assertFileExists($this->_tmpDir.'/'.$this->_namespace.'/EntityGeneratorBook.php~');
343 343
 
344 344
         $book      = $this->newInstance($metadata);
345 345
         $reflClass = new ReflectionClass($metadata->name);
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
 
359 359
         $this->_generator->writeEntityClass($metadata, $this->_tmpDir);
360 360
 
361
-        $this->assertFileExists($this->_tmpDir . "/" . $this->_namespace . "/EntityGeneratorBook.php~");
361
+        $this->assertFileExists($this->_tmpDir."/".$this->_namespace."/EntityGeneratorBook.php~");
362 362
 
363 363
         $book = $this->newInstance($metadata);
364 364
         $reflClass = new \ReflectionClass($metadata->name);
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
         // Should not throw a PHP fatal error
404 404
         $this->_generator->writeEntityClass($metadata, $this->_tmpDir);
405 405
 
406
-        $this->assertFileExists($this->_tmpDir . "/" . $this->_namespace . "/EntityGeneratorBook.php~");
406
+        $this->assertFileExists($this->_tmpDir."/".$this->_namespace."/EntityGeneratorBook.php~");
407 407
 
408 408
         $this->newInstance($metadata);
409 409
         $reflClass = new \ReflectionClass($metadata->name);
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
         $this->assertPhpDocReturnType('\Doctrine\Tests\ORM\Tools\EntityGeneratorAuthor|null', new \ReflectionMethod($book, 'getAuthor'));
439 439
         $this->assertPhpDocParamType('\Doctrine\Tests\ORM\Tools\EntityGeneratorAuthor|null', new \ReflectionMethod($book, 'setAuthor'));
440 440
 
441
-        $expectedClassName = '\\' . $embeddedMetadata->name;
441
+        $expectedClassName = '\\'.$embeddedMetadata->name;
442 442
         $this->assertPhpDocVarType($expectedClassName, new \ReflectionProperty($book, 'isbn'));
443 443
         $this->assertPhpDocReturnType($expectedClassName, new \ReflectionMethod($book, 'getIsbn'));
444 444
         $this->assertPhpDocParamType($expectedClassName, new \ReflectionMethod($book, 'setIsbn'));
@@ -548,7 +548,7 @@  discard block
 block discarded – undo
548 548
      */
549 549
     public function testMappedSuperclassAnnotationGeneration()
550 550
     {
551
-        $metadata                     = new ClassMetadataInfo($this->_namespace . '\EntityGeneratorBook');
551
+        $metadata                     = new ClassMetadataInfo($this->_namespace.'\EntityGeneratorBook');
552 552
         $metadata->namespace          = $this->_namespace;
553 553
         $metadata->isMappedSuperclass = true;
554 554
 
@@ -586,7 +586,7 @@  discard block
 block discarded – undo
586 586
      */
587 587
     public function testGenerateEntityWithSequenceGenerator()
588 588
     {
589
-        $metadata               = new ClassMetadataInfo($this->_namespace . '\DDC1784Entity');
589
+        $metadata               = new ClassMetadataInfo($this->_namespace.'\DDC1784Entity');
590 590
         $metadata->namespace    = $this->_namespace;
591 591
         $metadata->mapField(['fieldName' => 'id', 'type' => 'integer', 'id' => true]);
592 592
         $metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_SEQUENCE);
@@ -599,8 +599,8 @@  discard block
 block discarded – undo
599 599
         );
600 600
         $this->_generator->writeEntityClass($metadata, $this->_tmpDir);
601 601
 
602
-        $filename = $this->_tmpDir . DIRECTORY_SEPARATOR
603
-                  . $this->_namespace . DIRECTORY_SEPARATOR . 'DDC1784Entity.php';
602
+        $filename = $this->_tmpDir.DIRECTORY_SEPARATOR
603
+                  . $this->_namespace.DIRECTORY_SEPARATOR.'DDC1784Entity.php';
604 604
 
605 605
         $this->assertFileExists($filename);
606 606
         require_once $filename;
@@ -620,7 +620,7 @@  discard block
 block discarded – undo
620 620
      */
621 621
     public function testGenerateEntityWithMultipleInverseJoinColumns()
622 622
     {
623
-        $metadata               = new ClassMetadataInfo($this->_namespace . '\DDC2079Entity');
623
+        $metadata               = new ClassMetadataInfo($this->_namespace.'\DDC2079Entity');
624 624
         $metadata->namespace    = $this->_namespace;
625 625
         $metadata->mapField(['fieldName' => 'id', 'type' => 'integer', 'id' => true]);
626 626
         $metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_SEQUENCE);
@@ -631,20 +631,20 @@  discard block
 block discarded – undo
631 631
             'joinTable'     => [
632 632
                 'name'                  => 'unidade_centro_custo',
633 633
                 'joinColumns'           => [
634
-                    ['name' => 'idorcamento',      'referencedColumnName' => 'idorcamento'],
635
-                    ['name' => 'idunidade',        'referencedColumnName' => 'idunidade']
634
+                    ['name' => 'idorcamento', 'referencedColumnName' => 'idorcamento'],
635
+                    ['name' => 'idunidade', 'referencedColumnName' => 'idunidade']
636 636
                 ],
637 637
                 'inverseJoinColumns'    => [
638
-                    ['name' => 'idcentrocusto',    'referencedColumnName' => 'idcentrocusto'],
639
-                    ['name' => 'idpais',           'referencedColumnName' => 'idpais'],
638
+                    ['name' => 'idcentrocusto', 'referencedColumnName' => 'idcentrocusto'],
639
+                    ['name' => 'idpais', 'referencedColumnName' => 'idpais'],
640 640
                 ],
641 641
             ],
642 642
             ]
643 643
         );
644 644
         $this->_generator->writeEntityClass($metadata, $this->_tmpDir);
645 645
 
646
-        $filename = $this->_tmpDir . DIRECTORY_SEPARATOR
647
-            . $this->_namespace . DIRECTORY_SEPARATOR . 'DDC2079Entity.php';
646
+        $filename = $this->_tmpDir.DIRECTORY_SEPARATOR
647
+            . $this->_namespace.DIRECTORY_SEPARATOR.'DDC2079Entity.php';
648 648
 
649 649
         $this->assertFileExists($filename);
650 650
         require_once $filename;
@@ -674,7 +674,7 @@  discard block
 block discarded – undo
674 674
         $method->setAccessible(true);
675 675
 
676 676
         foreach ($constants as $name => $value) {
677
-            if( ! preg_match($pattern, $name)) {
677
+            if ( ! preg_match($pattern, $name)) {
678 678
                 continue;
679 679
             }
680 680
 
@@ -703,7 +703,7 @@  discard block
 block discarded – undo
703 703
         $method->setAccessible(true);
704 704
 
705 705
         foreach ($constants as $name => $value) {
706
-            if( ! preg_match($pattern, $name)) {
706
+            if ( ! preg_match($pattern, $name)) {
707 707
                 continue;
708 708
             }
709 709
 
@@ -732,7 +732,7 @@  discard block
 block discarded – undo
732 732
         $method->setAccessible(true);
733 733
 
734 734
         foreach ($constants as $name => $value) {
735
-            if( ! preg_match($pattern, $name)) {
735
+            if ( ! preg_match($pattern, $name)) {
736 736
                 continue;
737 737
             }
738 738
 
@@ -756,7 +756,7 @@  discard block
 block discarded – undo
756 756
     public function testEntityTypeAlias(array $field)
757 757
     {
758 758
         $metadata   = $this->generateEntityTypeFixture($field);
759
-        $path       = $this->_tmpDir . '/'. $this->_namespace . '/EntityType.php';
759
+        $path       = $this->_tmpDir.'/'.$this->_namespace.'/EntityType.php';
760 760
 
761 761
         $this->assertFileExists($path);
762 762
         require_once $path;
@@ -767,8 +767,8 @@  discard block
 block discarded – undo
767 767
         $type   = $field['phpType'];
768 768
         $name   = $field['fieldName'];
769 769
         $value  = $field['value'];
770
-        $getter = "get" . ucfirst($name);
771
-        $setter = "set" . ucfirst($name);
770
+        $getter = "get".ucfirst($name);
771
+        $setter = "set".ucfirst($name);
772 772
 
773 773
         $this->assertPhpDocVarType($type, $reflClass->getProperty($name));
774 774
         $this->assertPhpDocParamType($type, $reflClass->getMethod($setter));
@@ -789,13 +789,13 @@  discard block
 block discarded – undo
789 789
 
790 790
         $user = new DDC2372User();
791 791
         $metadata = $cmf->getMetadataFor(get_class($user));
792
-        $metadata->name = $this->_namespace . "\DDC2372User";
792
+        $metadata->name = $this->_namespace."\DDC2372User";
793 793
         $metadata->namespace = $this->_namespace;
794 794
 
795 795
         $this->_generator->writeEntityClass($metadata, $this->_tmpDir);
796 796
 
797
-        $this->assertFileExists($this->_tmpDir . "/" . $this->_namespace . "/DDC2372User.php");
798
-        require $this->_tmpDir . "/" . $this->_namespace . "/DDC2372User.php";
797
+        $this->assertFileExists($this->_tmpDir."/".$this->_namespace."/DDC2372User.php");
798
+        require $this->_tmpDir."/".$this->_namespace."/DDC2372User.php";
799 799
 
800 800
         $reflClass = new \ReflectionClass($metadata->name);
801 801
 
@@ -815,13 +815,13 @@  discard block
 block discarded – undo
815 815
 
816 816
         $user = new DDC2372Admin();
817 817
         $metadata = $cmf->getMetadataFor(get_class($user));
818
-        $metadata->name = $this->_namespace . "\DDC2372Admin";
818
+        $metadata->name = $this->_namespace."\DDC2372Admin";
819 819
         $metadata->namespace = $this->_namespace;
820 820
 
821 821
         $this->_generator->writeEntityClass($metadata, $this->_tmpDir);
822 822
 
823
-        $this->assertFileExists($this->_tmpDir . "/" . $this->_namespace . "/DDC2372Admin.php");
824
-        require $this->_tmpDir . "/" . $this->_namespace . "/DDC2372Admin.php";
823
+        $this->assertFileExists($this->_tmpDir."/".$this->_namespace."/DDC2372Admin.php");
824
+        require $this->_tmpDir."/".$this->_namespace."/DDC2372Admin.php";
825 825
 
826 826
         $reflClass = new \ReflectionClass($metadata->name);
827 827
 
@@ -841,20 +841,20 @@  discard block
 block discarded – undo
841 841
         $cmf->setEntityManager($em);
842 842
 
843 843
         $ns     = $this->_namespace;
844
-        $nsdir  = $this->_tmpDir . '/' . $ns;
844
+        $nsdir  = $this->_tmpDir.'/'.$ns;
845 845
 
846 846
         $content = str_replace(
847 847
             'namespace Doctrine\Tests\Models\DDC1590',
848
-            'namespace ' . $ns,
849
-            file_get_contents(__DIR__ . '/../../Models/DDC1590/DDC1590User.php')
848
+            'namespace '.$ns,
849
+            file_get_contents(__DIR__.'/../../Models/DDC1590/DDC1590User.php')
850 850
         );
851 851
 
852
-        $fname = $nsdir . "/DDC1590User.php";
852
+        $fname = $nsdir."/DDC1590User.php";
853 853
         file_put_contents($fname, $content);
854 854
         require $fname;
855 855
 
856 856
 
857
-        $metadata = $cmf->getMetadataFor($ns . '\DDC1590User');
857
+        $metadata = $cmf->getMetadataFor($ns.'\DDC1590User');
858 858
         $this->_generator->writeEntityClass($metadata, $this->_tmpDir);
859 859
 
860 860
         // class DDC1590User extends DDC1590Entity { ... }
@@ -862,13 +862,13 @@  discard block
 block discarded – undo
862 862
 
863 863
         // class _DDC1590User extends DDC1590Entity { ... }
864 864
         $source2    = str_replace('class DDC1590User', 'class _DDC1590User', $source);
865
-        $fname2     = $nsdir . "/_DDC1590User.php";
865
+        $fname2     = $nsdir."/_DDC1590User.php";
866 866
         file_put_contents($fname2, $source2);
867 867
         require $fname2;
868 868
 
869 869
         // class __DDC1590User { ... }
870 870
         $source3    = str_replace('class DDC1590User extends DDC1590Entity', 'class __DDC1590User', $source);
871
-        $fname3     = $nsdir . "/__DDC1590User.php";
871
+        $fname3     = $nsdir."/__DDC1590User.php";
872 872
         file_put_contents($fname3, $source3);
873 873
         require $fname3;
874 874
 
@@ -1022,7 +1022,7 @@  discard block
 block discarded – undo
1022 1022
         $this->loadEntityClass($metadata);
1023 1023
 
1024 1024
         $className = basename(str_replace('\\', '/', $metadata->name));
1025
-        $path = $this->_tmpDir . '/' . $this->_namespace . '/' . $className . '.php';
1025
+        $path = $this->_tmpDir.'/'.$this->_namespace.'/'.$className.'.php';
1026 1026
         $classTest = file_get_contents($path);
1027 1027
 
1028 1028
         $this->_generator->setRegenerateEntityIfExists(true);
@@ -1031,7 +1031,7 @@  discard block
 block discarded – undo
1031 1031
         $this->_generator->writeEntityClass($metadata, $this->_tmpDir);
1032 1032
         $classNew = file_get_contents($path);
1033 1033
 
1034
-        $this->assertSame($classTest,$classNew);
1034
+        $this->assertSame($classTest, $classNew);
1035 1035
     }
1036 1036
 
1037 1037
     /**
@@ -1218,14 +1218,14 @@  discard block
 block discarded – undo
1218 1218
      */
1219 1219
     public function testOptionsAreGeneratedProperly(string $expectedAnnotation, array $fieldConfiguration) : void
1220 1220
     {
1221
-        $metadata               = new ClassMetadataInfo($this->_namespace . '\GH6703Options');
1221
+        $metadata               = new ClassMetadataInfo($this->_namespace.'\GH6703Options');
1222 1222
         $metadata->namespace    = $this->_namespace;
1223 1223
         $metadata->mapField(['fieldName' => 'id', 'type' => 'integer', 'id' => true]);
1224 1224
         $metadata->mapField(['fieldName' => 'test'] + $fieldConfiguration);
1225 1225
         $metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_SEQUENCE);
1226 1226
         $this->_generator->writeEntityClass($metadata, $this->_tmpDir);
1227 1227
 
1228
-        $filename = $this->_tmpDir . DIRECTORY_SEPARATOR . $this->_namespace . DIRECTORY_SEPARATOR . 'GH6703Options.php';
1228
+        $filename = $this->_tmpDir.DIRECTORY_SEPARATOR.$this->_namespace.DIRECTORY_SEPARATOR.'GH6703Options.php';
1229 1229
 
1230 1230
         self::assertFileExists($filename);
1231 1231
         require_once $filename;
Please login to merge, or discard this patch.
tests/Doctrine/Tests/VerifyDeprecations.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
         $this->ignoredDeprecations  = [];
31 31
 
32 32
         $this->originalHandler = set_error_handler(
33
-            function (int $errorNumber, string $errorMessage) : void {
33
+            function(int $errorNumber, string $errorMessage) : void {
34 34
                 if (in_array($errorMessage, $this->ignoredDeprecations, true)) {
35 35
                     return;
36 36
                 }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/SchemaTool.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
                             $targetEntity = current(
227 227
                                 array_filter(
228 228
                                     $classes,
229
-                                    function (ClassMetadata $class) use ($idMapping) : bool {
229
+                                    function(ClassMetadata $class) use ($idMapping) : bool {
230 230
                                         return $class->name === $idMapping['targetEntity'];
231 231
                                     }
232 232
                                 )
@@ -646,8 +646,8 @@  discard block
 block discarded – undo
646 646
 
647 647
             if ( ! $definingClass) {
648 648
                 throw new \Doctrine\ORM\ORMException(
649
-                    'Column name `' . $joinColumn['referencedColumnName'] . '` referenced for relation from '
650
-                    . $mapping['sourceEntity'] . ' towards ' . $mapping['targetEntity'] . ' does not exist.'
649
+                    'Column name `'.$joinColumn['referencedColumnName'].'` referenced for relation from '
650
+                    . $mapping['sourceEntity'].' towards '.$mapping['targetEntity'].' does not exist.'
651 651
                 );
652 652
             }
653 653
 
@@ -742,7 +742,7 @@  discard block
 block discarded – undo
742 742
      */
743 743
     private function gatherColumnOptions(array $mapping) : array
744 744
     {
745
-        if (! isset($mapping['options'])) {
745
+        if ( ! isset($mapping['options'])) {
746 746
             return [];
747 747
         }
748 748
 
@@ -848,7 +848,7 @@  discard block
 block discarded – undo
848 848
                 if ($table->hasPrimaryKey()) {
849 849
                     $columns = $table->getPrimaryKey()->getColumns();
850 850
                     if (count($columns) == 1) {
851
-                        $checkSequence = $table->getName() . '_' . $columns[0] . '_seq';
851
+                        $checkSequence = $table->getName().'_'.$columns[0].'_seq';
852 852
                         if ($fullSchema->hasSequence($checkSequence)) {
853 853
                             $visitor->acceptSequence($fullSchema->getSequence($checkSequence));
854 854
                         }
@@ -922,7 +922,7 @@  discard block
 block discarded – undo
922 922
         }
923 923
 
924 924
         // whitelist assets we already know about in $toSchema, use the existing filter otherwise
925
-        $config->setSchemaAssetsFilter(static function ($asset) use ($previousFilter, $toSchema) : bool {
925
+        $config->setSchemaAssetsFilter(static function($asset) use ($previousFilter, $toSchema) : bool {
926 926
             $assetName = $asset instanceof AbstractAsset ? $asset->getName() : $asset;
927 927
 
928 928
             return $toSchema->hasTable($assetName) || $toSchema->hasSequence($assetName) || $previousFilter($asset);
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/Ticket/GH7875Test.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
      */
39 39
     private function filterCreateTable(array $sqls, string $tableName) : array
40 40
     {
41
-        return array_filter($sqls, static function (string $sql) use ($tableName) : bool {
41
+        return array_filter($sqls, static function(string $sql) use ($tableName) : bool {
42 42
             return strpos($sql, sprintf('CREATE TABLE %s (', $tableName)) === 0;
43 43
         });
44 44
     }
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 
55 55
         $this->_em->getConnection()->exec(current($sqls));
56 56
 
57
-        $sqls = array_filter($tool->getUpdateSchemaSql($classes), static function (string $sql) : bool {
57
+        $sqls = array_filter($tool->getUpdateSchemaSql($classes), static function(string $sql) : bool {
58 58
             return strpos($sql, ' gh7875_my_entity ') !== false;
59 59
         });
60 60
 
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
             ['/^(?!my_enti)/', null],
78 78
             [
79 79
                 null,
80
-                static function ($assetName) : bool {
80
+                static function($assetName) : bool {
81 81
                     return $assetName !== 'gh7875_my_entity';
82 82
                 },
83 83
             ],
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
         $previousFilter = $config->getSchemaAssetsFilter();
107 107
 
108 108
         $sqls = $tool->getUpdateSchemaSql($classes);
109
-        $sqls = array_filter($sqls, static function (string $sql) : bool {
109
+        $sqls = array_filter($sqls, static function(string $sql) : bool {
110 110
             return strpos($sql, ' gh7875_my_entity ') !== false;
111 111
         });
112 112
 
Please login to merge, or discard this patch.