Passed
Push — 2.7 ( 8c47dc...57496e )
by Luís
07:42
created
lib/Doctrine/ORM/Tools/EntityGenerator.php 3 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1291,7 +1291,7 @@  discard block
 block discarded – undo
1291 1291
 
1292 1292
             $lines[] = $this->generateAssociationMappingPropertyDocBlock($associationMapping, $metadata);
1293 1293
             $lines[] = $this->spaces . $this->fieldVisibility . ' $' . $associationMapping['fieldName']
1294
-                     . ($associationMapping['type'] == 'manyToMany' ? ' = array()' : null) . ";\n";
1294
+                        . ($associationMapping['type'] == 'manyToMany' ? ' = array()' : null) . ";\n";
1295 1295
         }
1296 1296
 
1297 1297
         return implode("\n", $lines);
@@ -1319,7 +1319,7 @@  discard block
 block discarded – undo
1319 1319
 
1320 1320
             $lines[] = $this->generateFieldMappingPropertyDocBlock($fieldMapping, $metadata);
1321 1321
             $lines[] = $this->spaces . $this->fieldVisibility . ' $' . $fieldMapping['fieldName']
1322
-                     . (isset($fieldMapping['options']['default']) ? ' = ' . var_export($fieldMapping['options']['default'], true) : null) . ";\n";
1322
+                        . (isset($fieldMapping['options']['default']) ? ' = ' . var_export($fieldMapping['options']['default'], true) : null) . ";\n";
1323 1323
         }
1324 1324
 
1325 1325
         return implode("\n", $lines);
@@ -1382,14 +1382,14 @@  discard block
 block discarded – undo
1382 1382
         }
1383 1383
 
1384 1384
         $replacements = [
1385
-          '<description>'       => ucfirst($type) . ' ' . $variableName . '.',
1386
-          '<methodTypeHint>'    => $methodTypeHint,
1387
-          '<variableType>'      => $variableType . (null !== $defaultValue ? ('|' . $defaultValue) : ''),
1388
-          '<variableName>'      => $variableName,
1389
-          '<methodName>'        => $methodName,
1390
-          '<fieldName>'         => $fieldName,
1391
-          '<variableDefault>'   => ($defaultValue !== null ) ? (' = ' . $defaultValue) : '',
1392
-          '<entity>'            => $this->getClassName($metadata)
1385
+            '<description>'       => ucfirst($type) . ' ' . $variableName . '.',
1386
+            '<methodTypeHint>'    => $methodTypeHint,
1387
+            '<variableType>'      => $variableType . (null !== $defaultValue ? ('|' . $defaultValue) : ''),
1388
+            '<variableName>'      => $variableName,
1389
+            '<methodName>'        => $methodName,
1390
+            '<fieldName>'         => $fieldName,
1391
+            '<variableDefault>'   => ($defaultValue !== null ) ? (' = ' . $defaultValue) : '',
1392
+            '<entity>'            => $this->getClassName($metadata)
1393 1393
         ];
1394 1394
 
1395 1395
         $method = str_replace(
Please login to merge, or discard this patch.
Braces   +15 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1525,11 +1525,21 @@
 block discarded – undo
1525 1525
             if ($associationMapping['cascade']) {
1526 1526
                 $cascades = [];
1527 1527
 
1528
-                if ($associationMapping['isCascadePersist']) $cascades[] = '"persist"';
1529
-                if ($associationMapping['isCascadeRemove']) $cascades[] = '"remove"';
1530
-                if ($associationMapping['isCascadeDetach']) $cascades[] = '"detach"';
1531
-                if ($associationMapping['isCascadeMerge']) $cascades[] = '"merge"';
1532
-                if ($associationMapping['isCascadeRefresh']) $cascades[] = '"refresh"';
1528
+                if ($associationMapping['isCascadePersist']) {
1529
+                    $cascades[] = '"persist"';
1530
+                }
1531
+                if ($associationMapping['isCascadeRemove']) {
1532
+                    $cascades[] = '"remove"';
1533
+                }
1534
+                if ($associationMapping['isCascadeDetach']) {
1535
+                    $cascades[] = '"detach"';
1536
+                }
1537
+                if ($associationMapping['isCascadeMerge']) {
1538
+                    $cascades[] = '"merge"';
1539
+                }
1540
+                if ($associationMapping['isCascadeRefresh']) {
1541
+                    $cascades[] = '"refresh"';
1542
+                }
1533 1543
 
1534 1544
                 if (count($cascades) === 5) {
1535 1545
                     $cascades = ['"all"'];
Please login to merge, or discard this 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 3.0', E_USER_DEPRECATED);
341
+        @trigger_error(self::class.' is deprecated and will be removed in Doctrine 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/Mapping/Driver/XmlDriver.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -721,13 +721,13 @@
 block discarded – undo
721 721
         return $joinColumn;
722 722
     }
723 723
 
724
-     /**
725
-     * Parses the given field as array.
726
-     *
727
-     * @param SimpleXMLElement $fieldMapping
728
-     *
729
-     * @return array
730
-     */
724
+        /**
725
+         * Parses the given field as array.
726
+         *
727
+         * @param SimpleXMLElement $fieldMapping
728
+         *
729
+         * @return array
730
+         */
731 731
     private function columnToArray(SimpleXMLElement $fieldMapping)
732 732
     {
733 733
         $mapping = [
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 
165 165
         if (isset($xmlRoot['inheritance-type'])) {
166 166
             $inheritanceType = (string) $xmlRoot['inheritance-type'];
167
-            $metadata->setInheritanceType(constant('Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_' . $inheritanceType));
167
+            $metadata->setInheritanceType(constant('Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_'.$inheritanceType));
168 168
 
169 169
             if ($metadata->inheritanceType != Metadata::INHERITANCE_TYPE_NONE) {
170 170
                 // Evaluate <discriminator-column...>
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
                 }
367 367
 
368 368
                 if (isset($oneToOneElement['fetch'])) {
369
-                    $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . (string) $oneToOneElement['fetch']);
369
+                    $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.(string) $oneToOneElement['fetch']);
370 370
                 }
371 371
 
372 372
                 if (isset($oneToOneElement['mapped-by'])) {
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
                 ];
416 416
 
417 417
                 if (isset($oneToManyElement['fetch'])) {
418
-                    $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . (string) $oneToManyElement['fetch']);
418
+                    $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.(string) $oneToManyElement['fetch']);
419 419
                 }
420 420
 
421 421
                 if (isset($oneToManyElement->cascade)) {
@@ -462,7 +462,7 @@  discard block
 block discarded – undo
462 462
                 }
463 463
 
464 464
                 if (isset($manyToOneElement['fetch'])) {
465
-                    $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . (string) $manyToOneElement['fetch']);
465
+                    $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.(string) $manyToOneElement['fetch']);
466 466
                 }
