Passed
Pull Request — 2.7 (#7911)
by Luís
08:44
created
lib/Doctrine/ORM/Tools/EntityRepositoryGenerator.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 
58 58
     public function __construct()
59 59
     {
60
-        @trigger_error(self::class . ' is deprecated and will be removed in Doctrine ORM 3.0', E_USER_DEPRECATED);
60
+        @trigger_error(self::class.' is deprecated and will be removed in Doctrine ORM 3.0', E_USER_DEPRECATED);
61 61
     }
62 62
 
63 63
     /**
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
     {
122 122
         $namespace = $this->getClassNamespace($fullClassName);
123 123
 
124
-        return $namespace ? 'namespace ' . $namespace . ';' : '';
124
+        return $namespace ? 'namespace '.$namespace.';' : '';
125 125
     }
126 126
 
127 127
     /**
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
         $repositoryName = $this->repositoryName ?: EntityRepository::class;
137 137
 
138 138
         if ($namespace && $repositoryName[0] !== '\\') {
139
-            $repositoryName = '\\' . $repositoryName;
139
+            $repositoryName = '\\'.$repositoryName;
140 140
         }
141 141
 
142 142
         return $repositoryName;
@@ -152,8 +152,8 @@  discard block
 block discarded – undo
152 152
     {
153 153
         $code = $this->generateEntityRepositoryClass($fullClassName);
154 154
 
155
-        $path = $outputDirectory . DIRECTORY_SEPARATOR
156
-              . str_replace('\\', \DIRECTORY_SEPARATOR, $fullClassName) . '.php';
155
+        $path = $outputDirectory.DIRECTORY_SEPARATOR
156
+              . str_replace('\\', \DIRECTORY_SEPARATOR, $fullClassName).'.php';
157 157
         $dir = dirname($path);
158 158
 
159 159
         if ( ! is_dir($dir)) {
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Export/ClassMetadataExporter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
 
47 47
     public function __construct()
48 48
     {
49
-        @trigger_error(self::class . ' is deprecated and will be removed in Doctrine ORM 3.0', E_USER_DEPRECATED);
49
+        @trigger_error(self::class.' is deprecated and will be removed in Doctrine ORM 3.0', E_USER_DEPRECATED);
50 50
     }
51 51
 
52 52
     /**
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Export/Driver/AbstractExporter.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
      */
61 61
     public function __construct($dir = null)
62 62
     {
63
-        @trigger_error(static::class . ' is deprecated and will be removed in Doctrine ORM 3.0', E_USER_DEPRECATED);
63
+        @trigger_error(static::class.' is deprecated and will be removed in Doctrine ORM 3.0', E_USER_DEPRECATED);
64 64
 
65 65
         $this->_outputDir = $dir;
66 66
     }
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
                 if ( ! is_dir($dir)) {
147 147
                     mkdir($dir, 0775, true);
148 148
                 }
149
-                if (file_exists($path) && !$this->_overwriteExistingFiles) {
149
+                if (file_exists($path) && ! $this->_overwriteExistingFiles) {
150 150
                     throw ExportException::attemptOverwriteExistingFile($path);
151 151
                 }
152 152
                 file_put_contents($path, $output);
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
      */
165 165
     protected function _generateOutputPath(ClassMetadataInfo $metadata)
166 166
     {
167
-        return $this->_outputDir . '/' . str_replace('\\', '.', $metadata->name) . $this->_extension;
167
+        return $this->_outputDir.'/'.str_replace('\\', '.', $metadata->name).$this->_extension;
168 168
     }
169 169
 
170 170
     /**
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/EntityGenerator.php 1 patch
Spacing   +151 added lines, -151 removed lines patch added patch discarded remove patch
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
      */
339 339
     public function __construct()
340 340
     {
341
-        @trigger_error(self::class . ' is deprecated and will be removed in Doctrine ORM 3.0', E_USER_DEPRECATED);
341
+        @trigger_error(self::class.' is deprecated and will be removed in Doctrine ORM 3.0', E_USER_DEPRECATED);
342 342
 
343 343
         if (version_compare(\Doctrine\Common\Version::VERSION, '2.2.0-DEV', '>=')) {
344 344
             $this->annotationsPrefix = 'ORM\\';
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
      */
373 373
     public function writeEntityClass(ClassMetadataInfo $metadata, $outputDirectory)
374 374
     {
375
-        $path = $outputDirectory . '/' . str_replace('\\', DIRECTORY_SEPARATOR, $metadata->name) . $this->extension;
375
+        $path = $outputDirectory.'/'.str_replace('\\', DIRECTORY_SEPARATOR, $metadata->name).$this->extension;
376 376
         $dir = dirname($path);
377 377
 
378 378
         if ( ! is_dir($dir)) {
@@ -388,8 +388,8 @@  discard block
 block discarded – undo
388 388
         }
389 389
 
390 390
         if ($this->backupExisting && file_exists($path)) {
391
-            $backupPath = dirname($path) . DIRECTORY_SEPARATOR . basename($path) . "~";
392
-            if (!copy($path, $backupPath)) {
391
+            $backupPath = dirname($path).DIRECTORY_SEPARATOR.basename($path)."~";
392
+            if ( ! copy($path, $backupPath)) {
393 393
                 throw new \RuntimeException("Attempt to backup overwritten entity file but copy operation failed.");
394 394
             }
395 395
         }
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
         $body = str_replace('<spaces>', $this->spaces, $body);
451 451
         $last = strrpos($currentCode, '}');
452 452
 
453
-        return substr($currentCode, 0, $last) . $body . ($body ? "\n" : '') . "}\n";
453
+        return substr($currentCode, 0, $last).$body.($body ? "\n" : '')."}\n";
454 454
     }
455 455
 
456 456
     /**
@@ -514,7 +514,7 @@  discard block
 block discarded – undo
514 514
     public function setFieldVisibility($visibility)
515 515
     {
516 516
         if ($visibility !== static::FIELD_VISIBLE_PRIVATE && $visibility !== static::FIELD_VISIBLE_PROTECTED) {
517
-            throw new \InvalidArgumentException('Invalid provided visibility (only private and protected are allowed): ' . $visibility);
517
+            throw new \InvalidArgumentException('Invalid provided visibility (only private and protected are allowed): '.$visibility);
518 518
         }
519 519
 
520 520
         $this->fieldVisibility = $visibility;
@@ -611,11 +611,11 @@  discard block
 block discarded – undo
611 611
      */
612 612
     protected function generateEntityNamespace(ClassMetadataInfo $metadata)
613 613
     {
614
-        if (! $this->hasNamespace($metadata)) {
614
+        if ( ! $this->hasNamespace($metadata)) {
615 615
             return '';
616 616
         }
617 617
 
618
-        return 'namespace ' . $this->getNamespace($metadata) .';';
618
+        return 'namespace '.$this->getNamespace($metadata).';';
619 619
     }
620 620
 
621 621
     /**
@@ -623,7 +623,7 @@  discard block
 block discarded – undo
623 623
      */
624 624
     protected function generateEntityUse()
625 625
     {
626
-        if (! $this->generateAnnotations) {
626
+        if ( ! $this->generateAnnotations) {
627 627
             return '';
628 628
         }
629 629
 
@@ -637,8 +637,8 @@  discard block
 block discarded – undo
637 637
      */
638 638
     protected function generateEntityClassName(ClassMetadataInfo $metadata)
639 639
     {
640
-        return 'class ' . $this->getClassName($metadata) .
641
-            ($this->extendsClass() ? ' extends ' . $this->getClassToExtendName() : null);
640
+        return 'class '.$this->getClassName($metadata).
641
+            ($this->extendsClass() ? ' extends '.$this->getClassToExtendName() : null);
642 642
     }
643 643
 
644 644
     /**
@@ -740,13 +740,13 @@  discard block
 block discarded – undo
740 740
         $fieldMappings = array_merge($requiredFields, $optionalFields);
741 741
 
742 742
         foreach ($metadata->embeddedClasses as $fieldName => $embeddedClass) {
743
-            $paramType = '\\' . ltrim($embeddedClass['class'], '\\');
744
-            $paramVariable = '$' . $fieldName;
743
+            $paramType = '\\'.ltrim($embeddedClass['class'], '\\');
744
+            $paramVariable = '$'.$fieldName;
745 745
 
746 746
             $paramTypes[] = $paramType;
747 747
             $paramVariables[] = $paramVariable;
748
-            $params[] = $paramType . ' ' . $paramVariable;
749
-            $fields[] = '$this->' . $fieldName . ' = ' . $paramVariable . ';';
748
+            $params[] = $paramType.' '.$paramVariable;
749
+            $fields[] = '$this->'.$fieldName.' = '.$paramVariable.';';
750 750
         }
751 751
 
752 752
         foreach ($fieldMappings as $fieldMapping) {
@@ -754,27 +754,27 @@  discard block
 block discarded – undo
754 754
                 continue;
755 755
             }
756 756
 
757
-            $paramTypes[] = $this->getType($fieldMapping['type']) . (!empty($fieldMapping['nullable']) ? '|null' : '');
758
-            $param = '$' . $fieldMapping['fieldName'];
757
+            $paramTypes[] = $this->getType($fieldMapping['type']).( ! empty($fieldMapping['nullable']) ? '|null' : '');
758
+            $param = '$'.$fieldMapping['fieldName'];
759 759
             $paramVariables[] = $param;
760 760
 
761 761
             if ($fieldMapping['type'] === 'datetime') {
762
-                $param = $this->getType($fieldMapping['type']) . ' ' . $param;
762
+                $param = $this->getType($fieldMapping['type']).' '.$param;
763 763
             }
764 764
 
765
-            if (!empty($fieldMapping['nullable'])) {
765
+            if ( ! empty($fieldMapping['nullable'])) {
766 766
                 $param .= ' = null';
767 767
             }
768 768
 
769 769
             $params[] = $param;
770 770
 
771
-            $fields[] = '$this->' . $fieldMapping['fieldName'] . ' = $' . $fieldMapping['fieldName'] . ';';
771
+            $fields[] = '$this->'.$fieldMapping['fieldName'].' = $'.$fieldMapping['fieldName'].';';
772 772
         }
773 773
 
774 774
         $maxParamTypeLength = max(array_map('strlen', $paramTypes));
775 775
         $paramTags = array_map(
776
-            function ($type, $variable) use ($maxParamTypeLength) {
777
-                return '@param ' . $type . str_repeat(' ', $maxParamTypeLength - strlen($type) + 1) . $variable;
776
+            function($type, $variable) use ($maxParamTypeLength) {
777
+                return '@param '.$type.str_repeat(' ', $maxParamTypeLength - strlen($type) + 1).$variable;
778 778
             },
779 779
             $paramTypes,
780 780
             $paramVariables
@@ -782,8 +782,8 @@  discard block
 block discarded – undo
782 782
 
783 783
         // Generate multi line constructor if the signature exceeds 120 characters.
784 784
         if (array_sum(array_map('strlen', $params)) + count($params) * 2 + 29 > 120) {
785
-            $delimiter = "\n" . $this->spaces;
786
-            $params = $delimiter . implode(',' . $delimiter, $params) . "\n";
785
+            $delimiter = "\n".$this->spaces;
786
+            $params = $delimiter.implode(','.$delimiter, $params)."\n";
787 787
         } else {
788 788
             $params = implode(', ', $params);
789 789
         }
@@ -791,7 +791,7 @@  discard block
 block discarded – undo
791 791
         $replacements = [
792 792
             '<paramTags>' => implode("\n * ", $paramTags),
793 793
             '<params>'    => $params,
794
-            '<fields>'    => implode("\n" . $this->spaces, $fields),
794
+            '<fields>'    => implode("\n".$this->spaces, $fields),
795 795
         ];
796 796
 
797 797
         $constructor = str_replace(
@@ -836,7 +836,7 @@  discard block
 block discarded – undo
836 836
 
837 837
             if ($inClass) {
838 838
                 $inClass = false;
839
-                $lastSeenClass = $lastSeenNamespace . ($lastSeenNamespace ? '\\' : '') . $token[1];
839
+                $lastSeenClass = $lastSeenNamespace.($lastSeenNamespace ? '\\' : '').$token[1];
840 840
                 $this->staticReflection[$lastSeenClass]['properties'] = [];
841 841
                 $this->staticReflection[$lastSeenClass]['methods'] = [];
842 842
             }
@@ -844,16 +844,16 @@  discard block
 block discarded – undo
844 844
             if (T_NAMESPACE === $token[0]) {
845 845
                 $lastSeenNamespace = '';
846 846
                 $inNamespace = true;
847
-            } elseif (T_CLASS === $token[0] && T_DOUBLE_COLON !== $tokens[$i-1][0]) {
847
+            } elseif (T_CLASS === $token[0] && T_DOUBLE_COLON !== $tokens[$i - 1][0]) {
848 848
                 $inClass = true;
849 849
             } elseif (T_FUNCTION === $token[0]) {
850
-                if (T_STRING === $tokens[$i+2][0]) {
851
-                    $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i+2][1]);
852
-                } elseif ($tokens[$i+2] == '&' && T_STRING === $tokens[$i+3][0]) {
853
-                    $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i+3][1]);
850
+                if (T_STRING === $tokens[$i + 2][0]) {
851
+                    $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i + 2][1]);
852
+                } elseif ($tokens[$i + 2] == '&' && T_STRING === $tokens[$i + 3][0]) {
853
+                    $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i + 3][1]);
854 854
                 }
855
-            } elseif (in_array($token[0], [T_VAR, T_PUBLIC, T_PRIVATE, T_PROTECTED], true) && T_FUNCTION !== $tokens[$i+2][0]) {
856
-                $this->staticReflection[$lastSeenClass]['properties'][] = substr($tokens[$i+2][1], 1);
855
+            } elseif (in_array($token[0], [T_VAR, T_PUBLIC, T_PRIVATE, T_PROTECTED], true) && T_FUNCTION !== $tokens[$i + 2][0]) {
856
+                $this->staticReflection[$lastSeenClass]['properties'][] = substr($tokens[$i + 2][1], 1);
857 857
             }
858 858
         }
859 859
     }
@@ -866,7 +866,7 @@  discard block
 block discarded – undo
866 866
      */
867 867
     protected function hasProperty($property, ClassMetadataInfo $metadata)
868 868
     {
869
-        if ($this->extendsClass() || (!$this->isNew && class_exists($metadata->name))) {
869
+        if ($this->extendsClass() || ( ! $this->isNew && class_exists($metadata->name))) {
870 870
             // don't generate property if its already on the base class.
871 871
             $reflClass = new \ReflectionClass($this->getClassToExtend() ?: $metadata->name);
872 872
             if ($reflClass->hasProperty($property)) {
@@ -895,7 +895,7 @@  discard block
 block discarded – undo
895 895
      */
896 896
     protected function hasMethod($method, ClassMetadataInfo $metadata)
897 897
     {
898
-        if ($this->extendsClass() || (!$this->isNew && class_exists($metadata->name))) {
898
+        if ($this->extendsClass() || ( ! $this->isNew && class_exists($metadata->name))) {
899 899
             // don't generate method if its already on the base class.
900 900
             $reflClass = new \ReflectionClass($this->getClassToExtend() ?: $metadata->name);
901 901
 
@@ -926,7 +926,7 @@  discard block
 block discarded – undo
926 926
      */
927 927
     protected function getTraits(ClassMetadataInfo $metadata)
928 928
     {
929
-        if (! ($metadata->reflClass !== null || class_exists($metadata->name))) {
929
+        if ( ! ($metadata->reflClass !== null || class_exists($metadata->name))) {
930 930
             return [];
931 931
         }
932 932
 
@@ -976,7 +976,7 @@  discard block
 block discarded – undo
976 976
     {
977 977
         $refl = new \ReflectionClass($this->getClassToExtend());
978 978
 
979
-        return '\\' . $refl->getName();
979
+        return '\\'.$refl->getName();
980 980
     }
981 981
 
982 982
     /**
@@ -1009,7 +1009,7 @@  discard block
 block discarded – undo
1009 1009
     {
1010 1010
         $lines = [];
1011 1011
         $lines[] = '/**';
1012
-        $lines[] = ' * ' . $this->getClassName($metadata);
1012
+        $lines[] = ' * '.$this->getClassName($metadata);
1013 1013
 
1014 1014
         if ($this->generateAnnotations) {
1015 1015
             $lines[] = ' *';
@@ -1025,12 +1025,12 @@  discard block
 block discarded – undo
1025 1025
 
1026 1026
             foreach ($methods as $method) {
1027 1027
                 if ($code = $this->$method($metadata)) {
1028
-                    $lines[] = ' * ' . $code;
1028
+                    $lines[] = ' * '.$code;
1029 1029
                 }
1030 1030
             }
1031 1031
 
1032 1032
             if (isset($metadata->lifecycleCallbacks) && $metadata->lifecycleCallbacks) {
1033
-                $lines[] = ' * @' . $this->annotationsPrefix . 'HasLifecycleCallbacks';
1033
+                $lines[] = ' * @'.$this->annotationsPrefix.'HasLifecycleCallbacks';
1034 1034
             }
1035 1035
         }
1036 1036
 
@@ -1046,17 +1046,17 @@  discard block
 block discarded – undo
1046 1046
      */
1047 1047
     protected function generateEntityAnnotation(ClassMetadataInfo $metadata)
1048 1048
     {
1049
-        $prefix = '@' . $this->annotationsPrefix;
1049
+        $prefix = '@'.$this->annotationsPrefix;
1050 1050
 
1051 1051
         if ($metadata->isEmbeddedClass) {
1052
-            return $prefix . 'Embeddable';
1052
+            return $prefix.'Embeddable';
1053 1053
         }
1054 1054
 
1055 1055
         $customRepository = $metadata->customRepositoryClassName
1056
-            ? '(repositoryClass="' . $metadata->customRepositoryClassName . '")'
1056
+            ? '(repositoryClass="'.$metadata->customRepositoryClassName.'")'
1057 1057
             : '';
1058 1058
 
1059
-        return $prefix . ($metadata->isMappedSuperclass ? 'MappedSuperclass' : 'Entity') . $customRepository;
1059
+        return $prefix.($metadata->isMappedSuperclass ? 'MappedSuperclass' : 'Entity').$customRepository;
1060 1060
     }
1061 1061
 
1062 1062
     /**
@@ -1073,28 +1073,28 @@  discard block
 block discarded – undo
1073 1073
         $table = [];
1074 1074
 
1075 1075
         if (isset($metadata->table['schema'])) {
1076
-            $table[] = 'schema="' . $metadata->table['schema'] . '"';
1076
+            $table[] = 'schema="'.$metadata->table['schema'].'"';
1077 1077
         }
1078 1078
 
1079 1079
         if (isset($metadata->table['name'])) {
1080
-            $table[] = 'name="' . $metadata->table['name'] . '"';
1080
+            $table[] = 'name="'.$metadata->table['name'].'"';
1081 1081
         }
1082 1082
 
1083 1083
         if (isset($metadata->table['options']) && $metadata->table['options']) {
1084
-            $table[] = 'options={' . $this->exportTableOptions((array) $metadata->table['options']) . '}';
1084
+            $table[] = 'options={'.$this->exportTableOptions((array) $metadata->table['options']).'}';
1085 1085
         }
1086 1086
 
1087 1087
         if (isset($metadata->table['uniqueConstraints']) && $metadata->table['uniqueConstraints']) {
1088 1088
             $constraints = $this->generateTableConstraints('UniqueConstraint', $metadata->table['uniqueConstraints']);
1089
-            $table[] = 'uniqueConstraints={' . $constraints . '}';
1089
+            $table[] = 'uniqueConstraints={'.$constraints.'}';
1090 1090
         }
1091 1091
 
1092 1092
         if (isset($metadata->table['indexes']) && $metadata->table['indexes']) {
1093 1093
             $constraints = $this->generateTableConstraints('Index', $metadata->table['indexes']);
1094
-            $table[] = 'indexes={' . $constraints . '}';
1094
+            $table[] = 'indexes={'.$constraints.'}';
1095 1095
         }
1096 1096
 
1097
-        return '@' . $this->annotationsPrefix . 'Table(' . implode(', ', $table) . ')';
1097
+        return '@'.$this->annotationsPrefix.'Table('.implode(', ', $table).')';
1098 1098
     }
1099 1099
 
1100 1100
     /**
@@ -1109,9 +1109,9 @@  discard block
 block discarded – undo
1109 1109
         foreach ($constraints as $name => $constraint) {
1110 1110
             $columns = [];
1111 1111
             foreach ($constraint['columns'] as $column) {
1112
-                $columns[] = '"' . $column . '"';
1112
+                $columns[] = '"'.$column.'"';
1113 1113
             }
1114
-            $annotations[] = '@' . $this->annotationsPrefix . $constraintName . '(name="' . $name . '", columns={' . implode(', ', $columns) . '})';
1114
+            $annotations[] = '@'.$this->annotationsPrefix.$constraintName.'(name="'.$name.'", columns={'.implode(', ', $columns).'})';
1115 1115
         }
1116 1116
 
1117 1117
         return implode(', ', $annotations);
@@ -1128,7 +1128,7 @@  discard block
 block discarded – undo
1128 1128
             return '';
1129 1129
         }
1130 1130
 
1131
-        return '@' . $this->annotationsPrefix . 'InheritanceType("'.$this->getInheritanceTypeString($metadata->inheritanceType).'")';
1131
+        return '@'.$this->annotationsPrefix.'InheritanceType("'.$this->getInheritanceTypeString($metadata->inheritanceType).'")';
1132 1132
     }
1133 1133
 
1134 1134
     /**
@@ -1143,11 +1143,11 @@  discard block
 block discarded – undo
1143 1143
         }
1144 1144
 
1145 1145
         $discrColumn = $metadata->discriminatorColumn;
1146
-        $columnDefinition = 'name="' . $discrColumn['name']
1147
-            . '", type="' . $discrColumn['type']
1148
-            . '", length=' . $discrColumn['length'];
1146
+        $columnDefinition = 'name="'.$discrColumn['name']
1147
+            . '", type="'.$discrColumn['type']
1148
+            . '", length='.$discrColumn['length'];
1149 1149
 
1150
-        return '@' . $this->annotationsPrefix . 'DiscriminatorColumn(' . $columnDefinition . ')';
1150
+        return '@'.$this->annotationsPrefix.'DiscriminatorColumn('.$columnDefinition.')';
1151 1151
     }
1152 1152
 
1153 1153
     /**
@@ -1164,10 +1164,10 @@  discard block
 block discarded – undo
1164 1164
         $inheritanceClassMap = [];
1165 1165
 
1166 1166
         foreach ($metadata->discriminatorMap as $type => $class) {
1167
-            $inheritanceClassMap[] .= '"' . $type . '" = "' . $class . '"';
1167
+            $inheritanceClassMap[] .= '"'.$type.'" = "'.$class.'"';
1168 1168
         }
1169 1169
 
1170
-        return '@' . $this->annotationsPrefix . 'DiscriminatorMap({' . implode(', ', $inheritanceClassMap) . '})';
1170
+        return '@'.$this->annotationsPrefix.'DiscriminatorMap({'.implode(', ', $inheritanceClassMap).'})';
1171 1171
     }
1172 1172
 
1173 1173
     /**
@@ -1186,8 +1186,8 @@  discard block
 block discarded – undo
1186 1186
 
1187 1187
             $nullableField = $this->nullableFieldExpression($fieldMapping);
1188 1188
 
1189
-            if ((!$metadata->isEmbeddedClass || !$this->embeddablesImmutable)
1190
-                && (!isset($fieldMapping['id']) || ! $fieldMapping['id'] || $metadata->generatorType === ClassMetadataInfo::GENERATOR_TYPE_NONE)
1189
+            if (( ! $metadata->isEmbeddedClass || ! $this->embeddablesImmutable)
1190
+                && ( ! isset($fieldMapping['id']) || ! $fieldMapping['id'] || $metadata->generatorType === ClassMetadataInfo::GENERATOR_TYPE_NONE)
1191 1191
                 && $code = $this->generateEntityStubMethod($metadata, 'set', $fieldMapping['fieldName'], $fieldMapping['type'], $nullableField)
1192 1192
             ) {
1193 1193
                 $methods[] = $code;
@@ -1258,7 +1258,7 @@  discard block
 block discarded – undo
1258 1258
         }
1259 1259
 
1260 1260
         foreach ($joinColumns as $joinColumn) {
1261
-            if (isset($joinColumn['nullable']) && !$joinColumn['nullable']) {
1261
+            if (isset($joinColumn['nullable']) && ! $joinColumn['nullable']) {
1262 1262
                 return false;
1263 1263
             }
1264 1264
         }
@@ -1303,8 +1303,8 @@  discard block
 block discarded – undo
1303 1303
             }
1304 1304
 
1305 1305
             $lines[] = $this->generateAssociationMappingPropertyDocBlock($associationMapping, $metadata);
1306
-            $lines[] = $this->spaces . $this->fieldVisibility . ' $' . $associationMapping['fieldName']
1307
-                     . ($associationMapping['type'] == 'manyToMany' ? ' = array()' : null) . ";\n";
1306
+            $lines[] = $this->spaces.$this->fieldVisibility.' $'.$associationMapping['fieldName']
1307
+                     . ($associationMapping['type'] == 'manyToMany' ? ' = array()' : null).";\n";
1308 1308
         }
1309 1309
 
1310 1310
         return implode("\n", $lines);
@@ -1328,8 +1328,8 @@  discard block
 block discarded – undo
1328 1328
             }
1329 1329
 
1330 1330
             $lines[] = $this->generateFieldMappingPropertyDocBlock($fieldMapping, $metadata);
1331
-            $lines[] = $this->spaces . $this->fieldVisibility . ' $' . $fieldMapping['fieldName']
1332
-                     . (isset($fieldMapping['options']['default']) ? ' = ' . var_export($fieldMapping['options']['default'], true) : null) . ";\n";
1331
+            $lines[] = $this->spaces.$this->fieldVisibility.' $'.$fieldMapping['fieldName']
1332
+                     . (isset($fieldMapping['options']['default']) ? ' = '.var_export($fieldMapping['options']['default'], true) : null).";\n";
1333 1333
         }
1334 1334
 
1335 1335
         return implode("\n", $lines);
@@ -1350,7 +1350,7 @@  discard block
 block discarded – undo
1350 1350
             }
1351 1351
 
1352 1352
             $lines[] = $this->generateEmbeddedPropertyDocBlock($embeddedClass);
1353
-            $lines[] = $this->spaces . $this->fieldVisibility . ' $' . $fieldName . ";\n";
1353
+            $lines[] = $this->spaces.$this->fieldVisibility.' $'.$fieldName.";\n";
1354 1354
         }
1355 1355
 
1356 1356
         return implode("\n", $lines);
@@ -1367,7 +1367,7 @@  discard block
 block discarded – undo
1367 1367
      */
1368 1368
     protected function generateEntityStubMethod(ClassMetadataInfo $metadata, $type, $fieldName, $typeHint = null, $defaultValue = null)
1369 1369
     {
1370
-        $methodName = $type . Inflector::classify($fieldName);
1370
+        $methodName = $type.Inflector::classify($fieldName);
1371 1371
         $variableName = Inflector::camelize($fieldName);
1372 1372
         if (in_array($type, ["add", "remove"])) {
1373 1373
             $methodName = Inflector::singularize($methodName);
@@ -1387,18 +1387,18 @@  discard block
 block discarded – undo
1387 1387
         $variableType   = $typeHint ? $this->getType($typeHint) : null;
1388 1388
 
1389 1389
         if ($typeHint && ! isset($types[$typeHint])) {
1390
-            $variableType   =  '\\' . ltrim($variableType, '\\');
1391
-            $methodTypeHint =  '\\' . $typeHint . ' ';
1390
+            $variableType   = '\\'.ltrim($variableType, '\\');
1391
+            $methodTypeHint = '\\'.$typeHint.' ';
1392 1392
         }
1393 1393
 
1394 1394
         $replacements = [
1395
-          '<description>'       => ucfirst($type) . ' ' . $variableName . '.',
1395
+          '<description>'       => ucfirst($type).' '.$variableName.'.',
1396 1396
           '<methodTypeHint>'    => $methodTypeHint,
1397
-          '<variableType>'      => $variableType . (null !== $defaultValue ? ('|' . $defaultValue) : ''),
1397
+          '<variableType>'      => $variableType.(null !== $defaultValue ? ('|'.$defaultValue) : ''),
1398 1398
           '<variableName>'      => $variableName,
1399 1399
           '<methodName>'        => $methodName,
1400 1400
           '<fieldName>'         => $fieldName,
1401
-          '<variableDefault>'   => ($defaultValue !== null ) ? (' = ' . $defaultValue) : '',
1401
+          '<variableDefault>'   => ($defaultValue !== null) ? (' = '.$defaultValue) : '',
1402 1402
           '<entity>'            => $this->getClassName($metadata)
1403 1403
         ];
1404 1404
 
@@ -1427,7 +1427,7 @@  discard block
 block discarded – undo
1427 1427
         $this->staticReflection[$metadata->name]['methods'][] = $methodName;
1428 1428
 
1429 1429
         $replacements = [
1430
-            '<name>'        => $this->annotationsPrefix . ucfirst($name),
1430
+            '<name>'        => $this->annotationsPrefix.ucfirst($name),
1431 1431
             '<methodName>'  => $methodName,
1432 1432
         ];
1433 1433
 
@@ -1450,30 +1450,30 @@  discard block
 block discarded – undo
1450 1450
         $joinColumnAnnot = [];
1451 1451
 
1452 1452
         if (isset($joinColumn['name'])) {
1453
-            $joinColumnAnnot[] = 'name="' . $joinColumn['name'] . '"';
1453
+            $joinColumnAnnot[] = 'name="'.$joinColumn['name'].'"';
1454 1454
         }
1455 1455
 
1456 1456
         if (isset($joinColumn['referencedColumnName'])) {
1457
-            $joinColumnAnnot[] = 'referencedColumnName="' . $joinColumn['referencedColumnName'] . '"';
1457
+            $joinColumnAnnot[] = 'referencedColumnName="'.$joinColumn['referencedColumnName'].'"';
1458 1458
         }
1459 1459
 
1460 1460
         if (isset($joinColumn['unique']) && $joinColumn['unique']) {
1461
-            $joinColumnAnnot[] = 'unique=' . ($joinColumn['unique'] ? 'true' : 'false');
1461
+            $joinColumnAnnot[] = 'unique='.($joinColumn['unique'] ? 'true' : 'false');
1462 1462
         }
1463 1463
 
1464 1464
         if (isset($joinColumn['nullable'])) {
1465
-            $joinColumnAnnot[] = 'nullable=' . ($joinColumn['nullable'] ? 'true' : 'false');
1465
+            $joinColumnAnnot[] = 'nullable='.($joinColumn['nullable'] ? 'true' : 'false');
1466 1466
         }
1467 1467
 
1468 1468
         if (isset($joinColumn['onDelete'])) {
1469
-            $joinColumnAnnot[] = 'onDelete="' . ($joinColumn['onDelete'] . '"');
1469
+            $joinColumnAnnot[] = 'onDelete="'.($joinColumn['onDelete'].'"');
1470 1470
         }
1471 1471
 
1472 1472
         if (isset($joinColumn['columnDefinition'])) {
1473
-            $joinColumnAnnot[] = 'columnDefinition="' . $joinColumn['columnDefinition'] . '"';
1473
+            $joinColumnAnnot[] = 'columnDefinition="'.$joinColumn['columnDefinition'].'"';
1474 1474
         }
1475 1475
 
1476
-        return '@' . $this->annotationsPrefix . 'JoinColumn(' . implode(', ', $joinColumnAnnot) . ')';
1476
+        return '@'.$this->annotationsPrefix.'JoinColumn('.implode(', ', $joinColumnAnnot).')';
1477 1477
     }
1478 1478
 
1479 1479
     /**
@@ -1485,22 +1485,22 @@  discard block
 block discarded – undo
1485 1485
     protected function generateAssociationMappingPropertyDocBlock(array $associationMapping, ClassMetadataInfo $metadata)
1486 1486
     {
1487 1487
         $lines = [];
1488
-        $lines[] = $this->spaces . '/**';
1488
+        $lines[] = $this->spaces.'/**';
1489 1489
 
1490 1490
         if ($associationMapping['type'] & ClassMetadataInfo::TO_MANY) {
1491
-            $lines[] = $this->spaces . ' * @var \Doctrine\Common\Collections\Collection';
1491
+            $lines[] = $this->spaces.' * @var \Doctrine\Common\Collections\Collection';
1492 1492
         } else {
1493
-            $lines[] = $this->spaces . ' * @var \\' . ltrim($associationMapping['targetEntity'], '\\');
1493
+            $lines[] = $this->spaces.' * @var \\'.ltrim($associationMapping['targetEntity'], '\\');
1494 1494
         }
1495 1495
 
1496 1496
         if ($this->generateAnnotations) {
1497
-            $lines[] = $this->spaces . ' *';
1497
+            $lines[] = $this->spaces.' *';
1498 1498
 
1499 1499
             if (isset($associationMapping['id']) && $associationMapping['id']) {
1500
-                $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Id';
1500
+                $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Id';
1501 1501
 
1502 1502
                 if ($generatorType = $this->getIdGeneratorTypeString($metadata->generatorType)) {
1503
-                    $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'GeneratedValue(strategy="' . $generatorType . '")';
1503
+                    $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'GeneratedValue(strategy="'.$generatorType.'")';
1504 1504
                 }
1505 1505
             }
1506 1506
 
@@ -1522,15 +1522,15 @@  discard block
 block discarded – undo
1522 1522
             $typeOptions = [];
1523 1523
 
1524 1524
             if (isset($associationMapping['targetEntity'])) {
1525
-                $typeOptions[] = 'targetEntity="' . $associationMapping['targetEntity'] . '"';
1525
+                $typeOptions[] = 'targetEntity="'.$associationMapping['targetEntity'].'"';
1526 1526
             }
1527 1527
 
1528 1528
             if (isset($associationMapping['inversedBy'])) {
1529
-                $typeOptions[] = 'inversedBy="' . $associationMapping['inversedBy'] . '"';
1529
+                $typeOptions[] = 'inversedBy="'.$associationMapping['inversedBy'].'"';
1530 1530
             }
1531 1531
 
1532 1532
             if (isset($associationMapping['mappedBy'])) {
1533
-                $typeOptions[] = 'mappedBy="' . $associationMapping['mappedBy'] . '"';
1533
+                $typeOptions[] = 'mappedBy="'.$associationMapping['mappedBy'].'"';
1534 1534
             }
1535 1535
 
1536 1536
             if ($associationMapping['cascade']) {
@@ -1546,11 +1546,11 @@  discard block
 block discarded – undo
1546 1546
                     $cascades = ['"all"'];
1547 1547
                 }
1548 1548
 
1549
-                $typeOptions[] = 'cascade={' . implode(',', $cascades) . '}';
1549
+                $typeOptions[] = 'cascade={'.implode(',', $cascades).'}';
1550 1550
             }
1551 1551
 
1552 1552
             if (isset($associationMapping['orphanRemoval']) && $associationMapping['orphanRemoval']) {
1553
-                $typeOptions[] = 'orphanRemoval=' . ($associationMapping['orphanRemoval'] ? 'true' : 'false');
1553
+                $typeOptions[] = 'orphanRemoval='.($associationMapping['orphanRemoval'] ? 'true' : 'false');
1554 1554
             }
1555 1555
 
1556 1556
             if (isset($associationMapping['fetch']) && $associationMapping['fetch'] !== ClassMetadataInfo::FETCH_LAZY) {
@@ -1559,71 +1559,71 @@  discard block
 block discarded – undo
1559 1559
                     ClassMetadataInfo::FETCH_EAGER      => 'EAGER',
1560 1560
                 ];
1561 1561
 
1562
-                $typeOptions[] = 'fetch="' . $fetchMap[$associationMapping['fetch']] . '"';
1562
+                $typeOptions[] = 'fetch="'.$fetchMap[$associationMapping['fetch']].'"';
1563 1563
             }
1564 1564
 
1565
-            $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . '' . $type . '(' . implode(', ', $typeOptions) . ')';
1565
+            $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.''.$type.'('.implode(', ', $typeOptions).')';
1566 1566
 
1567 1567
             if (isset($associationMapping['joinColumns']) && $associationMapping['joinColumns']) {
1568
-                $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'JoinColumns({';
1568
+                $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'JoinColumns({';
1569 1569
 
1570 1570
                 $joinColumnsLines = [];
1571 1571
 
1572 1572
                 foreach ($associationMapping['joinColumns'] as $joinColumn) {
1573 1573
                     if ($joinColumnAnnot = $this->generateJoinColumnAnnotation($joinColumn)) {
1574
-                        $joinColumnsLines[] = $this->spaces . ' *   ' . $joinColumnAnnot;
1574
+                        $joinColumnsLines[] = $this->spaces.' *   '.$joinColumnAnnot;
1575 1575
                     }
1576 1576
                 }
1577 1577
 
1578 1578
                 $lines[] = implode(",\n", $joinColumnsLines);
1579
-                $lines[] = $this->spaces . ' * })';
1579
+                $lines[] = $this->spaces.' * })';
1580 1580
             }
1581 1581
 
1582 1582
             if (isset($associationMapping['joinTable']) && $associationMapping['joinTable']) {
1583 1583
                 $joinTable = [];
1584
-                $joinTable[] = 'name="' . $associationMapping['joinTable']['name'] . '"';
1584
+                $joinTable[] = 'name="'.$associationMapping['joinTable']['name'].'"';
1585 1585
 
1586 1586
                 if (isset($associationMapping['joinTable']['schema'])) {
1587
-                    $joinTable[] = 'schema="' . $associationMapping['joinTable']['schema'] . '"';
1587
+                    $joinTable[] = 'schema="'.$associationMapping['joinTable']['schema'].'"';
1588 1588
                 }
1589 1589
 
1590
-                $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'JoinTable(' . implode(', ', $joinTable) . ',';
1591
-                $lines[] = $this->spaces . ' *   joinColumns={';
1590
+                $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'JoinTable('.implode(', ', $joinTable).',';
1591
+                $lines[] = $this->spaces.' *   joinColumns={';
1592 1592
 
1593 1593
                 $joinColumnsLines = [];
1594 1594
 
1595 1595
                 foreach ($associationMapping['joinTable']['joinColumns'] as $joinColumn) {
1596
-                    $joinColumnsLines[] = $this->spaces . ' *     ' . $this->generateJoinColumnAnnotation($joinColumn);
1596
+                    $joinColumnsLines[] = $this->spaces.' *     '.$this->generateJoinColumnAnnotation($joinColumn);
1597 1597
                 }
1598 1598
 
1599
-                $lines[] = implode(",". PHP_EOL, $joinColumnsLines);
1600
-                $lines[] = $this->spaces . ' *   },';
1601
-                $lines[] = $this->spaces . ' *   inverseJoinColumns={';
1599
+                $lines[] = implode(",".PHP_EOL, $joinColumnsLines);
1600
+                $lines[] = $this->spaces.' *   },';
1601
+                $lines[] = $this->spaces.' *   inverseJoinColumns={';
1602 1602
 
1603 1603
                 $inverseJoinColumnsLines = [];
1604 1604
 
1605 1605
                 foreach ($associationMapping['joinTable']['inverseJoinColumns'] as $joinColumn) {
1606
-                    $inverseJoinColumnsLines[] = $this->spaces . ' *     ' . $this->generateJoinColumnAnnotation($joinColumn);
1606
+                    $inverseJoinColumnsLines[] = $this->spaces.' *     '.$this->generateJoinColumnAnnotation($joinColumn);
1607 1607
                 }
1608 1608
 
1609
-                $lines[] = implode(",". PHP_EOL, $inverseJoinColumnsLines);
1610
-                $lines[] = $this->spaces . ' *   }';
1611
-                $lines[] = $this->spaces . ' * )';
1609
+                $lines[] = implode(",".PHP_EOL, $inverseJoinColumnsLines);
1610
+                $lines[] = $this->spaces.' *   }';
1611
+                $lines[] = $this->spaces.' * )';
1612 1612
             }
1613 1613
 
1614 1614
             if (isset($associationMapping['orderBy'])) {
1615
-                $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'OrderBy({';
1615
+                $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'OrderBy({';
1616 1616
 
1617 1617
                 foreach ($associationMapping['orderBy'] as $name => $direction) {
1618
-                    $lines[] = $this->spaces . ' *     "' . $name . '"="' . $direction . '",';
1618
+                    $lines[] = $this->spaces.' *     "'.$name.'"="'.$direction.'",';
1619 1619
                 }
1620 1620
 
1621 1621
                 $lines[count($lines) - 1] = substr($lines[count($lines) - 1], 0, strlen($lines[count($lines) - 1]) - 1);
1622
-                $lines[] = $this->spaces . ' * })';
1622
+                $lines[] = $this->spaces.' * })';
1623 1623
             }
1624 1624
         }
1625 1625
 
1626
-        $lines[] = $this->spaces . ' */';
1626
+        $lines[] = $this->spaces.' */';
1627 1627
 
1628 1628
         return implode("\n", $lines);
1629 1629
     }
@@ -1637,43 +1637,43 @@  discard block
 block discarded – undo
1637 1637
     protected function generateFieldMappingPropertyDocBlock(array $fieldMapping, ClassMetadataInfo $metadata)
1638 1638
     {
1639 1639
         $lines = [];
1640
-        $lines[] = $this->spaces . '/**';
1641
-        $lines[] = $this->spaces . ' * @var '
1640
+        $lines[] = $this->spaces.'/**';
1641
+        $lines[] = $this->spaces.' * @var '
1642 1642
             . $this->getType($fieldMapping['type'])
1643 1643
             . ($this->nullableFieldExpression($fieldMapping) ? '|null' : '');
1644 1644
 
1645 1645
         if ($this->generateAnnotations) {
1646
-            $lines[] = $this->spaces . ' *';
1646
+            $lines[] = $this->spaces.' *';
1647 1647
 
1648 1648
             $column = [];
1649 1649
             if (isset($fieldMapping['columnName'])) {
1650
-                $column[] = 'name="' . $fieldMapping['columnName'] . '"';
1650
+                $column[] = 'name="'.$fieldMapping['columnName'].'"';
1651 1651
             }
1652 1652
 
1653 1653
             if (isset($fieldMapping['type'])) {
1654
-                $column[] = 'type="' . $fieldMapping['type'] . '"';
1654
+                $column[] = 'type="'.$fieldMapping['type'].'"';
1655 1655
             }
1656 1656
 
1657 1657
             if (isset($fieldMapping['length'])) {
1658
-                $column[] = 'length=' . $fieldMapping['length'];
1658
+                $column[] = 'length='.$fieldMapping['length'];
1659 1659
             }
1660 1660
 
1661 1661
             if (isset($fieldMapping['precision'])) {
1662
-                $column[] = 'precision=' .  $fieldMapping['precision'];
1662
+                $column[] = 'precision='.$fieldMapping['precision'];
1663 1663
             }
1664 1664
 
1665 1665
             if (isset($fieldMapping['scale'])) {
1666
-                $column[] = 'scale=' . $fieldMapping['scale'];
1666
+                $column[] = 'scale='.$fieldMapping['scale'];
1667 1667
             }
1668 1668
 
1669 1669
             if (isset($fieldMapping['nullable'])) {
1670
-                $column[] = 'nullable=' .  var_export($fieldMapping['nullable'], true);
1670
+                $column[] = 'nullable='.var_export($fieldMapping['nullable'], true);
1671 1671
             }
1672 1672
 
1673 1673
             $options = [];
1674 1674
 
1675 1675
             if (isset($fieldMapping['options']['default']) && $fieldMapping['options']['default']) {
1676
-                $options[] = '"default"="' . $fieldMapping['options']['default'] .'"';
1676
+                $options[] = '"default"="'.$fieldMapping['options']['default'].'"';
1677 1677
             }
1678 1678
 
1679 1679
             if (isset($fieldMapping['options']['unsigned']) && $fieldMapping['options']['unsigned']) {
@@ -1685,15 +1685,15 @@  discard block
 block discarded – undo
1685 1685
             }
1686 1686
 
1687 1687
             if (isset($fieldMapping['options']['comment']) && $fieldMapping['options']['comment']) {
1688
-                $options[] = '"comment"="' . str_replace('"', '""', $fieldMapping['options']['comment']) . '"';
1688
+                $options[] = '"comment"="'.str_replace('"', '""', $fieldMapping['options']['comment']).'"';
1689 1689
             }
1690 1690
 
1691 1691
             if (isset($fieldMapping['options']['collation']) && $fieldMapping['options']['collation']) {
1692
-                $options[] = '"collation"="' . $fieldMapping['options']['collation'] .'"';
1692
+                $options[] = '"collation"="'.$fieldMapping['options']['collation'].'"';
1693 1693
             }
1694 1694
 
1695 1695
             if (isset($fieldMapping['options']['check']) && $fieldMapping['options']['check']) {
1696
-                $options[] = '"check"="' . $fieldMapping['options']['check'] .'"';
1696
+                $options[] = '"check"="'.$fieldMapping['options']['check'].'"';
1697 1697
             }
1698 1698
 
1699 1699
             if ($options) {
@@ -1701,47 +1701,47 @@  discard block
 block discarded – undo
1701 1701
             }
1702 1702
 
1703 1703
             if (isset($fieldMapping['columnDefinition'])) {
1704
-                $column[] = 'columnDefinition="' . $fieldMapping['columnDefinition'] . '"';
1704
+                $column[] = 'columnDefinition="'.$fieldMapping['columnDefinition'].'"';
1705 1705
             }
1706 1706
 
1707 1707
             if (isset($fieldMapping['unique'])) {
1708
-                $column[] = 'unique=' . var_export($fieldMapping['unique'], true);
1708
+                $column[] = 'unique='.var_export($fieldMapping['unique'], true);
1709 1709
             }
1710 1710
 
1711
-            $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Column(' . implode(', ', $column) . ')';
1711
+            $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Column('.implode(', ', $column).')';
1712 1712
 
1713 1713
             if (isset($fieldMapping['id']) && $fieldMapping['id']) {
1714
-                $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Id';
1714
+                $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Id';
1715 1715
 
1716 1716
                 if ($generatorType = $this->getIdGeneratorTypeString($metadata->generatorType)) {
1717
-                    $lines[] = $this->spaces.' * @' . $this->annotationsPrefix . 'GeneratedValue(strategy="' . $generatorType . '")';
1717
+                    $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'GeneratedValue(strategy="'.$generatorType.'")';
1718 1718
                 }
1719 1719
 
1720 1720
                 if ($metadata->sequenceGeneratorDefinition) {
1721 1721
                     $sequenceGenerator = [];
1722 1722
 
1723 1723
                     if (isset($metadata->sequenceGeneratorDefinition['sequenceName'])) {
1724
-                        $sequenceGenerator[] = 'sequenceName="' . $metadata->sequenceGeneratorDefinition['sequenceName'] . '"';
1724
+                        $sequenceGenerator[] = 'sequenceName="'.$metadata->sequenceGeneratorDefinition['sequenceName'].'"';
1725 1725
                     }
1726 1726
 
1727 1727
                     if (isset($metadata->sequenceGeneratorDefinition['allocationSize'])) {
1728
-                        $sequenceGenerator[] = 'allocationSize=' . $metadata->sequenceGeneratorDefinition['allocationSize'];
1728
+                        $sequenceGenerator[] = 'allocationSize='.$metadata->sequenceGeneratorDefinition['allocationSize'];
1729 1729
                     }
1730 1730
 
1731 1731
                     if (isset($metadata->sequenceGeneratorDefinition['initialValue'])) {
1732
-                        $sequenceGenerator[] = 'initialValue=' . $metadata->sequenceGeneratorDefinition['initialValue'];
1732
+                        $sequenceGenerator[] = 'initialValue='.$metadata->sequenceGeneratorDefinition['initialValue'];
1733 1733
                     }
1734 1734
 
1735
-                    $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'SequenceGenerator(' . implode(', ', $sequenceGenerator) . ')';
1735
+                    $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'SequenceGenerator('.implode(', ', $sequenceGenerator).')';
1736 1736
                 }
1737 1737
             }
1738 1738
 
1739 1739
             if (isset($fieldMapping['version']) && $fieldMapping['version']) {
1740
-                $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Version';
1740
+                $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Version';
1741 1741
             }
1742 1742
         }
1743 1743
 
1744
-        $lines[] = $this->spaces . ' */';
1744
+        $lines[] = $this->spaces.' */';
1745 1745
 
1746 1746
         return implode("\n", $lines);
1747 1747
     }
@@ -1754,27 +1754,27 @@  discard block
 block discarded – undo
1754 1754
     protected function generateEmbeddedPropertyDocBlock(array $embeddedClass)
1755 1755
     {
1756 1756
         $lines = [];
1757
-        $lines[] = $this->spaces . '/**';
1758
-        $lines[] = $this->spaces . ' * @var \\' . ltrim($embeddedClass['class'], '\\');
1757
+        $lines[] = $this->spaces.'/**';
1758
+        $lines[] = $this->spaces.' * @var \\'.ltrim($embeddedClass['class'], '\\');
1759 1759
 
1760 1760
         if ($this->generateAnnotations) {
1761
-            $lines[] = $this->spaces . ' *';
1761
+            $lines[] = $this->spaces.' *';
1762 1762
 
1763
-            $embedded = ['class="' . $embeddedClass['class'] . '"'];
1763
+            $embedded = ['class="'.$embeddedClass['class'].'"'];
1764 1764
 
1765 1765
             if (isset($embeddedClass['columnPrefix'])) {
1766 1766
                 if (is_string($embeddedClass['columnPrefix'])) {
1767
-                    $embedded[] = 'columnPrefix="' . $embeddedClass['columnPrefix'] . '"';
1767
+                    $embedded[] = 'columnPrefix="'.$embeddedClass['columnPrefix'].'"';
1768 1768
                 } else {
1769
-                    $embedded[] = 'columnPrefix=' . var_export($embeddedClass['columnPrefix'], true);
1769
+                    $embedded[] = 'columnPrefix='.var_export($embeddedClass['columnPrefix'], true);
1770 1770
                 }
1771 1771
             }
1772 1772
 
1773
-            $lines[] = $this->spaces . ' * @' .
1774
-                $this->annotationsPrefix . 'Embedded(' . implode(', ', $embedded) . ')';
1773
+            $lines[] = $this->spaces.' * @'.
1774
+                $this->annotationsPrefix.'Embedded('.implode(', ', $embedded).')';
1775 1775
         }
1776 1776
 
1777
-        $lines[] = $this->spaces . ' */';
1777
+        $lines[] = $this->spaces.' */';
1778 1778
 
1779 1779
         return implode("\n", $lines);
1780 1780
     }
@@ -1788,13 +1788,13 @@  discard block
 block discarded – undo
1788 1788
         $processedClasses = [];
1789 1789
         foreach ($metadata->entityListeners as $event => $eventListeners) {
1790 1790
             foreach ($eventListeners as $eventListener) {
1791
-                $processedClasses[] = '"' . $eventListener['class'] . '"';
1791
+                $processedClasses[] = '"'.$eventListener['class'].'"';
1792 1792
             }
1793 1793
         }
1794 1794
 
1795 1795
         return \sprintf(
1796 1796
             '%s%s({%s})',
1797
-            '@' . $this->annotationsPrefix,
1797
+            '@'.$this->annotationsPrefix,
1798 1798
             'EntityListeners',
1799 1799
             \implode(',', \array_unique($processedClasses))
1800 1800
         );
@@ -1812,7 +1812,7 @@  discard block
 block discarded – undo
1812 1812
 
1813 1813
         foreach ($lines as $key => $value) {
1814 1814
             if ( ! empty($value)) {
1815
-                $lines[$key] = str_repeat($this->spaces, $num) . $lines[$key];
1815
+                $lines[$key] = str_repeat($this->spaces, $num).$lines[$key];
1816 1816
             }
1817 1817
         }
1818 1818
 
@@ -1894,9 +1894,9 @@  discard block
 block discarded – undo
1894 1894
 
1895 1895
         foreach ($options as $name => $option) {
1896 1896
             if (is_array($option)) {
1897
-                $optionsStr[] = '"' . $name . '"={' . $this->exportTableOptions($option) . '}';
1897
+                $optionsStr[] = '"'.$name.'"={'.$this->exportTableOptions($option).'}';
1898 1898
             } else {
1899
-                $optionsStr[] = '"' . $name . '"="' . (string) $option . '"';
1899
+                $optionsStr[] = '"'.$name.'"="'.(string) $option.'"';
1900 1900
             }
1901 1901
         }
1902 1902
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Console/Command/GenerateEntitiesCommand.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
     protected function execute(InputInterface $input, OutputInterface $output)
90 90
     {
91 91
         $ui = new SymfonyStyle($input, $output);
92
-        $ui->warning('Command ' . $this->getName() . ' is deprecated and will be removed in Doctrine ORM 3.0.');
92
+        $ui->warning('Command '.$this->getName().' is deprecated and will be removed in Doctrine ORM 3.0.');
93 93
 
94 94
         $em = $this->getHelper('em')->getEntityManager();
95 95
 
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
         $entityGenerator->setRegenerateEntityIfExists($input->getOption('regenerate-entities'));
126 126
         $entityGenerator->setUpdateEntityIfExists($input->getOption('update-entities'));
127 127
         $entityGenerator->setNumSpaces($input->getOption('num-spaces'));
128
-        $entityGenerator->setBackupExisting(!$input->getOption('no-backup'));
128
+        $entityGenerator->setBackupExisting( ! $input->getOption('no-backup'));
129 129
 
130 130
         if (($extend = $input->getOption('extend')) !== null) {
131 131
             $entityGenerator->setClassToExtend($extend);
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Console/Command/GenerateRepositoriesCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@
 block discarded – undo
61 61
     protected function execute(InputInterface $input, OutputInterface $output)
62 62
     {
63 63
         $ui = new SymfonyStyle($input, $output);
64
-        $ui->warning('Command ' . $this->getName() . ' is deprecated and will be removed in Doctrine ORM 3.0.');
64
+        $ui->warning('Command '.$this->getName().' is deprecated and will be removed in Doctrine ORM 3.0.');
65 65
 
66 66
         $em = $this->getHelper('em')->getEntityManager();
67 67
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Console/Command/ConvertDoctrine1SchemaCommand.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
     protected function execute(InputInterface $input, OutputInterface $output)
121 121
     {
122 122
         $ui = new SymfonyStyle($input, $output);
123
-        $ui->warning('Command ' . $this->getName() . ' is deprecated and will be removed in Doctrine ORM 3.0.');
123
+        $ui->warning('Command '.$this->getName().' is deprecated and will be removed in Doctrine ORM 3.0.');
124 124
 
125 125
         // Process source directories
126 126
         $fromPaths = array_merge([$input->getArgument('from-path')], $input->getOption('from'));
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
             $exporter->setMetadata($metadata);
205 205
             $exporter->export();
206 206
 
207
-            $output->writeln(PHP_EOL . sprintf(
207
+            $output->writeln(PHP_EOL.sprintf(
208 208
                 'Converting Doctrine 1.X schema to "<info>%s</info>" mapping type in "<info>%s</info>"', $toType, $destPath
209 209
             ));
210 210
         } else {
Please login to merge, or discard this patch.
lib/Doctrine/ORM/EntityManager.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -227,8 +227,8 @@  discard block
 block discarded – undo
227 227
      */
228 228
     public function transactional($func)
229 229
     {
230
-        if (!is_callable($func)) {
231
-            throw new \InvalidArgumentException('Expected argument of type "callable", got "' . gettype($func) . '"');
230
+        if ( ! is_callable($func)) {
231
+            throw new \InvalidArgumentException('Expected argument of type "callable", got "'.gettype($func).'"');
232 232
         }
233 233
 
234 234
         $this->conn->beginTransaction();
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
     {
359 359
         if ($entity !== null) {
360 360
             @trigger_error(
361
-                'Calling ' . __METHOD__ . '() with any arguments to flush specific entities is deprecated and will not be supported in Doctrine ORM 3.0.',
361
+                'Calling '.__METHOD__.'() with any arguments to flush specific entities is deprecated and will not be supported in Doctrine ORM 3.0.',
362 362
                 E_USER_DEPRECATED
363 363
             );
364 364
         }
@@ -558,7 +558,7 @@  discard block
 block discarded – undo
558 558
 
559 559
         if ($entityName !== null) {
560 560
             @trigger_error(
561
-                'Calling ' . __METHOD__ . '() with any arguments to clear specific entities is deprecated and will not be supported in Doctrine ORM 3.0.',
561
+                'Calling '.__METHOD__.'() with any arguments to clear specific entities is deprecated and will not be supported in Doctrine ORM 3.0.',
562 562
                 E_USER_DEPRECATED
563 563
             );
564 564
         }
@@ -670,7 +670,7 @@  discard block
 block discarded – undo
670 670
      */
671 671
     public function detach($entity)
672 672
     {
673
-        @trigger_error('Method ' . __METHOD__ . '() is deprecated and will be removed in Doctrine ORM 3.0.', E_USER_DEPRECATED);
673
+        @trigger_error('Method '.__METHOD__.'() is deprecated and will be removed in Doctrine ORM 3.0.', E_USER_DEPRECATED);
674 674
 
675 675
         if ( ! is_object($entity)) {
676 676
             throw ORMInvalidArgumentException::invalidObject('EntityManager#detach()', $entity);
@@ -695,7 +695,7 @@  discard block
 block discarded – undo
695 695
      */
696 696
     public function merge($entity)
697 697
     {
698
-        @trigger_error('Method ' . __METHOD__ . '() is deprecated and will be removed in Doctrine ORM 3.0.', E_USER_DEPRECATED);
698
+        @trigger_error('Method '.__METHOD__.'() is deprecated and will be removed in Doctrine ORM 3.0.', E_USER_DEPRECATED);
699 699
 
700 700
         if ( ! is_object($entity)) {
701 701
             throw ORMInvalidArgumentException::invalidObject('EntityManager#merge()', $entity);
@@ -711,7 +711,7 @@  discard block
 block discarded – undo
711 711
      */
712 712
     public function copy($entity, $deep = false)
713 713
     {
714
-        @trigger_error('Method ' . __METHOD__ . '() is deprecated and will be removed in Doctrine ORM 3.0.', E_USER_DEPRECATED);
714
+        @trigger_error('Method '.__METHOD__.'() is deprecated and will be removed in Doctrine ORM 3.0.', E_USER_DEPRECATED);
715 715
 
716 716
         throw new \BadMethodCallException("Not implemented.");
717 717
     }
@@ -785,7 +785,7 @@  discard block
 block discarded – undo
785 785
      */
786 786
     public function isOpen()
787 787
     {
788
-        return (!$this->closed);
788
+        return ( ! $this->closed);
789 789
     }
790 790
 
791 791
     /**
@@ -896,7 +896,7 @@  discard block
 block discarded – undo
896 896
                 sprintf(
897 897
                     'Invalid $connection argument of type %s given%s.',
898 898
                     is_object($connection) ? get_class($connection) : gettype($connection),
899
-                    is_object($connection) ? '' : ': "' . $connection . '"'
899
+                    is_object($connection) ? '' : ': "'.$connection.'"'
900 900
                 )
901 901
             );
902 902
         }
@@ -946,13 +946,13 @@  discard block
 block discarded – undo
946 946
     {
947 947
         switch ($lockMode) {
948 948
             case LockMode::OPTIMISTIC:
949
-                if (!$class->isVersioned) {
949
+                if ( ! $class->isVersioned) {
950 950
                     throw OptimisticLockException::notVersioned($class->name);
951 951
                 }
952 952
                 break;
953 953
             case LockMode::PESSIMISTIC_READ:
954 954
             case LockMode::PESSIMISTIC_WRITE:
955
-                if (!$this->getConnection()->isTransactionActive()) {
955
+                if ( ! $this->getConnection()->isTransactionActive()) {
956 956
                     throw TransactionRequiredException::transactionRequired();
957 957
                 }
958 958
         }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Mapping/UnderscoreNamingStrategy.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -60,9 +60,9 @@  discard block
 block discarded – undo
60 60
      */
61 61
     public function __construct($case = CASE_LOWER, bool $numberAware = false)
62 62
     {
63
-        if (! $numberAware) {
63
+        if ( ! $numberAware) {
64 64
             @trigger_error(
65
-                'Creating ' . self::class . ' without making it number aware is deprecated and will be removed in Doctrine ORM 3.0.',
65
+                'Creating '.self::class.' without making it number aware is deprecated and will be removed in Doctrine ORM 3.0.',
66 66
                 E_USER_DEPRECATED
67 67
             );
68 68
         }
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
      */
126 126
     public function referenceColumnName()
127 127
     {
128
-        return $this->case === CASE_UPPER ?  'ID' : 'id';
128
+        return $this->case === CASE_UPPER ? 'ID' : 'id';
129 129
     }
130 130
 
131 131
     /**
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
      */
134 134
     public function joinColumnName($propertyName, $className = null)
135 135
     {
136
-        return $this->underscore($propertyName) . '_' . $this->referenceColumnName();
136
+        return $this->underscore($propertyName).'_'.$this->referenceColumnName();
137 137
     }
138 138
 
139 139
     /**
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
      */
142 142
     public function joinTableName($sourceEntity, $targetEntity, $propertyName = null)
143 143
     {
144
-        return $this->classToTableName($sourceEntity) . '_' . $this->classToTableName($targetEntity);
144
+        return $this->classToTableName($sourceEntity).'_'.$this->classToTableName($targetEntity);
145 145
     }
146 146
 
147 147
     /**
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
      */
150 150
     public function joinKeyColumnName($entityName, $referencedColumnName = null)
151 151
     {
152
-        return $this->classToTableName($entityName) . '_' .
152
+        return $this->classToTableName($entityName).'_'.
153 153
                 ($referencedColumnName ?: $this->referenceColumnName());
154 154
     }
155 155
 
Please login to merge, or discard this patch.