Failed Conditions
Pull Request — master (#6593)
by Thomas
58:10 queued 48:01
created
Tests/ORM/Tools/Export/php/Doctrine.Tests.ORM.Tools.Export.User.php 1 patch
Indentation   +72 added lines, -72 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@  discard block
 block discarded – undo
10 10
 $metadata->setInheritanceType(ClassMetadataInfo::INHERITANCE_TYPE_NONE);
11 11
 $metadata->setPrimaryTable(
12 12
     [
13
-   'name' => 'cms_users',
14
-   'options' => ['engine' => 'MyISAM', 'foo' => ['bar' => 'baz']],
13
+    'name' => 'cms_users',
14
+    'options' => ['engine' => 'MyISAM', 'foo' => ['bar' => 'baz']],
15 15
     ]
16 16
 );
17 17
 $metadata->setChangeTrackingPolicy(ClassMetadataInfo::CHANGETRACKING_DEFERRED_IMPLICIT);
@@ -20,35 +20,35 @@  discard block
 block discarded – undo
20 20
 $metadata->addLifecycleCallback('doStuffOnPostPersist', Events::postPersist);
21 21
 $metadata->mapField(
22 22
     [
23
-   'id' => true,
24
-   'fieldName' => 'id',
25
-   'type' => 'integer',
26
-   'columnName' => 'id',
23
+    'id' => true,
24
+    'fieldName' => 'id',
25
+    'type' => 'integer',
26
+    'columnName' => 'id',
27 27
     ]
28 28
 );
29 29
 $metadata->mapField(
30 30
     [
31
-   'fieldName' => 'name',
32
-   'type' => 'string',
33
-   'length' => 50,
34
-   'unique' => true,
35
-   'nullable' => true,
36
-   'columnName' => 'name',
31
+    'fieldName' => 'name',
32
+    'type' => 'string',
33
+    'length' => 50,
34
+    'unique' => true,
35
+    'nullable' => true,
36
+    'columnName' => 'name',
37 37
     ]
38 38
 );
39 39
 $metadata->mapField(
40 40
     [
41
-   'fieldName' => 'email',
42
-   'type' => 'string',
43
-   'columnName' => 'user_email',
44
-   'columnDefinition' => 'CHAR(32) NOT NULL',
41
+    'fieldName' => 'email',
42
+    'type' => 'string',
43
+    'columnName' => 'user_email',
44
+    'columnDefinition' => 'CHAR(32) NOT NULL',
45 45
     ]
46 46
 );
47 47
 $metadata->mapField(
48 48
     [
49
-   'fieldName' => 'age',
50
-   'type' => 'integer',
51
-   'options' => ["unsigned"=>true],
49
+    'fieldName' => 'age',
50
+    'type' => 'integer',
51
+    'options' => ["unsigned"=>true],
52 52
     ]
53 53
 );
54 54
 $metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_AUTO);
@@ -60,25 +60,25 @@  discard block
 block discarded – undo
60 60
 );
61 61
 $metadata->mapOneToOne(
62 62
     [
63
-   'fieldName' => 'address',
64
-   'targetEntity' => Export\Address::class,
65
-   'inversedBy' => 'user',
66
-   'cascade' =>
67
-   [
68
-   0 => 'persist',
69
-   ],
70
-   'mappedBy' => NULL,
71
-   'joinColumns' =>
72
-   [
73
-   0 =>
74
-   [
63
+    'fieldName' => 'address',
64
+    'targetEntity' => Export\Address::class,
65
+    'inversedBy' => 'user',
66
+    'cascade' =>
67
+    [
68
+    0 => 'persist',
69
+    ],
70
+    'mappedBy' => NULL,
71
+    'joinColumns' =>
72
+    [
73
+    0 =>
74
+    [
75 75
     'name' => 'address_id',
76 76
     'referencedColumnName' => 'id',
77 77
     'onDelete' => 'CASCADE',
78
-   ],
79
-   ],
80
-   'orphanRemoval' => true,
81
-   'fetch' => ClassMetadataInfo::FETCH_EAGER,
78
+    ],
79
+    ],
80
+    'orphanRemoval' => true,
81
+    'fetch' => ClassMetadataInfo::FETCH_EAGER,
82 82
     ]
83 83
 );
84 84
 $metadata->mapOneToOne(
@@ -97,41 +97,41 @@  discard block
 block discarded – undo
97 97
 );
98 98
 $metadata->mapOneToMany(
99 99
     [
100
-   'fieldName' => 'phonenumbers',
101
-   'targetEntity' => Export\Phonenumber::class,
102
-   'cascade' =>
103
-   [
104
-   1 => 'persist',
105
-   2 => 'merge',
106
-   ],
107
-   'mappedBy' => 'user',
108
-   'orphanRemoval' => true,
109
-   'fetch' => ClassMetadataInfo::FETCH_LAZY,
110
-   'orderBy' =>
111
-   [
112
-   'number' => 'ASC',
113
-   ],
100
+    'fieldName' => 'phonenumbers',
101
+    'targetEntity' => Export\Phonenumber::class,
102
+    'cascade' =>
103
+    [
104
+    1 => 'persist',
105
+    2 => 'merge',
106
+    ],
107
+    'mappedBy' => 'user',
108
+    'orphanRemoval' => true,
109
+    'fetch' => ClassMetadataInfo::FETCH_LAZY,
110
+    'orderBy' =>
111
+    [
112
+    'number' => 'ASC',
113
+    ],
114 114
     ]
115 115
 );
116 116
 $metadata->mapManyToMany(
117 117
     [
118
-   'fieldName' => 'groups',
119
-   'targetEntity' => Export\Group::class,
120
-   'fetch' => ClassMetadataInfo::FETCH_EXTRA_LAZY,
121
-   'cascade' =>
122
-   [
123
-   0 => 'remove',
124
-   1 => 'persist',
125
-   2 => 'refresh',
126
-   3 => 'merge',
127
-   4 => 'detach',
128
-   ],
129
-   'mappedBy' => NULL,
130
-   'joinTable' =>
131
-   [
132
-   'name' => 'cms_users_groups',
133
-   'joinColumns' =>
134
-   [
118
+    'fieldName' => 'groups',
119
+    'targetEntity' => Export\Group::class,
120
+    'fetch' => ClassMetadataInfo::FETCH_EXTRA_LAZY,
121
+    'cascade' =>
122
+    [
123
+    0 => 'remove',
124
+    1 => 'persist',
125
+    2 => 'refresh',
126
+    3 => 'merge',
127
+    4 => 'detach',
128
+    ],
129
+    'mappedBy' => NULL,
130
+    'joinTable' =>
131
+    [
132
+    'name' => 'cms_users_groups',
133
+    'joinColumns' =>
134
+    [
135 135
     0 =>
136 136
     [
137 137
     'name' => 'user_id',
@@ -139,18 +139,18 @@  discard block
 block discarded – undo
139 139
     'unique' => false,
140 140
     'nullable' => false,
141 141
     ],
142
-   ],
143
-   'inverseJoinColumns' =>
144
-   [
142
+    ],
143
+    'inverseJoinColumns' =>
144
+    [
145 145
     0 =>
146 146
     [
147 147
     'name' => 'group_id',
148 148
     'referencedColumnName' => 'id',
149 149
     'columnDefinition' => 'INT NULL',
150 150
     ],
151
-   ],
152
-   ],
153
-   'orderBy' => NULL,
151
+    ],
152
+    ],
153
+    'orderBy' => NULL,
154 154
     ]
155 155
 );
156 156
 $metadata->addEntityListener(Events::prePersist, UserListener::class, 'customPrePersist');
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/EntityGenerator.php 1 patch
Spacing   +143 added lines, -143 removed lines patch added patch discarded remove patch
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
      */
366 366
     public function writeEntityClass(ClassMetadataInfo $metadata, $outputDirectory)