467 467
 
468 468
                 if (isset($manyToOneElement['inversed-by'])) {
@@ -504,7 +504,7 @@  discard block
 block discarded – undo
504 504
                 ];
505 505
 
506 506
                 if (isset($manyToManyElement['fetch'])) {
507
-                    $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . (string) $manyToManyElement['fetch']);
507
+                    $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.(string) $manyToManyElement['fetch']);
508 508
                 }
509 509
 
510 510
                 if (isset($manyToManyElement['orphan-removal'])) {
@@ -624,7 +624,7 @@  discard block
 block discarded – undo
624 624
 
625 625
                 // Check for `fetch`
626 626
                 if (isset($overrideElement['fetch'])) {
627
-                    $override['fetch'] = constant(Metadata::class . '::FETCH_' . (string) $overrideElement['fetch']);
627
+                    $override['fetch'] = constant(Metadata::class.'::FETCH_'.(string) $overrideElement['fetch']);
628 628
                 }
629 629
 
630 630
                 $metadata->setAssociationOverride($fieldName, $override);
@@ -634,7 +634,7 @@  discard block
 block discarded – undo
634 634
         // Evaluate <lifecycle-callbacks...>
635 635
         if (isset($xmlRoot->{'lifecycle-callbacks'})) {
636 636
             foreach ($xmlRoot->{'lifecycle-callbacks'}->{'lifecycle-callback'} as $lifecycleCallback) {
637
-                $metadata->addLifecycleCallback((string) $lifecycleCallback['method'], constant('Doctrine\ORM\Events::' . (string) $lifecycleCallback['type']));
637
+                $metadata->addLifecycleCallback((string) $lifecycleCallback['method'], constant('Doctrine\ORM\Events::'.(string) $lifecycleCallback['type']));
638 638
             }
639 639
         }
640 640
 
@@ -795,12 +795,12 @@  discard block
 block discarded – undo
795 795
         $region = isset($cacheMapping['region']) ? (string) $cacheMapping['region'] : null;
796 796
         $usage  = isset($cacheMapping['usage']) ? strtoupper($cacheMapping['usage']) : null;
797 797
 
798
-        if ($usage && ! defined('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_' . $usage)) {
798
+        if ($usage && ! defined('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_'.$usage)) {
799 799
             throw new \InvalidArgumentException(sprintf('Invalid cache usage "%s"', $usage));
800 800
         }
801 801
 
802 802
         if ($usage) {
803
-            $usage = constant('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_' . $usage);
803
+            $usage = constant('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_'.$usage);
804 804
         }
805 805
 
806 806
         return [
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Mapping/Builder/ClassMetadataBuilder.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -152,7 +152,7 @@
 block discarded – undo
152 152
      */
153 153
     public function addIndex(array $columns, $name)
154 154
     {
155
-        if (!isset($this->cm->table['indexes'])) {
155
+        if ( ! isset($this->cm->table['indexes'])) {
156 156
             $this->cm->table['indexes'] = [];
157 157
         }
158 158
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1428,7 +1428,7 @@
 block discarded – undo
1428 1428
 
1429 1429
         if (Type::hasType($mapping['type']) && Type::getType($mapping['type'])->canRequireSQLConversion()) {
1430 1430
             if (isset($mapping['id']) && true === $mapping['id']) {
1431
-                 throw MappingException::sqlConversionNotAllowedForIdentifiers($this->name, $mapping['fieldName'], $mapping['type']);
1431
+                    throw MappingException::sqlConversionNotAllowedForIdentifiers($this->name, $mapping['fieldName'], $mapping['type']);
1432 1432
             }
1433 1433
 
1434 1434
             $mapping['requireSQLConversion'] = true;
Please login to merge, or discard this patch.
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -695,7 +695,7 @@  discard block
 block discarded – undo
695 695
     public function getSingleIdReflectionProperty()
696 696
     {
697 697
         if ($this->isIdentifierComposite) {
698
-            throw new BadMethodCallException("Class " . $this->name . " has a composite identifier.");
698
+            throw new BadMethodCallException("Class ".$this->name." has a composite identifier.");
699 699
         }
700 700
 
701 701
         return $this->reflFields[$this->identifier[0]];
@@ -790,7 +790,7 @@  discard block
 block discarded – undo
790 790
      */
791 791
     public function __toString()
792 792
     {
793
-        return __CLASS__ . '@' . spl_object_hash($this);
793
+        return __CLASS__.'@'.spl_object_hash($this);
794 794
     }
795 795
 
796 796
     /**
@@ -1106,7 +1106,7 @@  discard block
 block discarded – undo
1106 1106
         }
1107 1107
 
1108 1108
         if ( ! isset($cache['region'])) {
1109
-            $cache['region'] = strtolower(str_replace('\\', '_', $this->rootEntityName)) . '__' . $fieldName;
1109
+            $cache['region'] = strtolower(str_replace('\\', '_', $this->rootEntityName)).'__'.$fieldName;
1110 1110
         }
1111 1111
 
1112 1112
         return $cache;
@@ -1386,7 +1386,7 @@  discard block
 block discarded – undo
1386 1386
     protected function _validateAndCompleteFieldMapping(array &$mapping)
1387 1387
     {
1388 1388
         // Check mandatory fields
1389
-        if ( ! isset($mapping['fieldName']) || !$mapping['fieldName']) {
1389
+        if ( ! isset($mapping['fieldName']) || ! $mapping['fieldName']) {
1390 1390
             throw MappingException::missingFieldName($this->name);
1391 1391
         }
1392 1392
 
@@ -1499,14 +1499,14 @@  discard block
 block discarded – undo
1499 1499
                 $this->isIdentifierComposite = true;
1500 1500
             }
1501 1501
 
1502
-            if ($this->cache && !isset($mapping['cache'])) {
1502
+            if ($this->cache && ! isset($mapping['cache'])) {
1503 1503
                 throw CacheException::nonCacheableEntityAssociation($this->name, $mapping['fieldName']);
1504 1504
             }
1505 1505
         }
1506 1506
 
1507 1507
         // Mandatory attributes for both sides
1508 1508
         // Mandatory: fieldName, targetEntity
1509
-        if ( ! isset($mapping['fieldName']) || !$mapping['fieldName']) {
1509
+        if ( ! isset($mapping['fieldName']) || ! $mapping['fieldName']) {
1510 1510
             throw MappingException::missingFieldName($this->name);
1511 1511
         }
1512 1512
 
@@ -1628,7 +1628,7 @@  discard block
 block discarded – undo
1628 1628
                     throw new RuntimeException("ClassMetadataInfo::setTable() has to be called before defining a one to one relationship.");
1629 1629
                 }
1630 1630
 
1631
-                $this->table['uniqueConstraints'][$mapping['fieldName'] . "_uniq"] = [
1631
+                $this->table['uniqueConstraints'][$mapping['fieldName']."_uniq"] = [
1632 1632
                     'columns' => $uniqueConstraintColumns
1633 1633
                 ];
1634 1634
             }
@@ -1643,7 +1643,7 @@  discard block
 block discarded – undo
1643 1643
             unset($mapping['unique']);
1644 1644
         }
1645 1645
 
1646
-        if (isset($mapping['id']) && $mapping['id'] === true && !$mapping['isOwningSide']) {
1646
+        if (isset($mapping['id']) && $mapping['id'] === true && ! $mapping['isOwningSide']) {
1647 1647
             throw MappingException::illegalInverseIdentifierAssociation($this->name, $mapping['fieldName']);
1648 1648
         }
1649 1649
 
@@ -1697,7 +1697,7 @@  discard block
 block discarded – undo
1697 1697
             }
1698 1698
 
1699 1699
             $selfReferencingEntityWithoutJoinColumns = $mapping['sourceEntity'] == $mapping['targetEntity']
1700
-                && (! (isset($mapping['joinTable']['joinColumns']) || isset($mapping['joinTable']['inverseJoinColumns'])));
1700
+                && ( ! (isset($mapping['joinTable']['joinColumns']) || isset($mapping['joinTable']['inverseJoinColumns'])));
1701 1701
 
1702 1702
             if ( ! isset($mapping['joinTable']['joinColumns'])) {
1703 1703
                 $mapping['joinTable']['joinColumns'] = [
@@ -1890,7 +1890,7 @@  discard block
 block discarded – undo
1890 1890
 
1891 1891
             // Association defined as Id field
1892 1892
             $joinColumns      = $this->associationMappings[$idProperty]['joinColumns'];
1893
-            $assocColumnNames = array_map(function ($joinColumn) { return $joinColumn['name']; }, $joinColumns);
1893
+            $assocColumnNames = array_map(function($joinColumn) { return $joinColumn['name']; }, $joinColumns);
1894 1894
 
1895 1895
             $columnNames = array_merge($columnNames, $assocColumnNames);
1896 1896
         }
@@ -2071,7 +2071,7 @@  discard block
 block discarded – undo
2071 2071
     public function getTemporaryIdTableName()
2072 2072
     {
2073 2073
         // replace dots with underscores because PostgreSQL creates temporary tables in a special schema
2074
-        return str_replace('.', '_', $this->getTableName() . '_id_tmp');
2074
+        return str_replace('.', '_', $this->getTableName().'_id_tmp');
2075 2075
     }
2076 2076
 
2077 2077
     /**
@@ -2408,7 +2408,7 @@  discard block
 block discarded – undo
2408 2408
      */
2409 2409
     public function addNamedQuery(array $queryMapping)
2410 2410
     {
2411
-        if (!isset($queryMapping['name'])) {
2411
+        if ( ! isset($queryMapping['name'])) {
2412 2412
             throw MappingException::nameIsMandatoryForQueryMapping($this->name);
2413 2413
         }
2414 2414
 
@@ -2416,7 +2416,7 @@  discard block
 block discarded – undo
2416 2416
             throw MappingException::duplicateQueryMapping($this->name, $queryMapping['name']);
2417 2417
         }
2418 2418
 
2419
-        if (!isset($queryMapping['query'])) {
2419
+        if ( ! isset($queryMapping['query'])) {
2420 2420
             throw MappingException::emptyQueryMapping($this->name, $queryMapping['name']);
2421 2421
         }
2422 2422
 
@@ -2443,7 +2443,7 @@  discard block
 block discarded – undo
2443 2443
      */
2444 2444
     public function addNamedNativeQuery(array $queryMapping)
2445 2445
     {
2446
-        if (!isset($queryMapping['name'])) {
2446
+        if ( ! isset($queryMapping['name'])) {
2447 2447
             throw MappingException::nameIsMandatoryForQueryMapping($this->name);
2448 2448
         }
2449 2449
 
@@ -2451,11 +2451,11 @@  discard block
 block discarded – undo
2451 2451
             throw MappingException::duplicateQueryMapping($this->name, $queryMapping['name']);
2452 2452
         }
2453 2453
 
2454
-        if (!isset($queryMapping['query'])) {
2454
+        if ( ! isset($queryMapping['query'])) {
2455 2455
             throw MappingException::emptyQueryMapping($this->name, $queryMapping['name']);
2456 2456
         }
2457 2457
 
2458
-        if (!isset($queryMapping['resultClass']) && !isset($queryMapping['resultSetMapping'])) {
2458
+        if ( ! isset($queryMapping['resultClass']) && ! isset($queryMapping['resultSetMapping'])) {
2459 2459
             throw MappingException::missingQueryMapping($this->name, $queryMapping['name']);
2460 2460
         }
2461 2461
 
@@ -2487,7 +2487,7 @@  discard block
 block discarded – undo
2487 2487
      */
2488 2488
     public function addSqlResultSetMapping(array $resultMapping)
2489 2489
     {
2490
-        if (!isset($resultMapping['name'])) {
2490
+        if ( ! isset($resultMapping['name'])) {
2491 2491
             throw MappingException::nameIsMandatoryForSqlResultSetMapping($this->name);
2492 2492
         }
2493 2493
 
@@ -2497,7 +2497,7 @@  discard block
 block discarded – undo
2497 2497
 
2498 2498
         if (isset($resultMapping['entities'])) {
2499 2499
             foreach ($resultMapping['entities'] as $key => $entityResult) {
2500
-                if (!isset($entityResult['entityClass'])) {
2500
+                if ( ! isset($entityResult['entityClass'])) {
2501 2501
                     throw MappingException::missingResultSetMappingEntity($this->name, $resultMapping['name']);
2502 2502
                 }
2503 2503
 
@@ -2516,11 +2516,11 @@  discard block
 block discarded – undo
2516 2516
 
2517 2517
                 if (isset($entityResult['fields'])) {
2518 2518
                     foreach ($entityResult['fields'] as $k => $field) {
2519
-                        if (!isset($field['name'])) {
2519
+                        if ( ! isset($field['name'])) {
2520 2520
                             throw MappingException::missingResultSetMappingFieldName($this->name, $resultMapping['name']);
2521 2521
                         }
2522 2522
 
2523
-                        if (!isset($field['column'])) {
2523
+                        if ( ! isset($field['column'])) {
2524 2524
                             $fieldName = $field['name'];
2525 2525
                             if (strpos($fieldName, '.')) {
2526 2526
                                 list(, $fieldName) = explode('.', $fieldName);
@@ -3011,7 +3011,7 @@  discard block
 block discarded – undo
3011 3011
         }
3012 3012
 
3013 3013
         if ($definition['sequenceName'][0] == '`') {
3014
-            $definition['sequenceName']   = trim($definition['sequenceName'], '`');
3014
+            $definition['sequenceName'] = trim($definition['sequenceName'], '`');
3015 3015
             $definition['quoted'] = true;
3016 3016
         }
3017 3017
 
@@ -3111,7 +3111,7 @@  discard block
 block discarded – undo
3111 3111
     public function getAssociationTargetClass($assocName)
3112 3112
     {
3113 3113
         if ( ! isset($this->associationMappings[$assocName])) {
3114
-            throw new InvalidArgumentException("Association name expected, '" . $assocName ."' is not an association.");
3114
+            throw new InvalidArgumentException("Association name expected, '".$assocName."' is not an association.");
3115 3115
         }
3116 3116
 
3117 3117
         return $this->associationMappings[$assocName]['targetEntity'];
@@ -3150,7 +3150,7 @@  discard block
 block discarded – undo
3150 3150
             // Association defined as Id field
3151 3151
             $joinColumns            = $this->associationMappings[$idProperty]['joinColumns'];
3152 3152
             $assocQuotedColumnNames = array_map(
3153
-                function ($joinColumn) use ($platform) {
3153
+                function($joinColumn) use ($platform) {
3154 3154
                     return isset($joinColumn['quoted'])
3155 3155
                         ? $platform->quoteIdentifier($joinColumn['name'])
3156 3156
                         : $joinColumn['name'];
@@ -3261,7 +3261,7 @@  discard block
 block discarded – undo
3261 3261
         }
3262 3262
 
3263 3263
         if ($className !== null && strpos($className, '\\') === false && $this->namespace) {
3264
-            return $this->namespace . '\\' . $className;
3264
+            return $this->namespace.'\\'.$className;
3265 3265
         }
3266 3266
 
3267 3267
         return $className;
@@ -3313,13 +3313,13 @@  discard block
 block discarded – undo
3313 3313
         foreach ($embeddable->fieldMappings as $fieldMapping) {
3314 3314
             $fieldMapping['originalClass'] = $fieldMapping['originalClass'] ?? $embeddable->name;
3315 3315
             $fieldMapping['declaredField'] = isset($fieldMapping['declaredField'])
3316
-                ? $property . '.' . $fieldMapping['declaredField']
3316
+                ? $property.'.'.$fieldMapping['declaredField']
3317 3317
                 : $property;
3318 3318
             $fieldMapping['originalField'] = $fieldMapping['originalField'] ?? $fieldMapping['fieldName'];
3319
-            $fieldMapping['fieldName'] = $property . "." . $fieldMapping['fieldName'];
3319
+            $fieldMapping['fieldName'] = $property.".".$fieldMapping['fieldName'];
3320 3320
 
3321
-            if (! empty($this->embeddedClasses[$property]['columnPrefix'])) {
3322
-                $fieldMapping['columnName'] = $this->embeddedClasses[$property]['columnPrefix'] . $fieldMapping['columnName'];
3321
+            if ( ! empty($this->embeddedClasses[$property]['columnPrefix'])) {
3322
+                $fieldMapping['columnName'] = $this->embeddedClasses[$property]['columnPrefix'].$fieldMapping['columnName'];
3323 3323
             } elseif ($this->embeddedClasses[$property]['columnPrefix'] !== false) {
3324 3324
                 $fieldMapping['columnName'] = $this->namingStrategy
3325 3325
                     ->embeddedFieldToColumnName(
@@ -3360,7 +3360,7 @@  discard block
 block discarded – undo
3360 3360
     {
3361 3361
         $sequencePrefix = $this->getSequencePrefix($platform);
3362 3362
         $columnName     = $this->getSingleIdentifierColumnName();
3363
-        $sequenceName   = $sequencePrefix . '_' . $columnName . '_seq';
3363
+        $sequenceName   = $sequencePrefix.'_'.$columnName.'_seq';
3364 3364
 
3365 3365
         return $sequenceName;
3366 3366
     }
@@ -3380,10 +3380,10 @@  discard block
 block discarded – undo
3380 3380
 
3381 3381
         // Prepend the schema name to the table name if there is one
3382 3382
         if ($schemaName = $this->getSchemaName()) {
3383
-            $sequencePrefix = $schemaName . '.' . $tableName;
3383
+            $sequencePrefix = $schemaName.'.'.$tableName;
3384 3384
 
3385 3385
             if ( ! $platform->supportsSchemas() && $platform->canEmulateSchemas()) {
3386
-                $sequencePrefix = $schemaName . '__' . $tableName;
3386
+                $sequencePrefix = $schemaName.'__'.$tableName;
3387 3387
             }
3388 3388
         }
3389 3389
 
@@ -3395,8 +3395,8 @@  discard block
 block discarded – undo
3395 3395
      */
3396 3396
     private function assertMappingOrderBy(array $mapping)
3397 3397
     {
3398
-        if (isset($mapping['orderBy']) && !is_array($mapping['orderBy'])) {
3399
-            throw new InvalidArgumentException("'orderBy' is expected to be an array, not " . gettype($mapping['orderBy']));
3398
+        if (isset($mapping['orderBy']) && ! is_array($mapping['orderBy'])) {
3399
+            throw new InvalidArgumentException("'orderBy' is expected to be an array, not ".gettype($mapping['orderBy']));
3400 3400
         }
3401 3401
     }
3402 3402
 }
Please login to merge, or discard this patch.
ORM/Cache/Persister/Collection/ReadOnlyCachedCollectionPersister.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,9 +30,9 @@
 block discarded – undo
30 30
  */
31 31
 class ReadOnlyCachedCollectionPersister extends NonStrictReadWriteCachedCollectionPersister
32 32
 {
33
-     /**
34
-     * {@inheritdoc}
35
-     */
33
+        /**
34
+         * {@inheritdoc}
35
+         */
36 36
     public function update(PersistentCollection $collection)
37 37
     {
38 38
         if ($collection->isDirty() && $collection->getSnapshot()) {
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Cache/Persister/Collection/AbstractCollectionPersister.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -37,9 +37,9 @@  discard block
 block discarded – undo
37 37
  */
38 38
 abstract class AbstractCollectionPersister implements CachedCollectionPersister
39 39
 {
40
-     /**
41
-     * @var \Doctrine\ORM\UnitOfWork
42
-     */
40
+        /**
41
+         * @var \Doctrine\ORM\UnitOfWork
42
+         */
43 43
     protected $uow;
44 44
 
45 45
     /**
@@ -67,9 +67,9 @@  discard block
 block discarded – undo
67 67
      */
68 68
     protected $association;
69 69
 
70
-     /**
71
-     * @var array
72
-     */
70
+        /**
71
+         * @var array
72
+         */
73 73
     protected $queuedCache = [];
74 74
 
75 75
     /**
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Cache/CacheConfiguration.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
      */
74 74
     public function getCacheLogger()
75 75
     {
76
-         return $this->cacheLogger;
76
+            return $this->cacheLogger;
77 77
     }
78 78
 
79 79
     /**
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
             );
116 116
         }
117 117
 
118
-         return $this->queryValidator;
118
+            return $this->queryValidator;
119 119
     }
120 120
 
121 121
     /**
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Configuration.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -153,7 +153,7 @@
 block discarded – undo
153 153
      */
154 154
     public function newDefaultAnnotationDriver($paths = [], $useSimpleAnnotationReader = true)
155 155
     {
156
-        AnnotationRegistry::registerFile(__DIR__ . '/Mapping/Driver/DoctrineAnnotations.php');
156
+        AnnotationRegistry::registerFile(__DIR__.'/Mapping/Driver/DoctrineAnnotations.php');
157 157
 
158 158
         if ($useSimpleAnnotationReader) {
159 159
             // Register the ORM Annotations in the AnnotationRegistry
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Persisters/Collection/ManyToManyPersister.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
         foreach ($joinColumns as $joinColumn) {
132 132
             $columnName     = $this->quoteStrategy->getJoinColumnName($joinColumn, $sourceClass, $this->platform);
133 133
             $referencedName = $joinColumn['referencedColumnName'];
134
-            $conditions[]   = 't.' . $columnName . ' = ?';
134
+            $conditions[]   = 't.'.$columnName.' = ?';
135 135
             $params[]       = $id[$sourceClass->getFieldForColumn($referencedName)];
136 136
             $types[]        = PersisterHelper::getTypeOfColumn($referencedName, $sourceClass, $this->em);
137 137
         }
@@ -160,9 +160,9 @@  discard block
 block discarded – undo
160 160
         }*/
161 161
 
162 162
         $sql = 'SELECT COUNT(*)'
163
-            . ' FROM ' . $joinTableName . ' t'
163
+            . ' FROM '.$joinTableName.' t'
164 164
             . $joinTargetEntitySQL
165
-            . ' WHERE ' . implode(' AND ', $conditions);
165
+            . ' WHERE '.implode(' AND ', $conditions);
166 166
 
167 167
         return $this->conn->fetchColumn($sql, $params, 0, $types);
168 168
     }
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 
191 191
         list($quotedJoinTable, $whereClauses, $params, $types) = $this->getJoinTableRestrictionsWithKey($collection, $key, true);
192 192
 
193
-        $sql = 'SELECT 1 FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses);
193
+        $sql = 'SELECT 1 FROM '.$quotedJoinTable.' WHERE '.implode(' AND ', $whereClauses);
194 194
 
195 195
         return (bool) $this->conn->fetchColumn($sql, $params, 0, $types);
196 196
     }
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 
207 207
         list($quotedJoinTable, $whereClauses, $params, $types) = $this->getJoinTableRestrictions($collection, $element, true);
208 208
 
209
-        $sql = 'SELECT 1 FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses);
209
+        $sql = 'SELECT 1 FROM '.$quotedJoinTable.' WHERE '.implode(' AND ', $whereClauses);
210 210
 
211 211
         return (bool) $this->conn->fetchColumn($sql, $params, 0, $types);
212 212
     }
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
 
223 223
         list($quotedJoinTable, $whereClauses, $params, $types) = $this->getJoinTableRestrictions($collection, $element, false);
224 224
 
225
-        $sql = 'DELETE FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses);
225
+        $sql = 'DELETE FROM '.$quotedJoinTable.' WHERE '.implode(' AND ', $whereClauses);
226 226
 
227 227
         return (bool) $this->conn->executeUpdate($sql, $params, $types);
228 228
     }
@@ -271,11 +271,11 @@  discard block
 block discarded – undo
271 271
         $rsm = new Query\ResultSetMappingBuilder($this->em);
272 272
         $rsm->addRootEntityFromClassMetadata($targetClass->name, 'te');
273 273
 
274
-        $sql = 'SELECT ' . $rsm->generateSelectClause()
275
-            . ' FROM ' . $tableName . ' te'
276
-            . ' JOIN ' . $joinTable  . ' t ON'
274
+        $sql = 'SELECT '.$rsm->generateSelectClause()
275
+            . ' FROM '.$tableName.' te'
276
+            . ' JOIN '.$joinTable.' t ON'
277 277
             . implode(' AND ', $onConditions)
278
-            . ' WHERE ' . implode(' AND ', $whereClauses);
278
+            . ' WHERE '.implode(' AND ', $whereClauses);
279 279
 
280 280
         $sql .= $this->getOrderingSql($criteria, $targetClass);
281 281
 
@@ -316,8 +316,8 @@  discard block
 block discarded – undo
316 316
 
317 317
         // A join is needed if there is filtering on the target entity
318 318
         $tableName = $this->quoteStrategy->getTableName($rootClass, $this->platform);
319
-        $joinSql   = ' JOIN ' . $tableName . ' te'
320
-            . ' ON' . implode(' AND ', $this->getOnConditionSQL($mapping));
319
+        $joinSql   = ' JOIN '.$tableName.' te'
320
+            . ' ON'.implode(' AND ', $this->getOnConditionSQL($mapping));
321 321
 
322 322
         return [$joinSql, $filterSql];
323 323
     }
@@ -336,12 +336,12 @@  discard block
 block discarded – undo
336 336
 
337 337
         foreach ($this->em->getFilters()->getEnabledFilters() as $filter) {
338 338
             if ($filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias)) {
339
-                $filterClauses[] = '(' . $filterExpr . ')';
339
+                $filterClauses[] = '('.$filterExpr.')';
340 340
             }
341 341
         }
342 342
 
343 343
         return $filterClauses
344
-            ? '(' . implode(' AND ', $filterClauses) . ')'
344
+            ? '('.implode(' AND ', $filterClauses).')'
345 345
             : '';
346 346
     }
347 347
 
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
             $joinColumnName = $this->quoteStrategy->getJoinColumnName($joinColumn, $targetClass, $this->platform);
370 370
             $refColumnName  = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $targetClass, $this->platform);
371 371
 
372
-            $conditions[] = ' t.' . $joinColumnName . ' = ' . 'te.' . $refColumnName;
372
+            $conditions[] = ' t.'.$joinColumnName.' = '.'te.'.$refColumnName;
373 373
         }
374 374
 
375 375
         return $conditions;
@@ -391,8 +391,8 @@  discard block
 block discarded – undo
391 391
             $columns[] = $this->quoteStrategy->getJoinColumnName($joinColumn, $class, $this->platform);
392 392
         }
393 393
 
394
-        return 'DELETE FROM ' . $joinTable
395
-            . ' WHERE ' . implode(' = ? AND ', $columns) . ' = ?';
394
+        return 'DELETE FROM '.$joinTable
395
+            . ' WHERE '.implode(' = ? AND ', $columns).' = ?';
396 396
     }
397 397
 
398 398
     /**
@@ -451,8 +451,8 @@  discard block
 block discarded – undo
451 451
         }
452 452
 
453 453
         return [
454
-            'DELETE FROM ' . $this->quoteStrategy->getJoinTableName($mapping, $class, $this->platform)
455
-            . ' WHERE ' . implode(' = ? AND ', $columns) . ' = ?',
454
+            'DELETE FROM '.$this->quoteStrategy->getJoinTableName($mapping, $class, $this->platform)
455
+            . ' WHERE '.implode(' = ? AND ', $columns).' = ?',
456 456
             $types,
457 457
         ];
458 458
     }
@@ -500,10 +500,10 @@  discard block
 block discarded – undo
500 500
         }
501 501
 
502 502
         return [
503
-            'INSERT INTO ' . $this->quoteStrategy->getJoinTableName($mapping, $class, $this->platform)
504
-            . ' (' . implode(', ', $columns) . ')'
503
+            'INSERT INTO '.$this->quoteStrategy->getJoinTableName($mapping, $class, $this->platform)
504
+            . ' ('.implode(', ', $columns).')'
505 505
             . ' VALUES'
506
-            . ' (' . implode(', ', array_fill(0, count($columns), '?')) . ')',
506
+            . ' ('.implode(', ', array_fill(0, count($columns), '?')).')',
507 507
             $types,
508 508
         ];
509 509
     }
@@ -588,7 +588,7 @@  discard block
 block discarded – undo
588 588
         $sourceClass   = $this->em->getClassMetadata($mapping['sourceEntity']);
589 589
         $targetClass   = $this->em->getClassMetadata($mapping['targetEntity']);
590 590
 
591
-        if (! $mapping['isOwningSide']) {
591
+        if ( ! $mapping['isOwningSide']) {
592 592
             $associationSourceClass = $this->em->getClassMetadata($mapping['targetEntity']);
593 593
             $mapping                = $associationSourceClass->associationMappings[$mapping['mappedBy']];
594 594
             $joinColumns            = $mapping['joinTable']['joinColumns'];
@@ -601,7 +601,7 @@  discard block
 block discarded – undo
601 601
             $targetRelationMode     = 'relationToTargetKeyColumns';
602 602
         }
603 603
 
604
-        $quotedJoinTable = $this->quoteStrategy->getJoinTableName($mapping, $associationSourceClass, $this->platform). ' t';
604
+        $quotedJoinTable = $this->quoteStrategy->getJoinTableName($mapping, $associationSourceClass, $this->platform).' t';
605 605
         $whereClauses    = [];
606 606
         $params          = [];
607 607
         $types           = [];
@@ -612,14 +612,14 @@  discard block
 block discarded – undo
612 612
             $joinConditions = [];
613 613
 
614 614
             foreach ($joinColumns as $joinTableColumn) {
615
-                $joinConditions[] = 't.' . $joinTableColumn['name'] . ' = tr.' . $joinTableColumn['referencedColumnName'];
615
+                $joinConditions[] = 't.'.$joinTableColumn['name'].' = tr.'.$joinTableColumn['referencedColumnName'];
616 616
             }
617 617
 
618 618
             $tableName        = $this->quoteStrategy->getTableName($targetClass, $this->platform);
619
-            $quotedJoinTable .= ' JOIN ' . $tableName . ' tr ON ' . implode(' AND ', $joinConditions);
619
+            $quotedJoinTable .= ' JOIN '.$tableName.' tr ON '.implode(' AND ', $joinConditions);
620 620
             $columnName       = $targetClass->getColumnName($indexBy);
621 621
 
622
-            $whereClauses[] = 'tr.' . $columnName . ' = ?';
622
+            $whereClauses[] = 'tr.'.$columnName.' = ?';
623 623
             $params[]       = $key;
624 624
             $types[]        = PersisterHelper::getTypeOfColumn($columnName, $targetClass, $this->em);
625 625
         }
@@ -627,7 +627,7 @@  discard block
 block discarded – undo
627 627
         foreach ($mapping['joinTableColumns'] as $joinTableColumn) {
628 628
             if (isset($mapping[$sourceRelationMode][$joinTableColumn])) {
629 629
                 $column         = $mapping[$sourceRelationMode][$joinTableColumn];
630
-                $whereClauses[] = 't.' . $joinTableColumn . ' = ?';
630
+                $whereClauses[] = 't.'.$joinTableColumn.' = ?';
631 631
                 $params[]       = $sourceClass->containsForeignIdentifier
632 632
                     ? $id[$sourceClass->getFieldForColumn($column)]
633 633
                     : $id[$sourceClass->fieldNames[$column]];
@@ -635,7 +635,7 @@  discard block
 block discarded – undo
635 635
             } elseif ( ! $joinNeeded) {
636 636
                 $column = $mapping[$targetRelationMode][$joinTableColumn];
637 637
 
638
-                $whereClauses[] = 't.' . $joinTableColumn . ' = ?';
638
+                $whereClauses[] = 't.'.$joinTableColumn.' = ?';
639 639
                 $params[]       = $key;
640 640
                 $types[]        = PersisterHelper::getTypeOfColumn($column, $targetClass, $this->em);
641 641
             }
@@ -645,7 +645,7 @@  discard block
 block discarded – undo
645 645
             list($joinTargetEntitySQL, $filterSql) = $this->getFilterSql($filterMapping);
646 646
 
647 647
             if ($filterSql) {
648
-                $quotedJoinTable .= ' ' . $joinTargetEntitySQL;
648
+                $quotedJoinTable .= ' '.$joinTargetEntitySQL;
649 649
                 $whereClauses[] = $filterSql;
650 650
             }
651 651
         }
@@ -689,7 +689,7 @@  discard block
 block discarded – undo
689 689
         $types           = [];
690 690
 
691 691
         foreach ($mapping['joinTableColumns'] as $joinTableColumn) {
692
-            $whereClauses[] = ($addFilters ? 't.' : '') . $joinTableColumn . ' = ?';
692
+            $whereClauses[] = ($addFilters ? 't.' : '').$joinTableColumn.' = ?';
693 693
 
694 694
             if (isset($mapping['relationToTargetKeyColumns'][$joinTableColumn])) {
695 695
                 $targetColumn = $mapping['relationToTargetKeyColumns'][$joinTableColumn];
@@ -711,7 +711,7 @@  discard block
 block discarded – undo
711 711
             list($joinTargetEntitySQL, $filterSql) = $this->getFilterSql($filterMapping);
712 712
 
713 713
             if ($filterSql) {
714
-                $quotedJoinTable .= ' ' . $joinTargetEntitySQL;
714
+                $quotedJoinTable .= ' '.$joinTargetEntitySQL;
715 715
                 $whereClauses[] = $filterSql;
716 716
             }
717 717
         }
@@ -760,10 +760,10 @@  discard block
 block discarded – undo
760 760
                     $targetClass,
761 761
                     $this->platform
762 762
                 );
763
-                $orderBy[] = $field . ' ' . $direction;
763
+                $orderBy[] = $field.' '.$direction;
764 764
             }
765 765
 
766
-            return ' ORDER BY ' . implode(', ', $orderBy);
766
+            return ' ORDER BY '.implode(', ', $orderBy);
767 767
         }
768 768
         return '';
769 769
     }
Please login to merge, or discard this patch.