367 367
     {
368
-        $path = $outputDirectory . '/' . str_replace('\\', DIRECTORY_SEPARATOR, $metadata->name) . $this->extension;
368
+        $path = $outputDirectory.'/'.str_replace('\\', DIRECTORY_SEPARATOR, $metadata->name).$this->extension;
369 369
         $dir = dirname($path);
370 370
 
371 371
         if ( ! is_dir($dir)) {
@@ -381,8 +381,8 @@  discard block
 block discarded – undo
381 381
         }
382 382
 
383 383
         if ($this->backupExisting && file_exists($path)) {
384
-            $backupPath = dirname($path) . DIRECTORY_SEPARATOR . basename($path) . "~";
385
-            if (!copy($path, $backupPath)) {
384
+            $backupPath = dirname($path).DIRECTORY_SEPARATOR.basename($path)."~";
385
+            if ( ! copy($path, $backupPath)) {
386 386
                 throw new \RuntimeException("Attempt to backup overwritten entity file but copy operation failed.");
387 387
             }
388 388
         }
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
         $body = str_replace('<spaces>', $this->spaces, $body);
444 444
         $last = strrpos($currentCode, '}');
445 445
 
446
-        return substr($currentCode, 0, $last) . $body . ($body ? "\n" : '') . "}\n";
446
+        return substr($currentCode, 0, $last).$body.($body ? "\n" : '')."}\n";
447 447
     }
448 448
 
449 449
     /**
@@ -507,7 +507,7 @@  discard block
 block discarded – undo
507 507
     public function setFieldVisibility($visibility)
508 508
     {
509 509
         if ($visibility !== static::FIELD_VISIBLE_PRIVATE && $visibility !== static::FIELD_VISIBLE_PROTECTED) {
510
-            throw new \InvalidArgumentException('Invalid provided visibility (only private and protected are allowed): ' . $visibility);
510
+            throw new \InvalidArgumentException('Invalid provided visibility (only private and protected are allowed): '.$visibility);
511 511
         }
512 512
 
513 513
         $this->fieldVisibility = $visibility;
@@ -605,7 +605,7 @@  discard block
 block discarded – undo
605 605
     protected function generateEntityNamespace(ClassMetadataInfo $metadata)
606 606
     {
607 607
         if ($this->hasNamespace($metadata)) {
608
-            return 'namespace ' . $this->getNamespace($metadata) .';';
608
+            return 'namespace '.$this->getNamespace($metadata).';';
609 609
         }
610 610
     }
611 611
 
@@ -625,8 +625,8 @@  discard block
 block discarded – undo
625 625
      */
626 626
     protected function generateEntityClassName(ClassMetadataInfo $metadata)
627 627
     {
628
-        return 'class ' . $this->getClassName($metadata) .
629
-            ($this->extendsClass() ? ' extends ' . $this->getClassToExtendName() : null);
628
+        return 'class '.$this->getClassName($metadata).
629
+            ($this->extendsClass() ? ' extends '.$this->getClassToExtendName() : null);
630 630
     }
631 631
 
632 632
     /**
@@ -728,13 +728,13 @@  discard block
 block discarded – undo
728 728
         $fieldMappings = array_merge($requiredFields, $optionalFields);
729 729
 
730 730
         foreach ($metadata->embeddedClasses as $fieldName => $embeddedClass) {
731
-            $paramType = '\\' . ltrim($embeddedClass['class'], '\\');
732
-            $paramVariable = '$' . $fieldName;
731
+            $paramType = '\\'.ltrim($embeddedClass['class'], '\\');
732
+            $paramVariable = '$'.$fieldName;
733 733
 
734 734
             $paramTypes[] = $paramType;
735 735
             $paramVariables[] = $paramVariable;
736
-            $params[] = $paramType . ' ' . $paramVariable;
737
-            $fields[] = '$this->' . $fieldName . ' = ' . $paramVariable . ';';
736
+            $params[] = $paramType.' '.$paramVariable;
737
+            $fields[] = '$this->'.$fieldName.' = '.$paramVariable.';';
738 738
         }
739 739
 
740 740
         foreach ($fieldMappings as $fieldMapping) {
@@ -744,27 +744,27 @@  discard block
 block discarded – undo
744 744
                 continue;
745 745
             }
746 746
 
747
-            $paramTypes[] = $this->getType($fieldMapping['type']) . (!empty($fieldMapping['nullable']) ? '|null' : '');
748
-            $param = '$' . $fieldMapping['fieldName'];
747
+            $paramTypes[] = $this->getType($fieldMapping['type']).( ! empty($fieldMapping['nullable']) ? '|null' : '');
748
+            $param = '$'.$fieldMapping['fieldName'];
749 749
             $paramVariables[] = $param;
750 750
 
751 751
             if ($fieldMapping['type'] === 'datetime') {
752
-                $param = $this->getType($fieldMapping['type']) . ' ' . $param;
752
+                $param = $this->getType($fieldMapping['type']).' '.$param;
753 753
             }
754 754
 
755
-            if (!empty($fieldMapping['nullable'])) {
755
+            if ( ! empty($fieldMapping['nullable'])) {
756 756
                 $param .= ' = null';
757 757
             }
758 758
 
759 759
             $params[] = $param;
760 760
 
761
-            $fields[] = '$this->' . $fieldMapping['fieldName'] . ' = $' . $fieldMapping['fieldName'] . ';';
761
+            $fields[] = '$this->'.$fieldMapping['fieldName'].' = $'.$fieldMapping['fieldName'].';';
762 762
         }
763 763
 
764 764
         $maxParamTypeLength = max(array_map('strlen', $paramTypes));
765 765
         $paramTags = array_map(
766
-            function ($type, $variable) use ($maxParamTypeLength) {
767
-                return '@param ' . $type . str_repeat(' ', $maxParamTypeLength - strlen($type) + 1) . $variable;
766
+            function($type, $variable) use ($maxParamTypeLength) {
767
+                return '@param '.$type.str_repeat(' ', $maxParamTypeLength - strlen($type) + 1).$variable;
768 768
             },
769 769
             $paramTypes,
770 770
             $paramVariables
@@ -772,8 +772,8 @@  discard block
 block discarded – undo
772 772
 
773 773
         // Generate multi line constructor if the signature exceeds 120 characters.
774 774
         if (array_sum(array_map('strlen', $params)) + count($params) * 2 + 29 > 120) {
775
-            $delimiter = "\n" . $this->spaces;
776
-            $params = $delimiter . implode(',' . $delimiter, $params) . "\n";
775
+            $delimiter = "\n".$this->spaces;
776
+            $params = $delimiter.implode(','.$delimiter, $params)."\n";
777 777
         } else {
778 778
             $params = implode(', ', $params);
779 779
         }
@@ -781,7 +781,7 @@  discard block
 block discarded – undo
781 781
         $replacements = [
782 782
             '<paramTags>' => implode("\n * ", $paramTags),
783 783
             '<params>'    => $params,
784
-            '<fields>'    => implode("\n" . $this->spaces, $fields),
784
+            '<fields>'    => implode("\n".$this->spaces, $fields),
785 785
         ];
786 786
 
787 787
         $constructor = str_replace(
@@ -826,7 +826,7 @@  discard block
 block discarded – undo
826 826
 
827 827
             if ($inClass) {
828 828
                 $inClass = false;
829
-                $lastSeenClass = $lastSeenNamespace . ($lastSeenNamespace ? '\\' : '') . $token[1];
829
+                $lastSeenClass = $lastSeenNamespace.($lastSeenNamespace ? '\\' : '').$token[1];
830 830
                 $this->staticReflection[$lastSeenClass]['properties'] = [];
831 831
                 $this->staticReflection[$lastSeenClass]['methods'] = [];
832 832
             }
@@ -834,16 +834,16 @@  discard block
 block discarded – undo
834 834
             if (T_NAMESPACE === $token[0]) {
835 835
                 $lastSeenNamespace = '';
836 836
                 $inNamespace = true;
837
-            } elseif (T_CLASS === $token[0] && T_DOUBLE_COLON !== $tokens[$i-1][0]) {
837
+            } elseif (T_CLASS === $token[0] && T_DOUBLE_COLON !== $tokens[$i - 1][0]) {
838 838
                 $inClass = true;
839 839
             } elseif (T_FUNCTION === $token[0]) {
840
-                if (T_STRING === $tokens[$i+2][0]) {
841
-                    $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i+2][1]);
842
-                } elseif ($tokens[$i+2] == '&' && T_STRING === $tokens[$i+3][0]) {
843
-                    $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i+3][1]);
840
+                if (T_STRING === $tokens[$i + 2][0]) {
841
+                    $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i + 2][1]);
842
+                } elseif ($tokens[$i + 2] == '&' && T_STRING === $tokens[$i + 3][0]) {
843
+                    $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i + 3][1]);
844 844
                 }
845
-            } elseif (in_array($token[0], [T_VAR, T_PUBLIC, T_PRIVATE, T_PROTECTED], true) && T_FUNCTION !== $tokens[$i+2][0]) {
846
-                $this->staticReflection[$lastSeenClass]['properties'][] = substr($tokens[$i+2][1], 1);
845
+            } elseif (in_array($token[0], [T_VAR, T_PUBLIC, T_PRIVATE, T_PROTECTED], true) && T_FUNCTION !== $tokens[$i + 2][0]) {
846
+                $this->staticReflection[$lastSeenClass]['properties'][] = substr($tokens[$i + 2][1], 1);
847 847
             }
848 848
         }
849 849
     }
@@ -856,7 +856,7 @@  discard block
 block discarded – undo
856 856
      */
857 857
     protected function hasProperty($property, ClassMetadataInfo $metadata)
858 858
     {
859
-        if ($this->extendsClass() || (!$this->isNew && class_exists($metadata->name))) {
859
+        if ($this->extendsClass() || ( ! $this->isNew && class_exists($metadata->name))) {
860 860
             // don't generate property if its already on the base class.
861 861
             $reflClass = new \ReflectionClass($this->getClassToExtend() ?: $metadata->name);
862 862
             if ($reflClass->hasProperty($property)) {
@@ -885,7 +885,7 @@  discard block
 block discarded – undo
885 885
      */
886 886
     protected function hasMethod($method, ClassMetadataInfo $metadata)
887 887
     {
888
-        if ($this->extendsClass() || (!$this->isNew && class_exists($metadata->name))) {
888
+        if ($this->extendsClass() || ( ! $this->isNew && class_exists($metadata->name))) {
889 889
             // don't generate method if its already on the base class.
890 890
             $reflClass = new \ReflectionClass($this->getClassToExtend() ?: $metadata->name);
891 891
 
@@ -914,7 +914,7 @@  discard block
 block discarded – undo
914 914
      */
915 915
     protected function getTraits(ClassMetadataInfo $metadata)
916 916
     {
917
-        if (! ($metadata->reflClass !== null || class_exists($metadata->name))) {
917
+        if ( ! ($metadata->reflClass !== null || class_exists($metadata->name))) {
918 918
             return [];
919 919
         }
920 920
 
@@ -966,7 +966,7 @@  discard block
 block discarded – undo
966 966
     {
967 967
         $refl = new \ReflectionClass($this->getClassToExtend());
968 968
 
969
-        return '\\' . $refl->getName();
969
+        return '\\'.$refl->getName();
970 970
     }
971 971
 
972 972
     /**
@@ -999,7 +999,7 @@  discard block
 block discarded – undo
999 999
     {
1000 1000
         $lines = [];
1001 1001
         $lines[] = '/**';
1002
-        $lines[] = ' * ' . $this->getClassName($metadata);
1002
+        $lines[] = ' * '.$this->getClassName($metadata);
1003 1003
 
1004 1004
         if ($this->generateAnnotations) {
1005 1005
             $lines[] = ' *';
@@ -1015,12 +1015,12 @@  discard block
 block discarded – undo
1015 1015
 
1016 1016
             foreach ($methods as $method) {
1017 1017
                 if ($code = $this->$method($metadata)) {
1018
-                    $lines[] = ' * ' . $code;
1018
+                    $lines[] = ' * '.$code;
1019 1019
                 }
1020 1020
             }
1021 1021
 
1022 1022
             if (isset($metadata->lifecycleCallbacks) && $metadata->lifecycleCallbacks) {
1023
-                $lines[] = ' * @' . $this->annotationsPrefix . 'HasLifecycleCallbacks';
1023
+                $lines[] = ' * @'.$this->annotationsPrefix.'HasLifecycleCallbacks';
1024 1024
             }
1025 1025
         }
1026 1026
 
@@ -1036,17 +1036,17 @@  discard block
 block discarded – undo
1036 1036
      */
1037 1037
     protected function generateEntityAnnotation(ClassMetadataInfo $metadata)
1038 1038
     {
1039
-        $prefix = '@' . $this->annotationsPrefix;
1039
+        $prefix = '@'.$this->annotationsPrefix;
1040 1040
 
1041 1041
         if ($metadata->isEmbeddedClass) {
1042
-            return $prefix . 'Embeddable';
1042
+            return $prefix.'Embeddable';
1043 1043
         }
1044 1044
 
1045 1045
         $customRepository = $metadata->customRepositoryClassName
1046
-            ? '(repositoryClass="' . $metadata->customRepositoryClassName . '")'
1046
+            ? '(repositoryClass="'.$metadata->customRepositoryClassName.'")'
1047 1047
             : '';
1048 1048
 
1049
-        return $prefix . ($metadata->isMappedSuperclass ? 'MappedSuperclass' : 'Entity') . $customRepository;
1049
+        return $prefix.($metadata->isMappedSuperclass ? 'MappedSuperclass' : 'Entity').$customRepository;
1050 1050
     }
1051 1051
 
1052 1052
     /**
@@ -1063,28 +1063,28 @@  discard block
 block discarded – undo
1063 1063
         $table = [];
1064 1064
 
1065 1065
         if (isset($metadata->table['schema'])) {
1066
-            $table[] = 'schema="' . $metadata->table['schema'] . '"';
1066
+            $table[] = 'schema="'.$metadata->table['schema'].'"';
1067 1067
         }
1068 1068
 
1069 1069
         if (isset($metadata->table['name'])) {
1070
-            $table[] = 'name="' . $metadata->table['name'] . '"';
1070
+            $table[] = 'name="'.$metadata->table['name'].'"';
1071 1071
         }
1072 1072
 
1073 1073
         if (isset($metadata->table['options']) && $metadata->table['options']) {
1074
-            $table[] = 'options={' . $this->exportTableOptions((array) $metadata->table['options']) . '}';
1074
+            $table[] = 'options={'.$this->exportTableOptions((array) $metadata->table['options']).'}';
1075 1075
         }
1076 1076
 
1077 1077
         if (isset($metadata->table['uniqueConstraints']) && $metadata->table['uniqueConstraints']) {
1078 1078
             $constraints = $this->generateTableConstraints('UniqueConstraint', $metadata->table['uniqueConstraints']);
1079
-            $table[] = 'uniqueConstraints={' . $constraints . '}';
1079
+            $table[] = 'uniqueConstraints={'.$constraints.'}';
1080 1080
         }
1081 1081
 
1082 1082
         if (isset($metadata->table['indexes']) && $metadata->table['indexes']) {
1083 1083
             $constraints = $this->generateTableConstraints('Index', $metadata->table['indexes']);
1084
-            $table[] = 'indexes={' . $constraints . '}';
1084
+            $table[] = 'indexes={'.$constraints.'}';
1085 1085
         }
1086 1086
 
1087
-        return '@' . $this->annotationsPrefix . 'Table(' . implode(', ', $table) . ')';
1087
+        return '@'.$this->annotationsPrefix.'Table('.implode(', ', $table).')';
1088 1088
     }
1089 1089
 
1090 1090
     /**
@@ -1099,9 +1099,9 @@  discard block
 block discarded – undo
1099 1099
         foreach ($constraints as $name => $constraint) {
1100 1100
             $columns = [];
1101 1101
             foreach ($constraint['columns'] as $column) {
1102
-                $columns[] = '"' . $column . '"';
1102
+                $columns[] = '"'.$column.'"';
1103 1103
             }
1104
-            $annotations[] = '@' . $this->annotationsPrefix . $constraintName . '(name="' . $name . '", columns={' . implode(', ', $columns) . '})';
1104
+            $annotations[] = '@'.$this->annotationsPrefix.$constraintName.'(name="'.$name.'", columns={'.implode(', ', $columns).'})';
1105 1105
         }
1106 1106
 
1107 1107
         return implode(', ', $annotations);
@@ -1115,7 +1115,7 @@  discard block
 block discarded – undo
1115 1115
     protected function generateInheritanceAnnotation(ClassMetadataInfo $metadata)
1116 1116
     {
1117 1117
         if ($metadata->inheritanceType != ClassMetadataInfo::INHERITANCE_TYPE_NONE) {
1118
-            return '@' . $this->annotationsPrefix . 'InheritanceType("'.$this->getInheritanceTypeString($metadata->inheritanceType).'")';
1118
+            return '@'.$this->annotationsPrefix.'InheritanceType("'.$this->getInheritanceTypeString($metadata->inheritanceType).'")';
1119 1119
         }
1120 1120
     }
1121 1121
 
@@ -1128,11 +1128,11 @@  discard block
 block discarded – undo
1128 1128
     {
1129 1129
         if ($metadata->inheritanceType != ClassMetadataInfo::INHERITANCE_TYPE_NONE) {
1130 1130
             $discrColumn = $metadata->discriminatorColumn;
1131
-            $columnDefinition = 'name="' . $discrColumn['name']
1132
-                . '", type="' . $discrColumn['type']
1133
-                . '", length=' . $discrColumn['length'];
1131
+            $columnDefinition = 'name="'.$discrColumn['name']
1132
+                . '", type="'.$discrColumn['type']
1133
+                . '", length='.$discrColumn['length'];
1134 1134
 
1135
-            return '@' . $this->annotationsPrefix . 'DiscriminatorColumn(' . $columnDefinition . ')';
1135
+            return '@'.$this->annotationsPrefix.'DiscriminatorColumn('.$columnDefinition.')';
1136 1136
         }
1137 1137
     }
1138 1138
 
@@ -1147,10 +1147,10 @@  discard block
 block discarded – undo
1147 1147
             $inheritanceClassMap = [];
1148 1148
 
1149 1149
             foreach ($metadata->discriminatorMap as $type => $class) {
1150
-                $inheritanceClassMap[] .= '"' . $type . '" = "' . $class . '"';
1150
+                $inheritanceClassMap[] .= '"'.$type.'" = "'.$class.'"';
1151 1151
             }
1152 1152
 
1153
-            return '@' . $this->annotationsPrefix . 'DiscriminatorMap({' . implode(', ', $inheritanceClassMap) . '})';
1153
+            return '@'.$this->annotationsPrefix.'DiscriminatorMap({'.implode(', ', $inheritanceClassMap).'})';
1154 1154
         }
1155 1155
     }
1156 1156
 
@@ -1175,7 +1175,7 @@  discard block
 block discarded – undo
1175 1175
             if (( ! isset($fieldMapping['id']) ||
1176 1176
                     ! $fieldMapping['id'] ||
1177 1177
                     $metadata->generatorType == ClassMetadataInfo::GENERATOR_TYPE_NONE
1178
-                ) && (! $metadata->isEmbeddedClass || ! $this->embeddablesImmutable)
1178
+                ) && ( ! $metadata->isEmbeddedClass || ! $this->embeddablesImmutable)
1179 1179
                 && $code = $this->generateEntityStubMethod($metadata, 'set', $fieldMapping['fieldName'], $fieldMapping['type'], $nullableField)
1180 1180
             ) {
1181 1181
                 $methods[] = $code;
@@ -1246,7 +1246,7 @@  discard block
 block discarded – undo
1246 1246
         }
1247 1247
 
1248 1248
         foreach ($joinColumns as $joinColumn) {
1249
-            if (isset($joinColumn['nullable']) && !$joinColumn['nullable']) {
1249
+            if (isset($joinColumn['nullable']) && ! $joinColumn['nullable']) {
1250 1250
                 return false;
1251 1251
             }
1252 1252
         }
@@ -1291,8 +1291,8 @@  discard block
 block discarded – undo
1291 1291
             }
1292 1292
 
1293 1293
             $lines[] = $this->generateAssociationMappingPropertyDocBlock($associationMapping, $metadata);
1294
-            $lines[] = $this->spaces . $this->fieldVisibility . ' $' . $associationMapping['fieldName']
1295
-                     . ($associationMapping['type'] == 'manyToMany' ? ' = array()' : null) . ";\n";
1294
+            $lines[] = $this->spaces.$this->fieldVisibility.' $'.$associationMapping['fieldName']
1295
+                     . ($associationMapping['type'] == 'manyToMany' ? ' = array()' : null).";\n";
1296 1296
         }
1297 1297
 
1298 1298
         return implode("\n", $lines);
@@ -1319,8 +1319,8 @@  discard block
 block discarded – undo
1319 1319
             }
1320 1320
 
1321 1321
             $lines[] = $this->generateFieldMappingPropertyDocBlock($fieldMapping, $metadata);
1322
-            $lines[] = $this->spaces . $this->fieldVisibility . ' $' . $fieldMapping['fieldName']
1323
-                     . (isset($fieldMapping['options']['default']) ? ' = ' . var_export($fieldMapping['options']['default'], true) : null) . ";\n";
1322
+            $lines[] = $this->spaces.$this->fieldVisibility.' $'.$fieldMapping['fieldName']
1323
+                     . (isset($fieldMapping['options']['default']) ? ' = '.var_export($fieldMapping['options']['default'], true) : null).";\n";
1324 1324
         }
1325 1325
 
1326 1326
         return implode("\n", $lines);
@@ -1341,7 +1341,7 @@  discard block
 block discarded – undo
1341 1341
             }
1342 1342
 
1343 1343
             $lines[] = $this->generateEmbeddedPropertyDocBlock($embeddedClass);
1344
-            $lines[] = $this->spaces . $this->fieldVisibility . ' $' . $fieldName . ";\n";
1344
+            $lines[] = $this->spaces.$this->fieldVisibility.' $'.$fieldName.";\n";
1345 1345
         }
1346 1346
 
1347 1347
         return implode("\n", $lines);
@@ -1358,7 +1358,7 @@  discard block
 block discarded – undo
1358 1358
      */
1359 1359
     protected function generateEntityStubMethod(ClassMetadataInfo $metadata, $type, $fieldName, $typeHint = null, $defaultValue = null)
1360 1360
     {
1361
-        $methodName = $type . Inflector::classify($fieldName);
1361
+        $methodName = $type.Inflector::classify($fieldName);
1362 1362
         $variableName = Inflector::camelize($fieldName);
1363 1363
         if (in_array($type, ["add", "remove"])) {
1364 1364
             $methodName = Inflector::singularize($methodName);
@@ -1378,18 +1378,18 @@  discard block
 block discarded – undo
1378 1378
         $variableType   = $typeHint ? $this->getType($typeHint) : null;
1379 1379
 
1380 1380
         if ($typeHint && ! isset($types[$typeHint])) {
1381
-            $variableType   =  '\\' . ltrim($variableType, '\\');
1382
-            $methodTypeHint =  '\\' . $typeHint . ' ';
1381
+            $variableType   = '\\'.ltrim($variableType, '\\');
1382
+            $methodTypeHint = '\\'.$typeHint.' ';
1383 1383
         }
1384 1384
 
1385 1385
         $replacements = [
1386
-          '<description>'       => ucfirst($type) . ' ' . $variableName . '.',
1386
+          '<description>'       => ucfirst($type).' '.$variableName.'.',
1387 1387
           '<methodTypeHint>'    => $methodTypeHint,
1388
-          '<variableType>'      => $variableType . (null !== $defaultValue ? ('|' . $defaultValue) : ''),
1388
+          '<variableType>'      => $variableType.(null !== $defaultValue ? ('|'.$defaultValue) : ''),
1389 1389
           '<variableName>'      => $variableName,
1390 1390
           '<methodName>'        => $methodName,
1391 1391
           '<fieldName>'         => $fieldName,
1392
-          '<variableDefault>'   => ($defaultValue !== null ) ? (' = ' . $defaultValue) : '',
1392
+          '<variableDefault>'   => ($defaultValue !== null) ? (' = '.$defaultValue) : '',
1393 1393
           '<entity>'            => $this->getClassName($metadata)
1394 1394
         ];
1395 1395
 
@@ -1417,7 +1417,7 @@  discard block
 block discarded – undo
1417 1417
         $this->staticReflection[$metadata->name]['methods'][] = $methodName;
1418 1418
 
1419 1419
         $replacements = [
1420
-            '<name>'        => $this->annotationsPrefix . ucfirst($name),
1420
+            '<name>'        => $this->annotationsPrefix.ucfirst($name),
1421 1421
             '<methodName>'  => $methodName,
1422 1422
         ];
1423 1423
 
@@ -1440,30 +1440,30 @@  discard block
 block discarded – undo
1440 1440
         $joinColumnAnnot = [];
1441 1441
 
1442 1442
         if (isset($joinColumn['name'])) {
1443
-            $joinColumnAnnot[] = 'name="' . $joinColumn['name'] . '"';
1443
+            $joinColumnAnnot[] = 'name="'.$joinColumn['name'].'"';
1444 1444
         }
1445 1445
 
1446 1446
         if (isset($joinColumn['referencedColumnName'])) {
1447
-            $joinColumnAnnot[] = 'referencedColumnName="' . $joinColumn['referencedColumnName'] . '"';
1447
+            $joinColumnAnnot[] = 'referencedColumnName="'.$joinColumn['referencedColumnName'].'"';
1448 1448
         }
1449 1449
 
1450 1450
         if (isset($joinColumn['unique']) && $joinColumn['unique']) {
1451
-            $joinColumnAnnot[] = 'unique=' . ($joinColumn['unique'] ? 'true' : 'false');
1451
+            $joinColumnAnnot[] = 'unique='.($joinColumn['unique'] ? 'true' : 'false');
1452 1452
         }
1453 1453
 
1454 1454
         if (isset($joinColumn['nullable'])) {
1455
-            $joinColumnAnnot[] = 'nullable=' . ($joinColumn['nullable'] ? 'true' : 'false');
1455
+            $joinColumnAnnot[] = 'nullable='.($joinColumn['nullable'] ? 'true' : 'false');
1456 1456
         }
1457 1457
 
1458 1458
         if (isset($joinColumn['onDelete'])) {
1459
-            $joinColumnAnnot[] = 'onDelete="' . ($joinColumn['onDelete'] . '"');
1459
+            $joinColumnAnnot[] = 'onDelete="'.($joinColumn['onDelete'].'"');
1460 1460
         }
1461 1461
 
1462 1462
         if (isset($joinColumn['columnDefinition'])) {
1463
-            $joinColumnAnnot[] = 'columnDefinition="' . $joinColumn['columnDefinition'] . '"';
1463
+            $joinColumnAnnot[] = 'columnDefinition="'.$joinColumn['columnDefinition'].'"';
1464 1464
         }
1465 1465
 
1466
-        return '@' . $this->annotationsPrefix . 'JoinColumn(' . implode(', ', $joinColumnAnnot) . ')';
1466
+        return '@'.$this->annotationsPrefix.'JoinColumn('.implode(', ', $joinColumnAnnot).')';
1467 1467
     }
1468 1468
 
1469 1469
     /**
@@ -1475,22 +1475,22 @@  discard block
 block discarded – undo
1475 1475
     protected function generateAssociationMappingPropertyDocBlock(array $associationMapping, ClassMetadataInfo $metadata)
1476 1476
     {
1477 1477
         $lines = [];
1478
-        $lines[] = $this->spaces . '/**';
1478
+        $lines[] = $this->spaces.'/**';
1479 1479
 
1480 1480
         if ($associationMapping['type'] & ClassMetadataInfo::TO_MANY) {
1481
-            $lines[] = $this->spaces . ' * @var \Doctrine\Common\Collections\Collection';
1481
+            $lines[] = $this->spaces.' * @var \Doctrine\Common\Collections\Collection';
1482 1482
         } else {
1483
-            $lines[] = $this->spaces . ' * @var \\' . ltrim($associationMapping['targetEntity'], '\\');
1483
+            $lines[] = $this->spaces.' * @var \\'.ltrim($associationMapping['targetEntity'], '\\');
1484 1484
         }
1485 1485
 
1486 1486
         if ($this->generateAnnotations) {
1487
-            $lines[] = $this->spaces . ' *';
1487
+            $lines[] = $this->spaces.' *';
1488 1488
 
1489 1489
             if (isset($associationMapping['id']) && $associationMapping['id']) {
1490
-                $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Id';
1490
+                $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Id';
1491 1491
 
1492 1492
                 if ($generatorType = $this->getIdGeneratorTypeString($metadata->generatorType)) {
1493
-                    $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'GeneratedValue(strategy="' . $generatorType . '")';
1493
+                    $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'GeneratedValue(strategy="'.$generatorType.'")';
1494 1494
                 }
1495 1495
             }
1496 1496
 
@@ -1512,15 +1512,15 @@  discard block
 block discarded – undo
1512 1512
             $typeOptions = [];
1513 1513
 
1514 1514
             if (isset($associationMapping['targetEntity'])) {
1515
-                $typeOptions[] = 'targetEntity="' . $associationMapping['targetEntity'] . '"';
1515
+                $typeOptions[] = 'targetEntity="'.$associationMapping['targetEntity'].'"';
1516 1516
             }
1517 1517
 
1518 1518
             if (isset($associationMapping['inversedBy'])) {
1519
-                $typeOptions[] = 'inversedBy="' . $associationMapping['inversedBy'] . '"';
1519
+                $typeOptions[] = 'inversedBy="'.$associationMapping['inversedBy'].'"';
1520 1520
             }
1521 1521
 
1522 1522
             if (isset($associationMapping['mappedBy'])) {
1523
-                $typeOptions[] = 'mappedBy="' . $associationMapping['mappedBy'] . '"';
1523
+                $typeOptions[] = 'mappedBy="'.$associationMapping['mappedBy'].'"';
1524 1524
             }
1525 1525
 
1526 1526
             if ($associationMapping['cascade']) {
@@ -1536,11 +1536,11 @@  discard block
 block discarded – undo
1536 1536
                     $cascades = ['"all"'];
1537 1537
                 }
1538 1538
 
1539
-                $typeOptions[] = 'cascade={' . implode(',', $cascades) . '}';
1539
+                $typeOptions[] = 'cascade={'.implode(',', $cascades).'}';
1540 1540
             }
1541 1541
 
1542 1542
             if (isset($associationMapping['orphanRemoval']) && $associationMapping['orphanRemoval']) {
1543
-                $typeOptions[] = 'orphanRemoval=' . ($associationMapping['orphanRemoval'] ? 'true' : 'false');
1543
+                $typeOptions[] = 'orphanRemoval='.($associationMapping['orphanRemoval'] ? 'true' : 'false');
1544 1544
             }
1545 1545
 
1546 1546
             if (isset($associationMapping['fetch']) && $associationMapping['fetch'] !== ClassMetadataInfo::FETCH_LAZY) {
@@ -1549,71 +1549,71 @@  discard block
 block discarded – undo
1549 1549
                     ClassMetadataInfo::FETCH_EAGER      => 'EAGER',
1550 1550
                 ];
1551 1551
 
1552
-                $typeOptions[] = 'fetch="' . $fetchMap[$associationMapping['fetch']] . '"';
1552
+                $typeOptions[] = 'fetch="'.$fetchMap[$associationMapping['fetch']].'"';
1553 1553
             }
1554 1554
 
1555
-            $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . '' . $type . '(' . implode(', ', $typeOptions) . ')';
1555
+            $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.''.$type.'('.implode(', ', $typeOptions).')';
1556 1556
 
1557 1557
             if (isset($associationMapping['joinColumns']) && $associationMapping['joinColumns']) {
1558
-                $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'JoinColumns({';
1558
+                $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'JoinColumns({';
1559 1559
 
1560 1560
                 $joinColumnsLines = [];
1561 1561
 
1562 1562
                 foreach ($associationMapping['joinColumns'] as $joinColumn) {
1563 1563
                     if ($joinColumnAnnot = $this->generateJoinColumnAnnotation($joinColumn)) {
1564
-                        $joinColumnsLines[] = $this->spaces . ' *   ' . $joinColumnAnnot;
1564
+                        $joinColumnsLines[] = $this->spaces.' *   '.$joinColumnAnnot;
1565 1565
                     }
1566 1566
                 }
1567 1567
 
1568 1568
                 $lines[] = implode(",\n", $joinColumnsLines);
1569
-                $lines[] = $this->spaces . ' * })';
1569
+                $lines[] = $this->spaces.' * })';
1570 1570
             }
1571 1571
 
1572 1572
             if (isset($associationMapping['joinTable']) && $associationMapping['joinTable']) {
1573 1573
                 $joinTable = [];
1574
-                $joinTable[] = 'name="' . $associationMapping['joinTable']['name'] . '"';
1574
+                $joinTable[] = 'name="'.$associationMapping['joinTable']['name'].'"';
1575 1575
 
1576 1576
                 if (isset($associationMapping['joinTable']['schema'])) {
1577
-                    $joinTable[] = 'schema="' . $associationMapping['joinTable']['schema'] . '"';
1577
+                    $joinTable[] = 'schema="'.$associationMapping['joinTable']['schema'].'"';
1578 1578
                 }
1579 1579
 
1580
-                $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'JoinTable(' . implode(', ', $joinTable) . ',';
1581
-                $lines[] = $this->spaces . ' *   joinColumns={';
1580
+                $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'JoinTable('.implode(', ', $joinTable).',';
1581
+                $lines[] = $this->spaces.' *   joinColumns={';
1582 1582
 
1583 1583
                 $joinColumnsLines = [];
1584 1584
 
1585 1585
                 foreach ($associationMapping['joinTable']['joinColumns'] as $joinColumn) {
1586
-                    $joinColumnsLines[] = $this->spaces . ' *     ' . $this->generateJoinColumnAnnotation($joinColumn);
1586
+                    $joinColumnsLines[] = $this->spaces.' *     '.$this->generateJoinColumnAnnotation($joinColumn);
1587 1587
                 }
1588 1588
 
1589
-                $lines[] = implode(",". PHP_EOL, $joinColumnsLines);
1590
-                $lines[] = $this->spaces . ' *   },';
1591
-                $lines[] = $this->spaces . ' *   inverseJoinColumns={';
1589
+                $lines[] = implode(",".PHP_EOL, $joinColumnsLines);
1590
+                $lines[] = $this->spaces.' *   },';
1591
+                $lines[] = $this->spaces.' *   inverseJoinColumns={';
1592 1592
 
1593 1593
                 $inverseJoinColumnsLines = [];
1594 1594
 
1595 1595
                 foreach ($associationMapping['joinTable']['inverseJoinColumns'] as $joinColumn) {
1596
-                    $inverseJoinColumnsLines[] = $this->spaces . ' *     ' . $this->generateJoinColumnAnnotation($joinColumn);
1596
+                    $inverseJoinColumnsLines[] = $this->spaces.' *     '.$this->generateJoinColumnAnnotation($joinColumn);
1597 1597
                 }
1598 1598
 
1599
-                $lines[] = implode(",". PHP_EOL, $inverseJoinColumnsLines);
1600
-                $lines[] = $this->spaces . ' *   }';
1601
-                $lines[] = $this->spaces . ' * )';
1599
+                $lines[] = implode(",".PHP_EOL, $inverseJoinColumnsLines);
1600
+                $lines[] = $this->spaces.' *   }';
1601
+                $lines[] = $this->spaces.' * )';
1602 1602
             }
1603 1603
 
1604 1604
             if (isset($associationMapping['orderBy'])) {
1605
-                $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'OrderBy({';
1605
+                $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'OrderBy({';
1606 1606
 
1607 1607
                 foreach ($associationMapping['orderBy'] as $name => $direction) {
1608
-                    $lines[] = $this->spaces . ' *     "' . $name . '"="' . $direction . '",';
1608
+                    $lines[] = $this->spaces.' *     "'.$name.'"="'.$direction.'",';
1609 1609
                 }
1610 1610
 
1611 1611
                 $lines[count($lines) - 1] = substr($lines[count($lines) - 1], 0, strlen($lines[count($lines) - 1]) - 1);
1612
-                $lines[] = $this->spaces . ' * })';
1612
+                $lines[] = $this->spaces.' * })';
1613 1613
             }
1614 1614
         }
1615 1615
 
1616
-        $lines[] = $this->spaces . ' */';
1616
+        $lines[] = $this->spaces.' */';
1617 1617
 
1618 1618
         return implode("\n", $lines);
1619 1619
     }
@@ -1627,37 +1627,37 @@  discard block
 block discarded – undo
1627 1627
     protected function generateFieldMappingPropertyDocBlock(array $fieldMapping, ClassMetadataInfo $metadata)
1628 1628
     {
1629 1629
         $lines = [];
1630
-        $lines[] = $this->spaces . '/**';
1631
-        $lines[] = $this->spaces . ' * @var '
1630
+        $lines[] = $this->spaces.'/**';
1631
+        $lines[] = $this->spaces.' * @var '
1632 1632
             . $this->getType($fieldMapping['type'])
1633 1633
             . ($this->nullableFieldExpression($fieldMapping) ? '|null' : '');
1634 1634
 
1635 1635
         if ($this->generateAnnotations) {
1636
-            $lines[] = $this->spaces . ' *';
1636
+            $lines[] = $this->spaces.' *';
1637 1637
 
1638 1638
             $column = [];
1639 1639
             if (isset($fieldMapping['columnName'])) {
1640
-                $column[] = 'name="' . $fieldMapping['columnName'] . '"';
1640
+                $column[] = 'name="'.$fieldMapping['columnName'].'"';
1641 1641
             }
1642 1642
 
1643 1643
             if (isset($fieldMapping['type'])) {
1644
-                $column[] = 'type="' . $fieldMapping['type'] . '"';
1644
+                $column[] = 'type="'.$fieldMapping['type'].'"';
1645 1645
             }
1646 1646
 
1647 1647
             if (isset($fieldMapping['length'])) {
1648
-                $column[] = 'length=' . $fieldMapping['length'];
1648
+                $column[] = 'length='.$fieldMapping['length'];
1649 1649
             }
1650 1650
 
1651 1651
             if (isset($fieldMapping['precision'])) {
1652
-                $column[] = 'precision=' .  $fieldMapping['precision'];
1652
+                $column[] = 'precision='.$fieldMapping['precision'];
1653 1653
             }
1654 1654
 
1655 1655
             if (isset($fieldMapping['scale'])) {
1656
-                $column[] = 'scale=' . $fieldMapping['scale'];
1656
+                $column[] = 'scale='.$fieldMapping['scale'];
1657 1657
             }
1658 1658
 
1659 1659
             if (isset($fieldMapping['nullable'])) {
1660
-                $column[] = 'nullable=' .  var_export($fieldMapping['nullable'], true);
1660
+                $column[] = 'nullable='.var_export($fieldMapping['nullable'], true);
1661 1661
             }
1662 1662
 
1663 1663
             $options = [];
@@ -1671,47 +1671,47 @@  discard block
 block discarded – undo
1671 1671
             }
1672 1672
 
1673 1673
             if (isset($fieldMapping['columnDefinition'])) {
1674
-                $column[] = 'columnDefinition="' . $fieldMapping['columnDefinition'] . '"';
1674
+                $column[] = 'columnDefinition="'.$fieldMapping['columnDefinition'].'"';
1675 1675
             }
1676 1676
 
1677 1677
             if (isset($fieldMapping['unique'])) {
1678
-                $column[] = 'unique=' . var_export($fieldMapping['unique'], true);
1678
+                $column[] = 'unique='.var_export($fieldMapping['unique'], true);
1679 1679
             }
1680 1680
 
1681
-            $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Column(' . implode(', ', $column) . ')';
1681
+            $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Column('.implode(', ', $column).')';
1682 1682
 
1683 1683
             if (isset($fieldMapping['id']) && $fieldMapping['id']) {
1684
-                $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Id';
1684
+                $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Id';
1685 1685
 
1686 1686
                 if ($generatorType = $this->getIdGeneratorTypeString($metadata->generatorType)) {
1687
-                    $lines[] = $this->spaces.' * @' . $this->annotationsPrefix . 'GeneratedValue(strategy="' . $generatorType . '")';
1687
+                    $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'GeneratedValue(strategy="'.$generatorType.'")';
1688 1688
                 }
1689 1689
 
1690 1690
                 if ($metadata->sequenceGeneratorDefinition) {
1691 1691
                     $sequenceGenerator = [];
1692 1692
 
1693 1693
                     if (isset($metadata->sequenceGeneratorDefinition['sequenceName'])) {
1694
-                        $sequenceGenerator[] = 'sequenceName="' . $metadata->sequenceGeneratorDefinition['sequenceName'] . '"';
1694
+                        $sequenceGenerator[] = 'sequenceName="'.$metadata->sequenceGeneratorDefinition['sequenceName'].'"';
1695 1695
                     }
1696 1696
 
1697 1697
                     if (isset($metadata->sequenceGeneratorDefinition['allocationSize'])) {
1698
-                        $sequenceGenerator[] = 'allocationSize=' . $metadata->sequenceGeneratorDefinition['allocationSize'];
1698
+                        $sequenceGenerator[] = 'allocationSize='.$metadata->sequenceGeneratorDefinition['allocationSize'];
1699 1699
                     }
1700 1700
 
1701 1701
                     if (isset($metadata->sequenceGeneratorDefinition['initialValue'])) {
1702
-                        $sequenceGenerator[] = 'initialValue=' . $metadata->sequenceGeneratorDefinition['initialValue'];
1702
+                        $sequenceGenerator[] = 'initialValue='.$metadata->sequenceGeneratorDefinition['initialValue'];
1703 1703
                     }
1704 1704
 
1705
-                    $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'SequenceGenerator(' . implode(', ', $sequenceGenerator) . ')';
1705
+                    $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'SequenceGenerator('.implode(', ', $sequenceGenerator).')';
1706 1706
                 }
1707 1707
             }
1708 1708
 
1709 1709
             if (isset($fieldMapping['version']) && $fieldMapping['version']) {
1710
-                $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Version';
1710
+                $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Version';
1711 1711
             }
1712 1712
         }
1713 1713
 
1714
-        $lines[] = $this->spaces . ' */';
1714
+        $lines[] = $this->spaces.' */';
1715 1715
 
1716 1716
         return implode("\n", $lines);
1717 1717
     }
@@ -1724,27 +1724,27 @@  discard block
 block discarded – undo
1724 1724
     protected function generateEmbeddedPropertyDocBlock(array $embeddedClass)
1725 1725
     {
1726 1726
         $lines = [];
1727
-        $lines[] = $this->spaces . '/**';
1728
-        $lines[] = $this->spaces . ' * @var \\' . ltrim($embeddedClass['class'], '\\');
1727
+        $lines[] = $this->spaces.'/**';
1728
+        $lines[] = $this->spaces.' * @var \\'.ltrim($embeddedClass['class'], '\\');
1729 1729
 
1730 1730
         if ($this->generateAnnotations) {
1731
-            $lines[] = $this->spaces . ' *';
1731
+            $lines[] = $this->spaces.' *';
1732 1732
 
1733
-            $embedded = ['class="' . $embeddedClass['class'] . '"'];
1733
+            $embedded = ['class="'.$embeddedClass['class'].'"'];
1734 1734
 
1735 1735
             if (isset($embeddedClass['columnPrefix'])) {
1736 1736
                 if (is_string($embeddedClass['columnPrefix'])) {
1737
-                    $embedded[] = 'columnPrefix="' . $embeddedClass['columnPrefix'] . '"';
1737
+                    $embedded[] = 'columnPrefix="'.$embeddedClass['columnPrefix'].'"';
1738 1738
                 } else {
1739
-                    $embedded[] = 'columnPrefix=' . var_export($embeddedClass['columnPrefix'], true);
1739
+                    $embedded[] = 'columnPrefix='.var_export($embeddedClass['columnPrefix'], true);
1740 1740
                 }
1741 1741
             }
1742 1742
 
1743
-            $lines[] = $this->spaces . ' * @' .
1744
-                $this->annotationsPrefix . 'Embedded(' . implode(', ', $embedded) . ')';
1743
+            $lines[] = $this->spaces.' * @'.
1744
+                $this->annotationsPrefix.'Embedded('.implode(', ', $embedded).')';
1745 1745
         }
1746 1746
 
1747
-        $lines[] = $this->spaces . ' */';
1747
+        $lines[] = $this->spaces.' */';
1748 1748
 
1749 1749
         return implode("\n", $lines);
1750 1750
     }
@@ -1763,13 +1763,13 @@  discard block
 block discarded – undo
1763 1763
         $processedClasses = [];
1764 1764
         foreach ($metadata->entityListeners as $event => $eventListeners) {
1765 1765
             foreach ($eventListeners as $eventListener) {
1766
-                $processedClasses[] = '"' . $eventListener['class'] . '"';
1766
+                $processedClasses[] = '"'.$eventListener['class'].'"';
1767 1767
             }
1768 1768
         }
1769 1769
 
1770 1770
         return \sprintf(
1771 1771
             '%s%s({%s})',
1772
-            '@' . $this->annotationsPrefix,
1772
+            '@'.$this->annotationsPrefix,
1773 1773
             'EntityListeners',
1774 1774
             \implode(',', \array_unique($processedClasses))
1775 1775
         );
@@ -1787,7 +1787,7 @@  discard block
 block discarded – undo
1787 1787
 
1788 1788
         foreach ($lines as $key => $value) {
1789 1789
             if ( ! empty($value)) {
1790
-                $lines[$key] = str_repeat($this->spaces, $num) . $lines[$key];
1790
+                $lines[$key] = str_repeat($this->spaces, $num).$lines[$key];
1791 1791
             }
1792 1792
         }
1793 1793
 
@@ -1869,9 +1869,9 @@  discard block
 block discarded – undo
1869 1869
 
1870 1870
         foreach ($options as $name => $option) {
1871 1871
             if (is_array($option)) {
1872
-                $optionsStr[] = '"' . $name . '"={' . $this->exportTableOptions($option) . '}';
1872
+                $optionsStr[] = '"'.$name.'"={'.$this->exportTableOptions($option).'}';
1873 1873
             } else {
1874
-                $optionsStr[] = '"' . $name . '"="' . (string) $option . '"';
1874
+                $optionsStr[] = '"'.$name.'"="'.(string) $option.'"';
1875 1875
             }
1876 1876
         }
1877 1877
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Export/Driver/PhpExporter.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -51,27 +51,27 @@  discard block
 block discarded – undo
51 51
         }
52 52
 
53 53
         if ($metadata->inheritanceType) {
54
-            $lines[] = '$metadata->setInheritanceType(ClassMetadataInfo::INHERITANCE_TYPE_' . $this->_getInheritanceTypeString($metadata->inheritanceType) . ');';
54
+            $lines[] = '$metadata->setInheritanceType(ClassMetadataInfo::INHERITANCE_TYPE_'.$this->_getInheritanceTypeString($metadata->inheritanceType).');';
55 55
         }
56 56
 
57 57
         if ($metadata->customRepositoryClassName) {
58
-            $lines[] = "\$metadata->customRepositoryClassName = '" . $metadata->customRepositoryClassName . "';";
58
+            $lines[] = "\$metadata->customRepositoryClassName = '".$metadata->customRepositoryClassName."';";
59 59
         }
60 60
 
61 61
         if ($metadata->table) {
62
-            $lines[] = '$metadata->setPrimaryTable(' . $this->_varExport($metadata->table) . ');';
62
+            $lines[] = '$metadata->setPrimaryTable('.$this->_varExport($metadata->table).');';
63 63
         }
64 64
 
65 65
         if ($metadata->discriminatorColumn) {
66
-            $lines[] = '$metadata->setDiscriminatorColumn(' . $this->_varExport($metadata->discriminatorColumn) . ');';
66
+            $lines[] = '$metadata->setDiscriminatorColumn('.$this->_varExport($metadata->discriminatorColumn).');';
67 67
         }
68 68
 
69 69
         if ($metadata->discriminatorMap) {
70
-            $lines[] = '$metadata->setDiscriminatorMap(' . $this->_varExport($metadata->discriminatorMap) . ');';
70
+            $lines[] = '$metadata->setDiscriminatorMap('.$this->_varExport($metadata->discriminatorMap).');';
71 71
         }
72 72
 
73 73
         if ($metadata->changeTrackingPolicy) {
74
-            $lines[] = '$metadata->setChangeTrackingPolicy(ClassMetadataInfo::CHANGETRACKING_' . $this->_getChangeTrackingPolicyString($metadata->changeTrackingPolicy) . ');';
74
+            $lines[] = '$metadata->setChangeTrackingPolicy(ClassMetadataInfo::CHANGETRACKING_'.$this->_getChangeTrackingPolicyString($metadata->changeTrackingPolicy).');';
75 75
         }
76 76
 
77 77
         if ($metadata->lifecycleCallbacks) {
@@ -85,11 +85,11 @@  discard block
 block discarded – undo
85 85
         $this->processEntityListeners($metadata, $lines);
86 86
 
87 87
         foreach ($metadata->fieldMappings as $fieldMapping) {
88
-            $lines[] = '$metadata->mapField(' . $this->_varExport($fieldMapping) . ');';
88
+            $lines[] = '$metadata->mapField('.$this->_varExport($fieldMapping).');';
89 89
         }
90 90
 
91 91
         if ( ! $metadata->isIdentifierComposite && $generatorType = $this->_getIdGeneratorTypeString($metadata->generatorType)) {
92
-            $lines[] = '$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_' . $generatorType . ');';
92
+            $lines[] = '$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_'.$generatorType.');';
93 93
         }
94 94
 
95 95
         foreach ($metadata->associationMappings as $associationMapping) {
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
                 $associationMappingArray = array_merge($associationMappingArray, $manyToManyMappingArray);
156 156
             }
157 157
 
158
-            $lines[] = '$metadata->' . $method . '(' . $this->_varExport($associationMappingArray) . ');';
158
+            $lines[] = '$metadata->'.$method.'('.$this->_varExport($associationMappingArray).');';
159 159
         }
160 160
 
161 161
         return implode("\n", $lines);
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
     protected function _varExport($var)
170 170
     {
171 171
         $export = var_export($var, true);
172
-        $export = str_replace("\n", PHP_EOL . str_repeat(' ', 8), $export);
172
+        $export = str_replace("\n", PHP_EOL.str_repeat(' ', 8), $export);
173 173
         $export = str_replace('  ', ' ', $export);
174 174
         $export = str_replace('array (', 'array(', $export);
175 175
         $export = str_replace('array( ', 'array(', $export);
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
     public function exportClassMetadata(ClassMetadataInfo $metadata)
43 43
     {
44 44
         $xml = new SimpleXmlElement("<?xml version=\"1.0\" encoding=\"utf-8\"?><doctrine-mapping ".
45
-            "xmlns=\"http://doctrine-project.org/schemas/orm/doctrine-mapping\" " .
45
+            "xmlns=\"http://doctrine-project.org/schemas/orm/doctrine-mapping\" ".
46 46
             "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ".
47 47
             "xsi:schemaLocation=\"http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd\" />");
48 48
 
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 
99 99
         $trackingPolicy = $this->_getChangeTrackingPolicyString($metadata->changeTrackingPolicy);
100 100
 
101
-        if ( $trackingPolicy != 'DEFERRED_IMPLICIT') {
101
+        if ($trackingPolicy != 'DEFERRED_IMPLICIT') {
102 102
             $root->addChild('change-tracking-policy', $trackingPolicy);
103 103
         }
104 104
 
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
             }
298 298
 
299 299
             if (count($cascade) === 5) {
300
-                $cascade  = ['cascade-all'];
300
+                $cascade = ['cascade-all'];
301 301
             }
302 302
 
303 303
             if ($cascade) {
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
             }
380 380
         }
381 381
 
382
-        if (isset($metadata->lifecycleCallbacks) && count($metadata->lifecycleCallbacks)>0) {
382
+        if (isset($metadata->lifecycleCallbacks) && count($metadata->lifecycleCallbacks) > 0) {
383 383
             $lifecycleCallbacksXml = $root->addChild('lifecycle-callbacks');
384 384
 
385 385
             foreach ($metadata->lifecycleCallbacks as $name => $methods) {
@@ -430,7 +430,7 @@  discard block
 block discarded – undo
430 430
     {
431 431
         $sequenceDefinition = $metadata->sequenceGeneratorDefinition;
432 432
 
433
-        if (! ($metadata->generatorType === ClassMetadataInfo::GENERATOR_TYPE_SEQUENCE && $sequenceDefinition)) {
433
+        if ( ! ($metadata->generatorType === ClassMetadataInfo::GENERATOR_TYPE_SEQUENCE && $sequenceDefinition)) {
434 434
             return;
435 435
         }
436 436
 
@@ -501,7 +501,7 @@  discard block
 block discarded – undo
501 501
      */
502 502
     private function addClassToMapIfExists(array $entityListenersXmlMap, array $entityListener, SimpleXMLElement $entityListenersXml)
503 503
     {
504
-        if (!isset($entityListenersXmlMap[$entityListener['class']])) {
504
+        if ( ! isset($entityListenersXmlMap[$entityListener['class']])) {
505 505
             $entityListenerXml = $entityListenersXml->addChild('entity-listener');
506 506
             $entityListenerXml->addAttribute('class', $entityListener['class']);
507 507
             $entityListenersXmlMap[$entityListener['class']] = $entityListenerXml;
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Export/Driver/YamlExporter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -266,7 +266,7 @@
 block discarded – undo
266 266
     private function processEntityListenerConfig($array, $entityListenerConfig, $event)
267 267
     {
268 268
         foreach ($entityListenerConfig as $entityListener) {
269
-            if (!isset($array['entityListeners'][$entityListener['class']])) {
269
+            if ( ! isset($array['entityListeners'][$entityListener['class']])) {
270 270
                 $array['entityListeners'][$entityListener['class']] = [];
271 271
             }
272 272
             $array['entityListeners'][$entityListener['class']][$event] = [$entityListener['method']];
Please login to merge, or discard this patch.