Failed Conditions
Push — develop ( a7d1bd...7cdf30 )
by Guilherme
174:02 queued 109:01
created
lib/Doctrine/ORM/Tools/Export/Driver/PhpExporter.php 3 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -298,6 +298,9 @@
 block discarded – undo
298 298
         $lines[] = '}';
299 299
     }
300 300
 
301
+    /**
302
+     * @param string $variableName
303
+     */
301 304
     private function exportJoinColumns(array $joinColumns, array &$lines, $variableName)
302 305
     {
303 306
         $lines[] = '$' . $variableName . ' = array();';
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,6 @@
 block discarded – undo
28 28
 use Doctrine\ORM\Mapping\ManyToOneAssociationMetadata;
29 29
 use Doctrine\ORM\Mapping\OneToManyAssociationMetadata;
30 30
 use Doctrine\ORM\Mapping\OneToOneAssociationMetadata;
31
-use Doctrine\ORM\Mapping\ToOneAssociationMetadata;
32 31
 
33 32
 /**
34 33
  * ClassMetadata exporter for PHP code.
Please login to merge, or discard this patch.
Spacing   +73 added lines, -73 removed lines patch added patch discarded remove patch
@@ -62,11 +62,11 @@  discard block
 block discarded – undo
62 62
         }
63 63
 
64 64
         if ($metadata->inheritanceType) {
65
-            $lines[] = '$metadata->setInheritanceType(Mapping\InheritanceType::' . $metadata->inheritanceType . ');';
65
+            $lines[] = '$metadata->setInheritanceType(Mapping\InheritanceType::'.$metadata->inheritanceType.');';
66 66
         }
67 67
 
68 68
         if ($metadata->customRepositoryClassName) {
69
-            $lines[] = '$metadata->customRepositoryClassName = "' . $metadata->customRepositoryClassName . '";';
69
+            $lines[] = '$metadata->customRepositoryClassName = "'.$metadata->customRepositoryClassName.'";';
70 70
         }
71 71
 
72 72
         if ($metadata->table) {
@@ -75,19 +75,19 @@  discard block
 block discarded – undo
75 75
             $lines[] = '$table = new Mapping\TableMetadata();';
76 76
             $lines[] = null;
77 77
 
78
-            if (! empty($table->getSchema())) {
79
-                $lines[] = '$table->setSchema("' . $table->getSchema() . '");';
78
+            if ( ! empty($table->getSchema())) {
79
+                $lines[] = '$table->setSchema("'.$table->getSchema().'");';
80 80
             }
81 81
 
82
-            $lines[] = '$table->setName("' . $table->getName() . '");';
83
-            $lines[] = '$table->setOptions(' . $this->varExport($table->getOptions()) . ');';
82
+            $lines[] = '$table->setName("'.$table->getName().'");';
83
+            $lines[] = '$table->setOptions('.$this->varExport($table->getOptions()).');';
84 84
 
85 85
             foreach ($table->getIndexes() as $index) {
86
-                $lines[] = '$table->addIndex(' . $this->varExport($index) . ');';
86
+                $lines[] = '$table->addIndex('.$this->varExport($index).');';
87 87
             }
88 88
 
89 89
             foreach ($table->getUniqueConstraints() as $constraint) {
90
-                $lines[] = '$table->addUniqueConstraint(' . $this->varExport($constraint) . ');';
90
+                $lines[] = '$table->addUniqueConstraint('.$this->varExport($constraint).');';
91 91
             }
92 92
 
93 93
             $lines[] = null;
@@ -99,51 +99,51 @@  discard block
 block discarded – undo
99 99
 
100 100
             $lines[] = '$discrColumn = new Mapping\DiscriminatorColumnMetadata();';
101 101
             $lines[] = null;
102
-            $lines[] = '$discrColumn->setColumnName("' . $discrColumn->getColumnName() . '");';
103
-            $lines[] = '$discrColumn->setType(Type::getType("' . $discrColumn->getTypeName() . '"));';
104
-            $lines[] = '$discrColumn->setTableName("' . $discrColumn->getTableName() . '");';
102
+            $lines[] = '$discrColumn->setColumnName("'.$discrColumn->getColumnName().'");';
103
+            $lines[] = '$discrColumn->setType(Type::getType("'.$discrColumn->getTypeName().'"));';
104
+            $lines[] = '$discrColumn->setTableName("'.$discrColumn->getTableName().'");';
105 105
 
106
-            if (! empty($discrColumn->getColumnDefinition())) {
107
-                $lines[] = '$property->setColumnDefinition("' . $discrColumn->getColumnDefinition() . '");';
106
+            if ( ! empty($discrColumn->getColumnDefinition())) {
107
+                $lines[] = '$property->setColumnDefinition("'.$discrColumn->getColumnDefinition().'");';
108 108
             }
109 109
 
110
-            if (! empty($discrColumn->getLength())) {
111
-                $lines[] = '$property->setLength(' . $discrColumn->getLength() . ');';
110
+            if ( ! empty($discrColumn->getLength())) {
111
+                $lines[] = '$property->setLength('.$discrColumn->getLength().');';
112 112
             }
113 113
 
114
-            if (! empty($discrColumn->getScale())) {
115
-                $lines[] = '$property->setScale(' . $discrColumn->getScale() . ');';
114
+            if ( ! empty($discrColumn->getScale())) {
115
+                $lines[] = '$property->setScale('.$discrColumn->getScale().');';
116 116
             }
117 117
 
118
-            if (! empty($discrColumn->getPrecision())) {
119
-                $lines[] = '$property->setPrecision(' . $discrColumn->getPrecision() . ');';
118
+            if ( ! empty($discrColumn->getPrecision())) {
119
+                $lines[] = '$property->setPrecision('.$discrColumn->getPrecision().');';
120 120
             }
121 121
 
122
-            $lines[] = '$discrColumn->setOptions(' . $this->varExport($discrColumn->getOptions()) . ');';
123
-            $lines[] = '$discrColumn->setNullable(' . $this->varExport($discrColumn->isNullable()) . ');';
124
-            $lines[] = '$discrColumn->setUnique(' . $this->varExport($discrColumn->isUnique()) . ');';
122
+            $lines[] = '$discrColumn->setOptions('.$this->varExport($discrColumn->getOptions()).');';
123
+            $lines[] = '$discrColumn->setNullable('.$this->varExport($discrColumn->isNullable()).');';
124
+            $lines[] = '$discrColumn->setUnique('.$this->varExport($discrColumn->isUnique()).');';
125 125
             $lines[] = null;
126 126
             $lines[] = '$metadata->setDiscriminatorColumn($discrColumn);';
127 127
         }
128 128
 
129 129
         if ($metadata->discriminatorMap) {
130
-            $lines[] = '$metadata->setDiscriminatorMap(' . $this->varExport($metadata->discriminatorMap) . ');';
130
+            $lines[] = '$metadata->setDiscriminatorMap('.$this->varExport($metadata->discriminatorMap).');';
131 131
         }
132 132
 
133 133
         if ($metadata->changeTrackingPolicy) {
134
-            $lines[] = '$metadata->setChangeTrackingPolicy(Mapping\ChangeTrackingPolicy::' . $metadata->changeTrackingPolicy . ');';
134
+            $lines[] = '$metadata->setChangeTrackingPolicy(Mapping\ChangeTrackingPolicy::'.$metadata->changeTrackingPolicy.');';
135 135
         }
136 136
 
137 137
         if ($metadata->lifecycleCallbacks) {
138 138
             foreach ($metadata->lifecycleCallbacks as $event => $callbacks) {
139 139
                 foreach ($callbacks as $callback) {
140
-                    $lines[] = '$metadata->addLifecycleCallback("' . $callback . '", "' . $event . '");';
140
+                    $lines[] = '$metadata->addLifecycleCallback("'.$callback.'", "'.$event.'");';
141 141
                 }
142 142
             }
143 143
         }
144 144
 
145
-        if (! $metadata->isIdentifierComposite()) {
146
-            $lines[] = '$metadata->setIdGeneratorType(Mapping\GeneratorType::' . $metadata->generatorType . ');';
145
+        if ( ! $metadata->isIdentifierComposite()) {
146
+            $lines[] = '$metadata->setIdGeneratorType(Mapping\GeneratorType::'.$metadata->generatorType.');';
147 147
         }
148 148
 
149 149
         foreach ($metadata->getProperties() as $property) {
@@ -166,30 +166,30 @@  discard block
 block discarded – undo
166 166
         );
167 167
 
168 168
         $lines[] = null;
169
-        $lines[] = '$property->setColumnName("' . $property->getColumnName() . '");';
170
-        $lines[] = '$property->setType(Type::getType("' . $property->getTypeName() . '"));';
171
-        $lines[] = '$property->setTableName("' . $property->getTableName() . '");';
169
+        $lines[] = '$property->setColumnName("'.$property->getColumnName().'");';
170
+        $lines[] = '$property->setType(Type::getType("'.$property->getTypeName().'"));';
171
+        $lines[] = '$property->setTableName("'.$property->getTableName().'");';
172 172
 
173
-        if (! empty($property->getColumnDefinition())) {
174
-            $lines[] = '$property->setColumnDefinition("' . $property->getColumnDefinition() . '");';
173
+        if ( ! empty($property->getColumnDefinition())) {
174
+            $lines[] = '$property->setColumnDefinition("'.$property->getColumnDefinition().'");';
175 175
         }
176 176
 
177
-        if (! empty($property->getLength())) {
178
-            $lines[] = '$property->setLength(' . $property->getLength() . ');';
177
+        if ( ! empty($property->getLength())) {
178
+            $lines[] = '$property->setLength('.$property->getLength().');';
179 179
         }
180 180
 
181
-        if (! empty($property->getScale())) {
182
-            $lines[] = '$property->setScale(' . $property->getScale() . ');';
181
+        if ( ! empty($property->getScale())) {
182
+            $lines[] = '$property->setScale('.$property->getScale().');';
183 183
         }
184 184
 
185
-        if (! empty($property->getPrecision())) {
186
-            $lines[] = '$property->setPrecision(' . $property->getPrecision() . ');';
185
+        if ( ! empty($property->getPrecision())) {
186
+            $lines[] = '$property->setPrecision('.$property->getPrecision().');';
187 187
         }
188 188
 
189
-        $lines[] = '$property->setOptions(' . $this->varExport($property->getOptions()) . ');';
190
-        $lines[] = '$property->setPrimaryKey(' . $this->varExport($property->isPrimaryKey()) . ');';
191
-        $lines[] = '$property->setNullable(' . $this->varExport($property->isNullable()) . ');';
192
-        $lines[] = '$property->setUnique(' . $this->varExport($property->isUnique()) . ');';
189
+        $lines[] = '$property->setOptions('.$this->varExport($property->getOptions()).');';
190
+        $lines[] = '$property->setPrimaryKey('.$this->varExport($property->isPrimaryKey()).');';
191
+        $lines[] = '$property->setNullable('.$this->varExport($property->isNullable()).');';
192
+        $lines[] = '$property->setUnique('.$this->varExport($property->isUnique()).');';
193 193
         $lines[] = null;
194 194
         $lines[] = '$metadata->addProperty($property);';
195 195
     }
@@ -211,25 +211,25 @@  discard block
 block discarded – undo
211 211
         if ($association instanceof OneToOneAssociationMetadata) {
212 212
             $this->exportJoinColumns($association->getJoinColumns(), $lines, 'joinColumns');
213 213
 
214
-            $lines[] = '$association = new Mapping\OneToOneAssociationMetadata("' . $association->getName() . '");';
214
+            $lines[] = '$association = new Mapping\OneToOneAssociationMetadata("'.$association->getName().'");';
215 215
             $lines[] = null;
216 216
             $lines[] = '$association->setJoinColumns($joinColumns);';
217 217
         } else if ($association instanceof ManyToOneAssociationMetadata) {
218 218
             $this->exportJoinColumns($association->getJoinColumns(), $lines, 'joinColumns');
219 219
 
220
-            $lines[] = '$association = new Mapping\ManyToOneAssociationMetadata("' . $association->getName() . '");';
220
+            $lines[] = '$association = new Mapping\ManyToOneAssociationMetadata("'.$association->getName().'");';
221 221
             $lines[] = null;
222 222
             $lines[] = '$association->setJoinColumns($joinColumns);';
223 223
         } else if ($association instanceof OneToManyAssociationMetadata) {
224
-            $lines[] = '$association = new Mapping\OneToManyAssociationMetadata("' . $association->getName() . '");';
224
+            $lines[] = '$association = new Mapping\OneToManyAssociationMetadata("'.$association->getName().'");';
225 225
             $lines[] = null;
226
-            $lines[] = '$association->setOrderBy(' . $this->varExport($association->getOrderBy()) . ');';
226
+            $lines[] = '$association->setOrderBy('.$this->varExport($association->getOrderBy()).');';
227 227
         } else if ($association instanceof ManyToManyAssociationMetadata) {
228 228
             if ($association->getJoinTable()) {
229 229
                 $this->exportJoinTable($association->getJoinTable(), $lines);
230 230
             }
231 231
 
232
-            $lines[] = '$association = new Mapping\ManyToManyAssociationMetadata("' . $association->getName() . '");';
232
+            $lines[] = '$association = new Mapping\ManyToManyAssociationMetadata("'.$association->getName().'");';
233 233
             $lines[] = null;
234 234
 
235 235
             if ($association->getJoinTable()) {
@@ -237,26 +237,26 @@  discard block
 block discarded – undo
237 237
             }
238 238
 
239 239
             if ($association->getIndexedBy()) {
240
-                $lines[] = '$association->setIndexedBy("' . $association->getIndexedBy() . '");';
240
+                $lines[] = '$association->setIndexedBy("'.$association->getIndexedBy().'");';
241 241
             }
242 242
 
243
-            $lines[] = '$association->setOrderBy(' . $this->varExport($association->getOrderBy()) . ');';
243
+            $lines[] = '$association->setOrderBy('.$this->varExport($association->getOrderBy()).');';
244 244
         }
245 245
 
246
-        $lines[] = '$association->setTargetEntity("' . $association->getTargetEntity() . '");';
247
-        $lines[] = '$association->setFetchMode("' . $association->getFetchMode() . '");';
246
+        $lines[] = '$association->setTargetEntity("'.$association->getTargetEntity().'");';
247
+        $lines[] = '$association->setFetchMode("'.$association->getFetchMode().'");';
248 248
 
249 249
         if ($association->getMappedBy()) {
250
-            $lines[] = '$association->setMappedBy("' . $association->getMappedBy() . '");';
250
+            $lines[] = '$association->setMappedBy("'.$association->getMappedBy().'");';
251 251
         }
252 252
 
253 253
         if ($association->getInversedBy()) {
254
-            $lines[] = '$association->setInversedBy("' . $association->getInversedBy() . '");';
254
+            $lines[] = '$association->setInversedBy("'.$association->getInversedBy().'");';
255 255
         }
256 256
 
257
-        $lines[] = '$association->setCascade(' . $this->varExport($cascade) . ');';
258
-        $lines[] = '$association->setOrphanRemoval(' . $this->varExport($association->isOrphanRemoval()) . ');';
259
-        $lines[] = '$association->setPrimaryKey(' . $this->varExport($association->isPrimaryKey()) . ');';
257
+        $lines[] = '$association->setCascade('.$this->varExport($cascade).');';
258
+        $lines[] = '$association->setOrphanRemoval('.$this->varExport($association->isOrphanRemoval()).');';
259
+        $lines[] = '$association->setPrimaryKey('.$this->varExport($association->isPrimaryKey()).');';
260 260
         $lines[] = null;
261 261
         $lines[] = '$metadata->addProperty($association);';
262 262
     }
@@ -266,13 +266,13 @@  discard block
 block discarded – undo
266 266
         $lines[] = null;
267 267
         $lines[] = '$joinTable = new Mapping\JoinTableMetadata();';
268 268
         $lines[] = null;
269
-        $lines[] = '$joinTable->setName("' . $joinTable->getName() . '");';
269
+        $lines[] = '$joinTable->setName("'.$joinTable->getName().'");';
270 270
 
271
-        if (! empty($joinTable->getSchema())) {
272
-            $lines[] = '$joinTable->setSchema("' . $joinTable->getSchema() . '");';
271
+        if ( ! empty($joinTable->getSchema())) {
272
+            $lines[] = '$joinTable->setSchema("'.$joinTable->getSchema().'");';
273 273
         }
274 274
 
275
-        $lines[] = '$joinTable->setOptions(' . $this->varExport($joinTable->getOptions()) . ');';
275
+        $lines[] = '$joinTable->setOptions('.$this->varExport($joinTable->getOptions()).');';
276 276
 
277 277
         $this->exportJoinColumns($joinTable->getJoinColumns(), $lines, 'joinColumns');
278 278
 
@@ -292,24 +292,24 @@  discard block
 block discarded – undo
292 292
 
293 293
     private function exportJoinColumns(array $joinColumns, array &$lines, $variableName)
294 294
     {
295
-        $lines[] = '$' . $variableName . ' = array();';
295
+        $lines[] = '$'.$variableName.' = array();';
296 296
 
297 297
         foreach ($joinColumns as $joinColumn) {
298 298
             /** @var JoinColumnMetadata $joinColumn */
299 299
             $lines[] = '$joinColumn = new Mapping\JoinColumnMetadata();';
300 300
             $lines[] = null;
301
-            $lines[] = '$joinColumn->setTableName("' . $joinColumn->getTableName() . '");';
302
-            $lines[] = '$joinColumn->setColumnName("' . $joinColumn->getColumnName() . '");';
303
-            $lines[] = '$joinColumn->setReferencedColumnName("' . $joinColumn->getReferencedColumnName() . '");';
304
-            $lines[] = '$joinColumn->setAliasedName("' . $joinColumn->getAliasedName() . '");';
305
-            $lines[] = '$joinColumn->setColumnDefinition("' . $joinColumn->getColumnDefinition() . '");';
306
-            $lines[] = '$joinColumn->setOnDelete("' . $joinColumn->getOnDelete() . '");';
307
-            $lines[] = '$joinColumn->setOptions(' . $this->varExport($joinColumn->getOptions()) . ');';
308
-            $lines[] = '$joinColumn->setNullable("' . $joinColumn->isNullable() . '");';
309
-            $lines[] = '$joinColumn->setUnique("' . $joinColumn->isUnique() . '");';
310
-            $lines[] = '$joinColumn->setPrimaryKey("' . $joinColumn->isPrimaryKey() . '");';
301
+            $lines[] = '$joinColumn->setTableName("'.$joinColumn->getTableName().'");';
302
+            $lines[] = '$joinColumn->setColumnName("'.$joinColumn->getColumnName().'");';
303
+            $lines[] = '$joinColumn->setReferencedColumnName("'.$joinColumn->getReferencedColumnName().'");';
304
+            $lines[] = '$joinColumn->setAliasedName("'.$joinColumn->getAliasedName().'");';
305
+            $lines[] = '$joinColumn->setColumnDefinition("'.$joinColumn->getColumnDefinition().'");';
306
+            $lines[] = '$joinColumn->setOnDelete("'.$joinColumn->getOnDelete().'");';
307
+            $lines[] = '$joinColumn->setOptions('.$this->varExport($joinColumn->getOptions()).');';
308
+            $lines[] = '$joinColumn->setNullable("'.$joinColumn->isNullable().'");';
309
+            $lines[] = '$joinColumn->setUnique("'.$joinColumn->isUnique().'");';
310
+            $lines[] = '$joinColumn->setPrimaryKey("'.$joinColumn->isPrimaryKey().'");';
311 311
             $lines[] = null;
312
-            $lines[] = '$' . $variableName . '[] = $joinColumn;';
312
+            $lines[] = '$'.$variableName.'[] = $joinColumn;';
313 313
         }
314 314
     }
315 315
 
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
     protected function varExport($var)
322 322
     {
323 323
         $export = var_export($var, true);
324
-        $export = str_replace("\n", PHP_EOL . str_repeat(' ', 8), $export);
324
+        $export = str_replace("\n", PHP_EOL.str_repeat(' ', 8), $export);
325 325
         $export = str_replace('  ', ' ', $export);
326 326
         $export = str_replace('array (', 'array(', $export);
327 327
         $export = str_replace('array( ', 'array(', $export);
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php 1 patch
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\ORM\Mapping\Driver;
6 6
 
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
             return $this->classNames;
186 186
         }
187 187
 
188
-        if (!$this->paths) {
188
+        if ( ! $this->paths) {
189 189
             throw Mapping\MappingException::pathRequired();
190 190
         }
191 191
 
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
                     new \RecursiveDirectoryIterator($path, \FilesystemIterator::SKIP_DOTS),
203 203
                     \RecursiveIteratorIterator::LEAVES_ONLY
204 204
                 ),
205
-                '/^.+' . preg_quote($this->fileExtension) . '$/i',
205
+                '/^.+'.preg_quote($this->fileExtension).'$/i',
206 206
                 \RecursiveRegexIterator::GET_MATCH
207 207
             );
208 208
 
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
     {
255 255
         $reflectionClass = $metadata->getReflectionClass();
256 256
 
257
-        if (! $reflectionClass) {
257
+        if ( ! $reflectionClass) {
258 258
             // this happens when running annotation driver in combination with
259 259
             // static reflection services. This is not the nicest fix
260 260
             $reflectionClass = new \ReflectionClass($metadata->getClassName());
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
                 $classMetadata
291 291
             );
292 292
 
293
-            if (! $property) {
293
+            if ( ! $property) {
294 294
                 continue;
295 295
             }
296 296
 
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
     )
369 369
     {
370 370
         /** @var Annotation\Entity $entityAnnot */
371
-        $entityAnnot  = $classAnnotations[Annotation\Entity::class];
371
+        $entityAnnot = $classAnnotations[Annotation\Entity::class];
372 372
 
373 373
         if ($entityAnnot->repositoryClass !== null) {
374 374
             $metadata->setCustomRepositoryClassName(
@@ -624,11 +624,11 @@  discard block
 block discarded – undo
624 624
         $assocMetadata->setOrphanRemoval($oneToOneAnnot->orphanRemoval);
625 625
         $assocMetadata->setFetchMode($this->getFetchMode($className, $oneToOneAnnot->fetch));
626 626
 
627
-        if (! empty($oneToOneAnnot->mappedBy)) {
627
+        if ( ! empty($oneToOneAnnot->mappedBy)) {
628 628
             $assocMetadata->setMappedBy($oneToOneAnnot->mappedBy);
629 629
         }
630 630
 
631
-        if (! empty($oneToOneAnnot->inversedBy)) {
631
+        if ( ! empty($oneToOneAnnot->inversedBy)) {
632 632
             $assocMetadata->setInversedBy($oneToOneAnnot->inversedBy);
633 633
         }
634 634
 
@@ -682,13 +682,13 @@  discard block
 block discarded – undo
682 682
         $fieldName      = $reflectionProperty->getName();
683 683
         $manyToOneAnnot = $propertyAnnotations[Annotation\ManyToOne::class];
684 684
         $assocMetadata  = new Mapping\ManyToOneAssociationMetadata($fieldName);
685
-        $targetEntity  = $metadata->fullyQualifiedClassName($manyToOneAnnot->targetEntity);
685
+        $targetEntity = $metadata->fullyQualifiedClassName($manyToOneAnnot->targetEntity);
686 686
 
687 687
         $assocMetadata->setTargetEntity($targetEntity);
688 688
         $assocMetadata->setCascade($this->getCascade($className, $fieldName, $manyToOneAnnot->cascade));
689 689
         $assocMetadata->setFetchMode($this->getFetchMode($className, $manyToOneAnnot->fetch));
690 690
 
691
-        if (! empty($manyToOneAnnot->inversedBy)) {
691
+        if ( ! empty($manyToOneAnnot->inversedBy)) {
692 692
             $assocMetadata->setInversedBy($manyToOneAnnot->inversedBy);
693 693
         }
694 694
 
@@ -744,18 +744,18 @@  discard block
 block discarded – undo
744 744
         $fieldName      = $reflectionProperty->getName();
745 745
         $oneToManyAnnot = $propertyAnnotations[Annotation\OneToMany::class];
746 746
         $assocMetadata  = new Mapping\OneToManyAssociationMetadata($fieldName);
747
-        $targetEntity  = $metadata->fullyQualifiedClassName($oneToManyAnnot->targetEntity);
747
+        $targetEntity = $metadata->fullyQualifiedClassName($oneToManyAnnot->targetEntity);
748 748
 
749 749
         $assocMetadata->setTargetEntity($targetEntity);
750 750
         $assocMetadata->setCascade($this->getCascade($className, $fieldName, $oneToManyAnnot->cascade));
751 751
         $assocMetadata->setOrphanRemoval($oneToManyAnnot->orphanRemoval);
752 752
         $assocMetadata->setFetchMode($this->getFetchMode($className, $oneToManyAnnot->fetch));
753 753
 
754
-        if (! empty($oneToManyAnnot->mappedBy)) {
754
+        if ( ! empty($oneToManyAnnot->mappedBy)) {
755 755
             $assocMetadata->setMappedBy($oneToManyAnnot->mappedBy);
756 756
         }
757 757
 
758
-        if (! empty($oneToManyAnnot->indexBy)) {
758
+        if ( ! empty($oneToManyAnnot->indexBy)) {
759 759
             $assocMetadata->setIndexedBy($oneToManyAnnot->indexBy);
760 760
         }
761 761
 
@@ -802,15 +802,15 @@  discard block
 block discarded – undo
802 802
         $assocMetadata->setOrphanRemoval($manyToManyAnnot->orphanRemoval);
803 803
         $assocMetadata->setFetchMode($this->getFetchMode($className, $manyToManyAnnot->fetch));
804 804
 
805
-        if (! empty($manyToManyAnnot->mappedBy)) {
805
+        if ( ! empty($manyToManyAnnot->mappedBy)) {
806 806
             $assocMetadata->setMappedBy($manyToManyAnnot->mappedBy);
807 807
         }
808 808
 
809
-        if (! empty($manyToManyAnnot->inversedBy)) {
809
+        if ( ! empty($manyToManyAnnot->inversedBy)) {
810 810
             $assocMetadata->setInversedBy($manyToManyAnnot->inversedBy);
811 811
         }
812 812
 
813
-        if (! empty($manyToManyAnnot->indexBy)) {
813
+        if ( ! empty($manyToManyAnnot->indexBy)) {
814 814
             $assocMetadata->setIndexedBy($manyToManyAnnot->indexBy);
815 815
         }
816 816
 
@@ -861,15 +861,15 @@  discard block
 block discarded – undo
861 861
 
862 862
         $fieldMetadata->setType(Type::getType($columnAnnot->type));
863 863
 
864
-        if (! empty($columnAnnot->name)) {
864
+        if ( ! empty($columnAnnot->name)) {
865 865
             $fieldMetadata->setColumnName($columnAnnot->name);
866 866
         }
867 867
 
868
-        if (! empty($columnAnnot->columnDefinition)) {
868
+        if ( ! empty($columnAnnot->columnDefinition)) {
869 869
             $fieldMetadata->setColumnDefinition($columnAnnot->columnDefinition);
870 870
         }
871 871
 
872
-        if (! empty($columnAnnot->length)) {
872
+        if ( ! empty($columnAnnot->length)) {
873 873
             $fieldMetadata->setLength($columnAnnot->length);
874 874
         }
875 875
 
@@ -898,11 +898,11 @@  discard block
 block discarded – undo
898 898
         Mapping\TableMetadata $tableMetadata
899 899
     ) : void
900 900
     {
901
-        if (! empty($tableAnnot->name)) {
901
+        if ( ! empty($tableAnnot->name)) {
902 902
             $tableMetadata->setName($tableAnnot->name);
903 903
         }
904 904
 
905
-        if (! empty($tableAnnot->schema)) {
905
+        if ( ! empty($tableAnnot->schema)) {
906 906
             $tableMetadata->setSchema($tableAnnot->schema);
907 907
         }
908 908
 
@@ -943,11 +943,11 @@  discard block
 block discarded – undo
943 943
     {
944 944
         $joinTable = new Mapping\JoinTableMetadata();
945 945
 
946
-        if (! empty($joinTableAnnot->name)) {
946
+        if ( ! empty($joinTableAnnot->name)) {
947 947
             $joinTable->setName($joinTableAnnot->name);
948 948
         }
949 949
 
950
-        if (! empty($joinTableAnnot->schema)) {
950
+        if ( ! empty($joinTableAnnot->schema)) {
951 951
             $joinTable->setSchema($joinTableAnnot->schema);
952 952
         }
953 953
 
@@ -980,22 +980,22 @@  discard block
 block discarded – undo
980 980
         $joinColumn = new Mapping\JoinColumnMetadata();
981 981
 
982 982
         // @todo Remove conditionals for name and referencedColumnName once naming strategy is brought into drivers
983
-        if (! empty($joinColumnAnnot->name)) {
983
+        if ( ! empty($joinColumnAnnot->name)) {
984 984
             $joinColumn->setColumnName($joinColumnAnnot->name);
985 985
         }
986 986
 
987
-        if (! empty($joinColumnAnnot->referencedColumnName)) {
987
+        if ( ! empty($joinColumnAnnot->referencedColumnName)) {
988 988
             $joinColumn->setReferencedColumnName($joinColumnAnnot->referencedColumnName);
989 989
         }
990 990
 
991 991
         $joinColumn->setNullable($joinColumnAnnot->nullable);
992 992
         $joinColumn->setUnique($joinColumnAnnot->unique);
993 993
 
994
-        if (! empty($joinColumnAnnot->fieldName)) {
994
+        if ( ! empty($joinColumnAnnot->fieldName)) {
995 995
             $joinColumn->setAliasedName($joinColumnAnnot->fieldName);
996 996
         }
997 997
 
998
-        if (! empty($joinColumnAnnot->columnDefinition)) {
998
+        if ( ! empty($joinColumnAnnot->columnDefinition)) {
999 999
             $joinColumn->setColumnDefinition($joinColumnAnnot->columnDefinition);
1000 1000
         }
1001 1001
 
@@ -1022,7 +1022,7 @@  discard block
 block discarded – undo
1022 1022
     ) : Mapping\CacheMetadata
1023 1023
     {
1024 1024
         $baseRegion    = strtolower(str_replace('\\', '_', $metadata->getRootClassName()));
1025
-        $defaultRegion = $baseRegion . ($fieldName ? '__' . $fieldName : '');
1025
+        $defaultRegion = $baseRegion.($fieldName ? '__'.$fieldName : '');
1026 1026
 
1027 1027
         $usage = constant(sprintf('%s::%s', Mapping\CacheUsage::class, $cacheAnnot->usage));
1028 1028
         $region = $cacheAnnot->region ?: $defaultRegion;
@@ -1083,7 +1083,7 @@  discard block
 block discarded – undo
1083 1083
         if ($parent && $parent->inheritanceType === Mapping\InheritanceType::SINGLE_TABLE) {
1084 1084
             // Handle the case where a middle mapped super class inherits from a single table inheritance tree.
1085 1085
             do {
1086
-                if (! $parent->isMappedSuperclass) {
1086
+                if ( ! $parent->isMappedSuperclass) {
1087 1087
                     $metadata->setTable($parent->table);
1088 1088
 
1089 1089
                     break;
@@ -1141,11 +1141,11 @@  discard block
 block discarded – undo
1141 1141
             $discriminatorColumn->setType(Type::getType($typeName));
1142 1142
             $discriminatorColumn->setColumnName($discriminatorColumnAnnotation->name);
1143 1143
 
1144
-            if (! empty($discriminatorColumnAnnotation->columnDefinition)) {
1144
+            if ( ! empty($discriminatorColumnAnnotation->columnDefinition)) {
1145 1145
                 $discriminatorColumn->setColumnDefinition($discriminatorColumnAnnotation->columnDefinition);
1146 1146
             }
1147 1147
 
1148
-            if (! empty($discriminatorColumnAnnotation->length)) {
1148
+            if ( ! empty($discriminatorColumnAnnotation->length)) {
1149 1149
                 $discriminatorColumn->setLength($discriminatorColumnAnnotation->length);
1150 1150
             }
1151 1151
         }
@@ -1156,7 +1156,7 @@  discard block
 block discarded – undo
1156 1156
         if (isset($classAnnotations[Annotation\DiscriminatorMap::class])) {
1157 1157
             $discriminatorMapAnnotation = $classAnnotations[Annotation\DiscriminatorMap::class];
1158 1158
             $discriminatorMap           = array_map(
1159
-                function ($className) use ($metadata) {
1159
+                function($className) use ($metadata) {
1160 1160
                     return $metadata->fullyQualifiedClassName($className);
1161 1161
                 },
1162 1162
                 $discriminatorMapAnnotation->value
@@ -1186,12 +1186,12 @@  discard block
 block discarded – undo
1186 1186
         if (isset($classAnnotations[Annotation\NamedQueries::class])) {
1187 1187
             $namedQueriesAnnot = $classAnnotations[Annotation\NamedQueries::class];
1188 1188
 
1189
-            if (! is_array($namedQueriesAnnot->value)) {
1189
+            if ( ! is_array($namedQueriesAnnot->value)) {
1190 1190
                 throw new \UnexpectedValueException("@NamedQueries should contain an array of @NamedQuery annotations.");
1191 1191
             }
1192 1192
 
1193 1193
             foreach ($namedQueriesAnnot->value as $namedQuery) {
1194
-                if (! ($namedQuery instanceof Annotation\NamedQuery)) {
1194
+                if ( ! ($namedQuery instanceof Annotation\NamedQuery)) {
1195 1195
                     throw new \UnexpectedValueException("@NamedQueries should contain an array of @NamedQuery annotations.");
1196 1196
                 }
1197 1197
 
@@ -1289,7 +1289,7 @@  discard block
 block discarded – undo
1289 1289
             foreach ($entityListenersAnnot->value as $item) {
1290 1290
                 $listenerClassName = $metadata->fullyQualifiedClassName($item);
1291 1291
 
1292
-                if (! class_exists($listenerClassName)) {
1292
+                if ( ! class_exists($listenerClassName)) {
1293 1293
                     throw Mapping\MappingException::entityListenerClassNotFound(
1294 1294
                         $listenerClassName,
1295 1295
                         $metadata->getClassName()
@@ -1331,7 +1331,7 @@  discard block
 block discarded – undo
1331 1331
                 $fieldName = $associationOverride->name;
1332 1332
                 $property  = $metadata->getProperty($fieldName);
1333 1333
 
1334
-                if (! $property) {
1334
+                if ( ! $property) {
1335 1335
                     throw Mapping\MappingException::invalidOverrideFieldName($metadata->getClassName(), $fieldName);
1336 1336
                 }
1337 1337
 
@@ -1365,7 +1365,7 @@  discard block
 block discarded – undo
1365 1365
                 // Check for fetch
1366 1366
                 if ($associationOverride->fetch) {
1367 1367
                     $override->setFetchMode(
1368
-                        constant(Mapping\FetchMode::class . '::' . $associationOverride->fetch)
1368
+                        constant(Mapping\FetchMode::class.'::'.$associationOverride->fetch)
1369 1369
                     );
1370 1370
                 }
1371 1371
 
@@ -1502,7 +1502,7 @@  discard block
 block discarded – undo
1502 1502
         $classAnnotations = $this->reader->getClassAnnotations($reflectionClass);
1503 1503
 
1504 1504
         foreach ($classAnnotations as $key => $annot) {
1505
-            if (! is_numeric($key)) {
1505
+            if ( ! is_numeric($key)) {
1506 1506
                 continue;
1507 1507
             }
1508 1508
 
@@ -1522,7 +1522,7 @@  discard block
 block discarded – undo
1522 1522
         $propertyAnnotations = $this->reader->getPropertyAnnotations($reflectionProperty);
1523 1523
 
1524 1524
         foreach ($propertyAnnotations as $key => $annot) {
1525
-            if (! is_numeric($key)) {
1525
+            if ( ! is_numeric($key)) {
1526 1526
                 continue;
1527 1527
             }
1528 1528
 
@@ -1542,7 +1542,7 @@  discard block
 block discarded – undo
1542 1542
         $methodAnnotations = $this->reader->getMethodAnnotations($reflectionMethod);
1543 1543
 
1544 1544
         foreach ($methodAnnotations as $key => $annot) {
1545
-            if (! is_numeric($key)) {
1545
+            if ( ! is_numeric($key)) {
1546 1546
                 continue;
1547 1547
             }
1548 1548
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Mapping/Driver/Annotation/AnnotationDriver.php 1 patch
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\ORM\Mapping\Driver\Annotation;
6 6
 
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
             return $this->classNames;
188 188
         }
189 189
 
190
-        if (!$this->paths) {
190
+        if ( ! $this->paths) {
191 191
             throw Mapping\MappingException::pathRequired();
192 192
         }
193 193
 
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
                     new \RecursiveDirectoryIterator($path, \FilesystemIterator::SKIP_DOTS),
205 205
                     \RecursiveIteratorIterator::LEAVES_ONLY
206 206
                 ),
207
-                '/^.+' . preg_quote($this->fileExtension) . '$/i',
207
+                '/^.+'.preg_quote($this->fileExtension).'$/i',
208 208
                 \RecursiveRegexIterator::GET_MATCH
209 209
             );
210 210
 
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
     {
261 261
         $reflectionClass = $metadata->getReflectionClass();
262 262
 
263
-        if (! $reflectionClass) {
263
+        if ( ! $reflectionClass) {
264 264
             // this happens when running annotation driver in combination with
265 265
             // static reflection services. This is not the nicest fix
266 266
             $reflectionClass = new \ReflectionClass($metadata->getClassName());
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
                 $metadataBuildingContext
298 298
             );
299 299
 
300
-            if (! $property) {
300
+            if ( ! $property) {
301 301
                 continue;
302 302
             }
303 303
 
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
     )
383 383
     {
384 384
         /** @var Annotation\Entity $entityAnnot */
385
-        $entityAnnot  = $classAnnotations[Annotation\Entity::class];
385
+        $entityAnnot = $classAnnotations[Annotation\Entity::class];
386 386
 
387 387
         if ($entityAnnot->repositoryClass !== null) {
388 388
             $metadata->setCustomRepositoryClassName(
@@ -633,11 +633,11 @@  discard block
 block discarded – undo
633 633
         $assocMetadata->setOrphanRemoval($oneToOneAnnot->orphanRemoval);
634 634
         $assocMetadata->setFetchMode($this->getFetchMode($className, $oneToOneAnnot->fetch));
635 635
 
636
-        if (! empty($oneToOneAnnot->mappedBy)) {
636
+        if ( ! empty($oneToOneAnnot->mappedBy)) {
637 637
             $assocMetadata->setMappedBy($oneToOneAnnot->mappedBy);
638 638
         }
639 639
 
640
-        if (! empty($oneToOneAnnot->inversedBy)) {
640
+        if ( ! empty($oneToOneAnnot->inversedBy)) {
641 641
             $assocMetadata->setInversedBy($oneToOneAnnot->inversedBy);
642 642
         }
643 643
 
@@ -693,13 +693,13 @@  discard block
 block discarded – undo
693 693
         $fieldName      = $reflectionProperty->getName();
694 694
         $manyToOneAnnot = $propertyAnnotations[Annotation\ManyToOne::class];
695 695
         $assocMetadata  = new Mapping\ManyToOneAssociationMetadata($fieldName);
696
-        $targetEntity  = $metadata->fullyQualifiedClassName($manyToOneAnnot->targetEntity);
696
+        $targetEntity = $metadata->fullyQualifiedClassName($manyToOneAnnot->targetEntity);
697 697
 
698 698
         $assocMetadata->setTargetEntity($targetEntity);
699 699
         $assocMetadata->setCascade($this->getCascade($className, $fieldName, $manyToOneAnnot->cascade));
700 700
         $assocMetadata->setFetchMode($this->getFetchMode($className, $manyToOneAnnot->fetch));
701 701
 
702
-        if (! empty($manyToOneAnnot->inversedBy)) {
702
+        if ( ! empty($manyToOneAnnot->inversedBy)) {
703 703
             $assocMetadata->setInversedBy($manyToOneAnnot->inversedBy);
704 704
         }
705 705
 
@@ -757,18 +757,18 @@  discard block
 block discarded – undo
757 757
         $fieldName      = $reflectionProperty->getName();
758 758
         $oneToManyAnnot = $propertyAnnotations[Annotation\OneToMany::class];
759 759
         $assocMetadata  = new Mapping\OneToManyAssociationMetadata($fieldName);
760
-        $targetEntity  = $metadata->fullyQualifiedClassName($oneToManyAnnot->targetEntity);
760
+        $targetEntity = $metadata->fullyQualifiedClassName($oneToManyAnnot->targetEntity);
761 761
 
762 762
         $assocMetadata->setTargetEntity($targetEntity);
763 763
         $assocMetadata->setCascade($this->getCascade($className, $fieldName, $oneToManyAnnot->cascade));
764 764
         $assocMetadata->setOrphanRemoval($oneToManyAnnot->orphanRemoval);
765 765
         $assocMetadata->setFetchMode($this->getFetchMode($className, $oneToManyAnnot->fetch));
766 766
 
767
-        if (! empty($oneToManyAnnot->mappedBy)) {
767
+        if ( ! empty($oneToManyAnnot->mappedBy)) {
768 768
             $assocMetadata->setMappedBy($oneToManyAnnot->mappedBy);
769 769
         }
770 770
 
771
-        if (! empty($oneToManyAnnot->indexBy)) {
771
+        if ( ! empty($oneToManyAnnot->indexBy)) {
772 772
             $assocMetadata->setIndexedBy($oneToManyAnnot->indexBy);
773 773
         }
774 774
 
@@ -817,15 +817,15 @@  discard block
 block discarded – undo
817 817
         $assocMetadata->setOrphanRemoval($manyToManyAnnot->orphanRemoval);
818 818
         $assocMetadata->setFetchMode($this->getFetchMode($className, $manyToManyAnnot->fetch));
819 819
 
820
-        if (! empty($manyToManyAnnot->mappedBy)) {
820
+        if ( ! empty($manyToManyAnnot->mappedBy)) {
821 821
             $assocMetadata->setMappedBy($manyToManyAnnot->mappedBy);
822 822
         }
823 823
 
824
-        if (! empty($manyToManyAnnot->inversedBy)) {
824
+        if ( ! empty($manyToManyAnnot->inversedBy)) {
825 825
             $assocMetadata->setInversedBy($manyToManyAnnot->inversedBy);
826 826
         }
827 827
 
828
-        if (! empty($manyToManyAnnot->indexBy)) {
828
+        if ( ! empty($manyToManyAnnot->indexBy)) {
829 829
             $assocMetadata->setIndexedBy($manyToManyAnnot->indexBy);
830 830
         }
831 831
 
@@ -876,15 +876,15 @@  discard block
 block discarded – undo
876 876
 
877 877
         $fieldMetadata->setType(Type::getType($columnAnnot->type));
878 878
 
879
-        if (! empty($columnAnnot->name)) {
879
+        if ( ! empty($columnAnnot->name)) {
880 880
             $fieldMetadata->setColumnName($columnAnnot->name);
881 881
         }
882 882
 
883
-        if (! empty($columnAnnot->columnDefinition)) {
883
+        if ( ! empty($columnAnnot->columnDefinition)) {
884 884
             $fieldMetadata->setColumnDefinition($columnAnnot->columnDefinition);
885 885
         }
886 886
 
887
-        if (! empty($columnAnnot->length)) {
887
+        if ( ! empty($columnAnnot->length)) {
888 888
             $fieldMetadata->setLength($columnAnnot->length);
889 889
         }
890 890
 
@@ -913,11 +913,11 @@  discard block
 block discarded – undo
913 913
         Mapping\TableMetadata $table
914 914
     ) : void
915 915
     {
916
-        if (! empty($tableAnnot->name)) {
916
+        if ( ! empty($tableAnnot->name)) {
917 917
             $table->setName($tableAnnot->name);
918 918
         }
919 919
 
920
-        if (! empty($tableAnnot->schema)) {
920
+        if ( ! empty($tableAnnot->schema)) {
921 921
             $table->setSchema($tableAnnot->schema);
922 922
         }
923 923
 
@@ -960,11 +960,11 @@  discard block
 block discarded – undo
960 960
     {
961 961
         $joinTable = new Mapping\JoinTableMetadata();
962 962
 
963
-        if (! empty($joinTableAnnot->name)) {
963
+        if ( ! empty($joinTableAnnot->name)) {
964 964
             $joinTable->setName($joinTableAnnot->name);
965 965
         }
966 966
 
967
-        if (! empty($joinTableAnnot->schema)) {
967
+        if ( ! empty($joinTableAnnot->schema)) {
968 968
             $joinTable->setSchema($joinTableAnnot->schema);
969 969
         }
970 970
 
@@ -997,22 +997,22 @@  discard block
 block discarded – undo
997 997
         $joinColumn = new Mapping\JoinColumnMetadata();
998 998
 
999 999
         // @todo Remove conditionals for name and referencedColumnName once naming strategy is brought into drivers
1000
-        if (! empty($joinColumnAnnot->name)) {
1000
+        if ( ! empty($joinColumnAnnot->name)) {
1001 1001
             $joinColumn->setColumnName($joinColumnAnnot->name);
1002 1002
         }
1003 1003
 
1004
-        if (! empty($joinColumnAnnot->referencedColumnName)) {
1004
+        if ( ! empty($joinColumnAnnot->referencedColumnName)) {
1005 1005
             $joinColumn->setReferencedColumnName($joinColumnAnnot->referencedColumnName);
1006 1006
         }
1007 1007
 
1008 1008
         $joinColumn->setNullable($joinColumnAnnot->nullable);
1009 1009
         $joinColumn->setUnique($joinColumnAnnot->unique);
1010 1010
 
1011
-        if (! empty($joinColumnAnnot->fieldName)) {
1011
+        if ( ! empty($joinColumnAnnot->fieldName)) {
1012 1012
             $joinColumn->setAliasedName($joinColumnAnnot->fieldName);
1013 1013
         }
1014 1014
 
1015
-        if (! empty($joinColumnAnnot->columnDefinition)) {
1015
+        if ( ! empty($joinColumnAnnot->columnDefinition)) {
1016 1016
             $joinColumn->setColumnDefinition($joinColumnAnnot->columnDefinition);
1017 1017
         }
1018 1018
 
@@ -1039,7 +1039,7 @@  discard block
 block discarded – undo
1039 1039
     ) : Mapping\CacheMetadata
1040 1040
     {
1041 1041
         $baseRegion    = strtolower(str_replace('\\', '_', $metadata->getRootClassName()));
1042
-        $defaultRegion = $baseRegion . ($fieldName ? '__' . $fieldName : '');
1042
+        $defaultRegion = $baseRegion.($fieldName ? '__'.$fieldName : '');
1043 1043
 
1044 1044
         $usage = constant(sprintf('%s::%s', Mapping\CacheUsage::class, $cacheAnnot->usage));
1045 1045
         $region = $cacheAnnot->region ?: $defaultRegion;
@@ -1152,11 +1152,11 @@  discard block
 block discarded – undo
1152 1152
             $discriminatorColumn->setType(Type::getType($typeName));
1153 1153
             $discriminatorColumn->setColumnName($discriminatorColumnAnnotation->name);
1154 1154
 
1155
-            if (! empty($discriminatorColumnAnnotation->columnDefinition)) {
1155
+            if ( ! empty($discriminatorColumnAnnotation->columnDefinition)) {
1156 1156
                 $discriminatorColumn->setColumnDefinition($discriminatorColumnAnnotation->columnDefinition);
1157 1157
             }
1158 1158
 
1159
-            if (! empty($discriminatorColumnAnnotation->length)) {
1159
+            if ( ! empty($discriminatorColumnAnnotation->length)) {
1160 1160
                 $discriminatorColumn->setLength($discriminatorColumnAnnotation->length);
1161 1161
             }
1162 1162
         }
@@ -1167,7 +1167,7 @@  discard block
 block discarded – undo
1167 1167
         if (isset($classAnnotations[Annotation\DiscriminatorMap::class])) {
1168 1168
             $discriminatorMapAnnotation = $classAnnotations[Annotation\DiscriminatorMap::class];
1169 1169
             $discriminatorMap           = array_map(
1170
-                function ($className) use ($metadata) {
1170
+                function($className) use ($metadata) {
1171 1171
                     return $metadata->fullyQualifiedClassName($className);
1172 1172
                 },
1173 1173
                 $discriminatorMapAnnotation->value
@@ -1197,12 +1197,12 @@  discard block
 block discarded – undo
1197 1197
         if (isset($classAnnotations[Annotation\NamedQueries::class])) {
1198 1198
             $namedQueriesAnnot = $classAnnotations[Annotation\NamedQueries::class];
1199 1199
 
1200
-            if (! is_array($namedQueriesAnnot->value)) {
1200
+            if ( ! is_array($namedQueriesAnnot->value)) {
1201 1201
                 throw new \UnexpectedValueException("@NamedQueries should contain an array of @NamedQuery annotations.");
1202 1202
             }
1203 1203
 
1204 1204
             foreach ($namedQueriesAnnot->value as $namedQuery) {
1205
-                if (! ($namedQuery instanceof Annotation\NamedQuery)) {
1205
+                if ( ! ($namedQuery instanceof Annotation\NamedQuery)) {
1206 1206
                     throw new \UnexpectedValueException("@NamedQueries should contain an array of @NamedQuery annotations.");
1207 1207
                 }
1208 1208
 
@@ -1300,7 +1300,7 @@  discard block
 block discarded – undo
1300 1300
             foreach ($entityListenersAnnot->value as $item) {
1301 1301
                 $listenerClassName = $metadata->fullyQualifiedClassName($item);
1302 1302
 
1303
-                if (! class_exists($listenerClassName)) {
1303
+                if ( ! class_exists($listenerClassName)) {
1304 1304
                     throw Mapping\MappingException::entityListenerClassNotFound(
1305 1305
                         $listenerClassName,
1306 1306
                         $metadata->getClassName()
@@ -1343,7 +1343,7 @@  discard block
 block discarded – undo
1343 1343
                 $fieldName = $associationOverride->name;
1344 1344
                 $property  = $metadata->getProperty($fieldName);
1345 1345
 
1346
-                if (! $property) {
1346
+                if ( ! $property) {
1347 1347
                     throw Mapping\MappingException::invalidOverrideFieldName($metadata->getClassName(), $fieldName);
1348 1348
                 }
1349 1349
 
@@ -1377,7 +1377,7 @@  discard block
 block discarded – undo
1377 1377
                 // Check for fetch
1378 1378
                 if ($associationOverride->fetch) {
1379 1379
                     $override->setFetchMode(
1380
-                        constant(Mapping\FetchMode::class . '::' . $associationOverride->fetch)
1380
+                        constant(Mapping\FetchMode::class.'::'.$associationOverride->fetch)
1381 1381
                     );
1382 1382
                 }
1383 1383
 
@@ -1464,7 +1464,7 @@  discard block
 block discarded – undo
1464 1464
     {
1465 1465
         $fetchModeConstant = sprintf('%s::%s', Mapping\FetchMode::class, $fetchMode);
1466 1466
 
1467
-        if (! defined($fetchModeConstant)) {
1467
+        if ( ! defined($fetchModeConstant)) {
1468 1468
             throw Mapping\MappingException::invalidFetchMode($className, $fetchMode);
1469 1469
         }
1470 1470
 
@@ -1514,7 +1514,7 @@  discard block
 block discarded – undo
1514 1514
         $classAnnotations = $this->reader->getClassAnnotations($reflectionClass);
1515 1515
 
1516 1516
         foreach ($classAnnotations as $key => $annot) {
1517
-            if (! is_numeric($key)) {
1517
+            if ( ! is_numeric($key)) {
1518 1518
                 continue;
1519 1519
             }
1520 1520
 
@@ -1534,7 +1534,7 @@  discard block
 block discarded – undo
1534 1534
         $propertyAnnotations = $this->reader->getPropertyAnnotations($reflectionProperty);
1535 1535
 
1536 1536
         foreach ($propertyAnnotations as $key => $annot) {
1537
-            if (! is_numeric($key)) {
1537
+            if ( ! is_numeric($key)) {
1538 1538
                 continue;
1539 1539
             }
1540 1540
 
@@ -1554,7 +1554,7 @@  discard block
 block discarded – undo
1554 1554
         $methodAnnotations = $this->reader->getMethodAnnotations($reflectionMethod);
1555 1555
 
1556 1556
         foreach ($methodAnnotations as $key => $annot) {
1557
-            if (! is_numeric($key)) {
1557
+            if ( ! is_numeric($key)) {
1558 1558
                 continue;
1559 1559
             }
1560 1560
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Mapping/ClassMetadata.php 1 patch
Spacing   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 
4
-declare(strict_types=1);
4
+declare(strict_types = 1);
5 5
 
6 6
 namespace Doctrine\ORM\Mapping;
7 7
 
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
      */
309 309
     public function __toString()
310 310
     {
311
-        return __CLASS__ . '@' . spl_object_hash($this);
311
+        return __CLASS__.'@'.spl_object_hash($this);
312 312
     }
313 313
 
314 314
     /**
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
         // Restore ReflectionClass and properties
412 412
         $this->reflectionClass = $reflectionService->getClass($this->className);
413 413
 
414
-        if (! $this->reflectionClass) {
414
+        if ( ! $this->reflectionClass) {
415 415
             return;
416 416
         }
417 417
 
@@ -437,11 +437,11 @@  discard block
 block discarded – undo
437 437
         }
438 438
 
439 439
         // Verify & complete identifier mapping
440
-        if (! $this->identifier) {
440
+        if ( ! $this->identifier) {
441 441
             throw MappingException::identifierRequired($this->className);
442 442
         }
443 443
 
444
-        $explicitlyGeneratedProperties = array_filter($this->declaredProperties, function (Property $property) : bool {
444
+        $explicitlyGeneratedProperties = array_filter($this->declaredProperties, function(Property $property) : bool {
445 445
             return $property instanceof FieldMetadata
446 446
                 && $property->isPrimaryKey()
447 447
                 && $property->hasValueGenerator();
@@ -462,14 +462,14 @@  discard block
 block discarded – undo
462 462
     public function validateAssociations() : void
463 463
     {
464 464
         array_map(
465
-            function (Property $property) {
466
-                if (! ($property instanceof AssociationMetadata)) {
465
+            function(Property $property) {
466
+                if ( ! ($property instanceof AssociationMetadata)) {
467 467
                     return;
468 468
                 }
469 469
 
470 470
                 $targetEntity = $property->getTargetEntity();
471 471
 
472
-                if (! class_exists($targetEntity)) {
472
+                if ( ! class_exists($targetEntity)) {
473 473
                     throw MappingException::invalidTargetEntityClass($targetEntity, $this->className, $property->getName());
474 474
                 }
475 475
             },
@@ -491,7 +491,7 @@  discard block
 block discarded – undo
491 491
         foreach ($this->lifecycleCallbacks as $callbacks) {
492 492
             /** @var array $callbacks */
493 493
             foreach ($callbacks as $callbackFuncName) {
494
-                if (! $reflectionService->hasPublicMethod($this->className, $callbackFuncName)) {
494
+                if ( ! $reflectionService->hasPublicMethod($this->className, $callbackFuncName)) {
495 495
                     throw MappingException::lifecycleCallbackMethodNotFound($this->className, $callbackFuncName);
496 496
                 }
497 497
             }
@@ -519,11 +519,11 @@  discard block
 block discarded – undo
519 519
      */
520 520
     public function isIdentifier(string $fieldName) : bool
521 521
     {
522
-        if (! $this->identifier) {
522
+        if ( ! $this->identifier) {
523 523
             return false;
524 524
         }
525 525
 
526
-        if (! $this->isIdentifierComposite()) {
526
+        if ( ! $this->isIdentifierComposite()) {
527 527
             return $fieldName === $this->identifier[0];
528 528
         }
529 529
 
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
      */
552 552
     public function getNamedQuery($queryName) : string
553 553
     {
554
-        if (! isset($this->namedQueries[$queryName])) {
554
+        if ( ! isset($this->namedQueries[$queryName])) {
555 555
             throw MappingException::queryNotFound($this->className, $queryName);
556 556
         }
557 557
 
@@ -611,7 +611,7 @@  discard block
 block discarded – undo
611 611
      */
612 612
     public function getSqlResultSetMapping($name)
613 613
     {
614
-        if (! isset($this->sqlResultSetMappings[$name])) {
614
+        if ( ! isset($this->sqlResultSetMappings[$name])) {
615 615
             throw MappingException::resultMappingNotFound($this->className, $name);
616 616
         }
617 617
 
@@ -646,7 +646,7 @@  discard block
 block discarded – undo
646 646
             $property->setColumnName($columnName);
647 647
         }
648 648
 
649
-        if (! $this->isMappedSuperclass) {
649
+        if ( ! $this->isMappedSuperclass) {
650 650
             $property->setTableName($this->getTableName());
651 651
         }
652 652
 
@@ -666,7 +666,7 @@  discard block
 block discarded – undo
666 666
                 throw MappingException::sqlConversionNotAllowedForPrimaryKeyProperties($property);
667 667
             };
668 668
 
669
-            if (! in_array($fieldName, $this->identifier)) {
669
+            if ( ! in_array($fieldName, $this->identifier)) {
670 670
                 $this->identifier[] = $fieldName;
671 671
             }
672 672
         }
@@ -720,7 +720,7 @@  discard block
 block discarded – undo
720 720
         $fieldName    = $property->getName();
721 721
         $targetEntity = $property->getTargetEntity();
722 722
 
723
-        if (! $targetEntity) {
723
+        if ( ! $targetEntity) {
724 724
             throw MappingException::missingTargetEntity($fieldName);
725 725
         }
726 726
 
@@ -746,7 +746,7 @@  discard block
 block discarded – undo
746 746
                 $this->identifier[] = $property->getName();
747 747
             }
748 748
 
749
-            if ($this->cache && !$property->getCache()) {
749
+            if ($this->cache && ! $property->getCache()) {
750 750
                 throw CacheException::nonCacheableEntityAssociation($this->className, $fieldName);
751 751
             }
752 752
 
@@ -800,7 +800,7 @@  discard block
 block discarded – undo
800 800
                 /** @var JoinColumnMetadata $joinColumn */
801 801
                 if ($property instanceof OneToOneAssociationMetadata && $this->inheritanceType !== InheritanceType::SINGLE_TABLE) {
802 802
                     if (1 === count($property->getJoinColumns())) {
803
-                        if (! $property->isPrimaryKey()) {
803
+                        if ( ! $property->isPrimaryKey()) {
804 804
                             $joinColumn->setUnique(true);
805 805
                         }
806 806
                     } else {
@@ -808,13 +808,13 @@  discard block
 block discarded – undo
808 808
                     }
809 809
                 }
810 810
 
811
-                $joinColumn->setTableName(! $this->isMappedSuperclass ? $this->getTableName() : null);
811
+                $joinColumn->setTableName( ! $this->isMappedSuperclass ? $this->getTableName() : null);
812 812
 
813
-                if (! $joinColumn->getColumnName()) {
813
+                if ( ! $joinColumn->getColumnName()) {
814 814
                     $joinColumn->setColumnName($this->namingStrategy->joinColumnName($fieldName, $this->className));
815 815
                 }
816 816
 
817
-                if (! $joinColumn->getReferencedColumnName()) {
817
+                if ( ! $joinColumn->getReferencedColumnName()) {
818 818
                     $joinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName());
819 819
                 }
820 820
 
@@ -842,7 +842,7 @@  discard block
 block discarded – undo
842 842
         if ($property->isOrphanRemoval()) {
843 843
             $cascades = $property->getCascade();
844 844
 
845
-            if (! in_array('remove', $cascades)) {
845
+            if ( ! in_array('remove', $cascades)) {
846 846
                 $cascades[] = 'remove';
847 847
 
848 848
                 $property->setCascade($cascades);
@@ -908,14 +908,14 @@  discard block
 block discarded – undo
908 908
         $property->setOwningSide(false);
909 909
 
910 910
         // OneToMany MUST have mappedBy
911
-        if (! $property->getMappedBy()) {
911
+        if ( ! $property->getMappedBy()) {
912 912
             throw MappingException::oneToManyRequiresMappedBy($property->getName());
913 913
         }
914 914
 
915 915
         if ($property->isOrphanRemoval()) {
916 916
             $cascades = $property->getCascade();
917 917
 
918
-            if (! in_array('remove', $cascades)) {
918
+            if ( ! in_array('remove', $cascades)) {
919 919
                 $cascades[] = 'remove';
920 920
 
921 921
                 $property->setCascade($cascades);
@@ -938,7 +938,7 @@  discard block
 block discarded – undo
938 938
 
939 939
             $property->setJoinTable($joinTable);
940 940
 
941
-            if (! $joinTable->getName()) {
941
+            if ( ! $joinTable->getName()) {
942 942
                 $joinTableName = $this->namingStrategy->joinTableName(
943 943
                     $property->getSourceEntity(),
944 944
                     $property->getTargetEntity(),
@@ -950,7 +950,7 @@  discard block
 block discarded – undo
950 950
 
951 951
             $selfReferencingEntityWithoutJoinColumns = $property->getSourceEntity() == $property->getTargetEntity() && ! $joinTable->hasColumns();
952 952
 
953
-            if (! $joinTable->getJoinColumns()) {
953
+            if ( ! $joinTable->getJoinColumns()) {
954 954
                 $referencedColumnName = $this->namingStrategy->referenceColumnName();
955 955
                 $sourceReferenceName  = $selfReferencingEntityWithoutJoinColumns ? 'source' : $referencedColumnName;
956 956
                 $columnName           = $this->namingStrategy->joinKeyColumnName($property->getSourceEntity(), $sourceReferenceName);
@@ -963,7 +963,7 @@  discard block
 block discarded – undo
963 963
                 $joinTable->addJoinColumn($joinColumn);
964 964
             }
965 965
 
966
-            if (! $joinTable->getInverseJoinColumns()) {
966
+            if ( ! $joinTable->getInverseJoinColumns()) {
967 967
                 $referencedColumnName = $this->namingStrategy->referenceColumnName();
968 968
                 $targetReferenceName  = $selfReferencingEntityWithoutJoinColumns ? 'target' : $referencedColumnName;
969 969
                 $columnName           = $this->namingStrategy->joinKeyColumnName($property->getTargetEntity(), $targetReferenceName);
@@ -978,13 +978,13 @@  discard block
 block discarded – undo
978 978
 
979 979
             foreach ($joinTable->getJoinColumns() as $joinColumn) {
980 980
                 /** @var JoinColumnMetadata $joinColumn */
981
-                if (! $joinColumn->getReferencedColumnName()) {
981
+                if ( ! $joinColumn->getReferencedColumnName()) {
982 982
                     $joinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName());
983 983
                 }
984 984
 
985 985
                 $referencedColumnName = $joinColumn->getReferencedColumnName();
986 986
 
987
-                if (! $joinColumn->getColumnName()) {
987
+                if ( ! $joinColumn->getColumnName()) {
988 988
                     $columnName = $this->namingStrategy->joinKeyColumnName(
989 989
                         $property->getSourceEntity(),
990 990
                         $referencedColumnName
@@ -996,13 +996,13 @@  discard block
 block discarded – undo
996 996
 
997 997
             foreach ($joinTable->getInverseJoinColumns() as $inverseJoinColumn) {
998 998
                 /** @var JoinColumnMetadata $inverseJoinColumn */
999
-                if (! $inverseJoinColumn->getReferencedColumnName()) {
999
+                if ( ! $inverseJoinColumn->getReferencedColumnName()) {
1000 1000
                     $inverseJoinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName());
1001 1001
                 }
1002 1002
 
1003 1003
                 $referencedColumnName = $inverseJoinColumn->getReferencedColumnName();
1004 1004
 
1005
-                if (! $inverseJoinColumn->getColumnName()) {
1005
+                if ( ! $inverseJoinColumn->getColumnName()) {
1006 1006
                     $columnName = $this->namingStrategy->joinKeyColumnName(
1007 1007
                         $property->getTargetEntity(),
1008 1008
                         $referencedColumnName
@@ -1099,7 +1099,7 @@  discard block
 block discarded – undo
1099 1099
             // Association defined as Id field
1100 1100
             $targetClass = $em->getClassMetadata($property->getTargetEntity());
1101 1101
 
1102
-            if (! $property->isOwningSide()) {
1102
+            if ( ! $property->isOwningSide()) {
1103 1103
                 $property    = $targetClass->getProperty($property->getMappedBy());
1104 1104
                 $targetClass = $em->getClassMetadata($property->getTargetEntity());
1105 1105
             }
@@ -1114,7 +1114,7 @@  discard block
 block discarded – undo
1114 1114
                 $columnName           = $joinColumn->getColumnName();
1115 1115
                 $referencedColumnName = $joinColumn->getReferencedColumnName();
1116 1116
 
1117
-                if (! $joinColumn->getType()) {
1117
+                if ( ! $joinColumn->getType()) {
1118 1118
                     $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $em));
1119 1119
                 }
1120 1120
 
@@ -1154,11 +1154,11 @@  discard block
 block discarded – undo
1154 1154
     {
1155 1155
         $schema = null === $this->getSchemaName()
1156 1156
             ? ''
1157
-            : $this->getSchemaName() . '_'
1157
+            : $this->getSchemaName().'_'
1158 1158
         ;
1159 1159
 
1160 1160
         // replace dots with underscores because PostgreSQL creates temporary tables in a special schema
1161
-        return $schema . $this->getTableName() . '_id_tmp';
1161
+        return $schema.$this->getTableName().'_id_tmp';
1162 1162
     }
1163 1163
 
1164 1164
     /**
@@ -1218,7 +1218,7 @@  discard block
 block discarded – undo
1218 1218
     {
1219 1219
         $fieldName = $property->getName();
1220 1220
 
1221
-        if (! isset($this->declaredProperties[$fieldName])) {
1221
+        if ( ! isset($this->declaredProperties[$fieldName])) {
1222 1222
             throw MappingException::invalidOverrideFieldName($this->className, $fieldName);
1223 1223
         }
1224 1224
 
@@ -1426,7 +1426,7 @@  discard block
 block discarded – undo
1426 1426
         $declaringClass    = $property->getDeclaringClass();
1427 1427
 
1428 1428
         if ($inheritedProperty instanceof FieldMetadata) {
1429
-            if (! $declaringClass->isMappedSuperclass) {
1429
+            if ( ! $declaringClass->isMappedSuperclass) {
1430 1430
                 $inheritedProperty->setTableName($property->getTableName());
1431 1431
             }
1432 1432
 
@@ -1494,7 +1494,7 @@  discard block
 block discarded – undo
1494 1494
             throw MappingException::duplicateQueryMapping($this->className, $name);
1495 1495
         }
1496 1496
 
1497
-        if (! isset($queryMapping['resultClass']) && ! isset($queryMapping['resultSetMapping'])) {
1497
+        if ( ! isset($queryMapping['resultClass']) && ! isset($queryMapping['resultSetMapping'])) {
1498 1498
             throw MappingException::missingQueryMapping($this->className, $name);
1499 1499
         }
1500 1500
 
@@ -1517,7 +1517,7 @@  discard block
 block discarded – undo
1517 1517
      */
1518 1518
     public function addSqlResultSetMapping(array $resultMapping)
1519 1519
     {
1520
-        if (!isset($resultMapping['name'])) {
1520
+        if ( ! isset($resultMapping['name'])) {
1521 1521
             throw MappingException::nameIsMandatoryForSqlResultSetMapping($this->className);
1522 1522
         }
1523 1523
 
@@ -1527,7 +1527,7 @@  discard block
 block discarded – undo
1527 1527
 
1528 1528
         if (isset($resultMapping['entities'])) {
1529 1529
             foreach ($resultMapping['entities'] as $key => $entityResult) {
1530
-                if (! isset($entityResult['entityClass'])) {
1530
+                if ( ! isset($entityResult['entityClass'])) {
1531 1531
                     throw MappingException::missingResultSetMappingEntity($this->className, $resultMapping['name']);
1532 1532
                 }
1533 1533
 
@@ -1540,11 +1540,11 @@  discard block
 block discarded – undo
1540 1540
 
1541 1541
                 if (isset($entityResult['fields'])) {
1542 1542
                     foreach ($entityResult['fields'] as $k => $field) {
1543
-                        if (! isset($field['name'])) {
1543
+                        if ( ! isset($field['name'])) {
1544 1544
                             throw MappingException::missingResultSetMappingFieldName($this->className, $resultMapping['name']);
1545 1545
                         }
1546 1546
 
1547
-                        if (! isset($field['column'])) {
1547
+                        if ( ! isset($field['column'])) {
1548 1548
                             $fieldName = $field['name'];
1549 1549
 
1550 1550
                             if (strpos($fieldName, '.')) {
@@ -1653,11 +1653,11 @@  discard block
 block discarded – undo
1653 1653
             'method' => $method,
1654 1654
         ];
1655 1655
 
1656
-        if (! class_exists($class)) {
1656
+        if ( ! class_exists($class)) {
1657 1657
             throw MappingException::entityListenerClassNotFound($class, $this->className);
1658 1658
         }
1659 1659
 
1660
-        if (! method_exists($class, $method)) {
1660
+        if ( ! method_exists($class, $method)) {
1661 1661
             throw MappingException::entityListenerMethodNotFound($class, $method, $this->className);
1662 1662
         }
1663 1663
 
@@ -1733,7 +1733,7 @@  discard block
 block discarded – undo
1733 1733
             return;
1734 1734
         }
1735 1735
 
1736
-        if (! (class_exists($className) || interface_exists($className))) {
1736
+        if ( ! (class_exists($className) || interface_exists($className))) {
1737 1737
             throw MappingException::invalidClassInDiscriminatorMap($className, $this->className);
1738 1738
         }
1739 1739
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/UnitOfWork.php 2 patches
Doc Comments   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1174,7 +1174,7 @@  discard block
 block discarded – undo
1174 1174
     /**
1175 1175
      * Schedules an entity for being updated.
1176 1176
      *
1177
-     * @param object $entity The entity to schedule for being updated.
1177
+     * @param \Doctrine\Tests\Models\Forum\ForumUser $entity The entity to schedule for being updated.
1178 1178
      *
1179 1179
      * @return void
1180 1180
      *
@@ -1242,7 +1242,7 @@  discard block
 block discarded – undo
1242 1242
     /**
1243 1243
      * Checks whether an entity is registered to be checked in the unit of work.
1244 1244
      *
1245
-     * @param object $entity
1245
+     * @param \Doctrine\Tests\ORM\NotifyChangedEntity $entity
1246 1246
      *
1247 1247
      * @return boolean
1248 1248
      */
@@ -2705,9 +2705,9 @@  discard block
 block discarded – undo
2705 2705
     /**
2706 2706
      * Notifies this UnitOfWork of a property change in an entity.
2707 2707
      *
2708
-     * @param object $entity       The entity that owns the property.
2708
+     * @param \Doctrine\Tests\Models\CustomType\CustomTypeParent $entity       The entity that owns the property.
2709 2709
      * @param string $propertyName The name of the property that changed.
2710
-     * @param mixed  $oldValue     The old value of the property.
2710
+     * @param integer|null  $oldValue     The old value of the property.
2711 2711
      * @param mixed  $newValue     The new value of the property.
2712 2712
      *
2713 2713
      * @return void
@@ -2906,7 +2906,7 @@  discard block
 block discarded – undo
2906 2906
     /**
2907 2907
      * Verifies if two given entities actually are the same based on identifier comparison
2908 2908
      *
2909
-     * @param object $entity1
2909
+     * @param Proxy $entity1
2910 2910
      * @param object $entity2
2911 2911
      *
2912 2912
      * @return bool
Please login to merge, or discard this patch.
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\ORM;
6 6
 
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
             // Entity deletions come last and need to be in reverse commit order
370 370
             if ($this->entityDeletions) {
371 371
                 foreach (array_reverse($commitOrder) as $committedEntityName) {
372
-                    if (! $this->entityDeletions) {
372
+                    if ( ! $this->entityDeletions) {
373 373
                         break; // just a performance optimisation
374 374
                     }
375 375
 
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
         $oid  = spl_object_hash($entity);
455 455
         $data = [];
456 456
 
457
-        if (!isset($this->entityChangeSets[$oid])) {
457
+        if ( ! isset($this->entityChangeSets[$oid])) {
458 458
             return $data;
459 459
         }
460 460
 
@@ -537,7 +537,7 @@  discard block
 block discarded – undo
537 537
                     || ! $class->getProperty($name) instanceof FieldMetadata
538 538
                     || ! $class->getProperty($name)->hasValueGenerator()
539 539
                     || $class->getProperty($name)->getValueGenerator()->getType() !== GeneratorType::IDENTITY
540
-                ) && (! $class->isVersioned() || $name !== $class->versionProperty->getName())) {
540
+                ) && ( ! $class->isVersioned() || $name !== $class->versionProperty->getName())) {
541 541
                 $actualData[$name] = $value;
542 542
             }
543 543
         }
@@ -591,7 +591,7 @@  discard block
 block discarded – undo
591 591
                     if ($owner === null) { // cloned
592 592
                         $actualValue->setOwner($entity, $property);
593 593
                     } else if ($owner !== $entity) { // no clone, we have to fix
594
-                        if (! $actualValue->isInitialized()) {
594
+                        if ( ! $actualValue->isInitialized()) {
595 595
                             $actualValue->initialize(); // we have to do this otherwise the cols share state
596 596
                         }
597 597
 
@@ -631,7 +631,7 @@  discard block
 block discarded – undo
631 631
                             // A PersistentCollection was de-referenced, so delete it.
632 632
                             $coid = spl_object_hash($orgValue);
633 633
 
634
-                            if (!isset($this->collectionDeletions[$coid])) {
634
+                            if ( ! isset($this->collectionDeletions[$coid])) {
635 635
                                 $this->collectionDeletions[$coid] = $orgValue;
636 636
                                 $changeSet[$propName] = $orgValue; // Signal changeset, to-many associations will be ignored
637 637
                             }
@@ -653,7 +653,7 @@  discard block
 block discarded – undo
653 653
 
654 654
         // Look for changes in associations of the entity
655 655
         foreach ($class->getDeclaredPropertiesIterator() as $property) {
656
-            if (! ($property instanceof AssociationMetadata) || ($value = $property->getValue($entity)) === null) {
656
+            if ( ! ($property instanceof AssociationMetadata) || ($value = $property->getValue($entity)) === null) {
657 657
                 continue;
658 658
             }
659 659
 
@@ -757,13 +757,13 @@  discard block
 block discarded – undo
757 757
         $targetClass    = $this->em->getClassMetadata($targetEntity);
758 758
 
759 759
         foreach ($unwrappedValue as $key => $entry) {
760
-            if (! ($entry instanceof $targetEntity)) {
760
+            if ( ! ($entry instanceof $targetEntity)) {
761 761
                 throw ORMInvalidArgumentException::invalidAssociation($targetClass, $association, $entry);
762 762
             }
763 763
 
764 764
             $state = $this->getEntityState($entry, self::STATE_NEW);
765 765
 
766
-            if (! ($entry instanceof $targetEntity)) {
766
+            if ( ! ($entry instanceof $targetEntity)) {
767 767
                 throw ORMException::unexpectedAssociationValue(
768 768
                     $association->getSourceEntity(),
769 769
                     $association->getName(),
@@ -822,7 +822,7 @@  discard block
 block discarded – undo
822 822
         $persister = $this->getEntityPersister($class->getClassName());
823 823
         $generationPlan->executeImmediate($this->em, $entity);
824 824
 
825
-        if (! $generationPlan->containsDeferred()) {
825
+        if ( ! $generationPlan->containsDeferred()) {
826 826
             $id = $this->em->getIdentifierFlattener()->flattenIdentifier($class, $persister->getIdentifier($entity));
827 827
             $this->entityIdentifiers[$oid] = $id;
828 828
         }
@@ -855,7 +855,7 @@  discard block
 block discarded – undo
855 855
     {
856 856
         $oid = spl_object_hash($entity);
857 857
 
858
-        if (! isset($this->entityStates[$oid]) || $this->entityStates[$oid] !== self::STATE_MANAGED) {
858
+        if ( ! isset($this->entityStates[$oid]) || $this->entityStates[$oid] !== self::STATE_MANAGED) {
859 859
             throw ORMInvalidArgumentException::entityNotManaged($entity);
860 860
         }
861 861
 
@@ -877,7 +877,7 @@  discard block
 block discarded – undo
877 877
                     break;
878 878
 
879 879
                 case ($property instanceof FieldMetadata):
880
-                    if (! $property->isPrimaryKey()
880
+                    if ( ! $property->isPrimaryKey()
881 881
                         || ! $property->getValueGenerator()
882 882
                         || $property->getValueGenerator()->getType() !== GeneratorType::IDENTITY) {
883 883
                         $actualData[$name] = $property->getValue($entity);
@@ -1030,7 +1030,7 @@  discard block
 block discarded – undo
1030 1030
             // Entity with this $oid after deletion treated as NEW, even if the $oid
1031 1031
             // is obtained by a new entity because the old one went out of scope.
1032 1032
             //$this->entityStates[$oid] = self::STATE_NEW;
1033
-            if (! $class->isIdentifierComposite()) {
1033
+            if ( ! $class->isIdentifierComposite()) {
1034 1034
                 $property = $class->getProperty($class->getSingleIdentifierFieldName());
1035 1035
 
1036 1036
                 if ($property instanceof FieldMetadata && $property->hasValueGenerator()) {
@@ -1077,7 +1077,7 @@  discard block
 block discarded – undo
1077 1077
         // Calculate dependencies for new nodes
1078 1078
         while ($class = array_pop($newNodes)) {
1079 1079
             foreach ($class->getDeclaredPropertiesIterator() as $property) {
1080
-                if (! ($property instanceof ToOneAssociationMetadata && $property->isOwningSide())) {
1080
+                if ( ! ($property instanceof ToOneAssociationMetadata && $property->isOwningSide())) {
1081 1081
                     continue;
1082 1082
                 }
1083 1083
 
@@ -1091,7 +1091,7 @@  discard block
 block discarded – undo
1091 1091
 
1092 1092
                 $weight = ! array_filter(
1093 1093
                     $property->getJoinColumns(),
1094
-                    function (JoinColumnMetadata $joinColumn) { return $joinColumn->isNullable(); }
1094
+                    function(JoinColumnMetadata $joinColumn) { return $joinColumn->isNullable(); }
1095 1095
                 );
1096 1096
 
1097 1097
                 $calc->addDependency($targetClass->getClassName(), $class->getClassName(), $weight);
@@ -1385,7 +1385,7 @@  discard block
 block discarded – undo
1385 1385
         $persister = $this->getEntityPersister($class->getClassName());
1386 1386
         $id        = $persister->getIdentifier($entity);
1387 1387
 
1388
-        if (! $id) {
1388
+        if ( ! $id) {
1389 1389
             return self::STATE_NEW;
1390 1390
         }
1391 1391
 
@@ -1620,7 +1620,7 @@  discard block
 block discarded – undo
1620 1620
                 throw ORMInvalidArgumentException::detachedEntityCannot($entity, "persisted");
1621 1621
 
1622 1622
             default:
1623
-                throw new UnexpectedValueException("Unexpected entity state: $entityState." . self::objToStr($entity));
1623
+                throw new UnexpectedValueException("Unexpected entity state: $entityState.".self::objToStr($entity));
1624 1624
         }
1625 1625
 
1626 1626
         $this->cascadePersist($entity, $visited);
@@ -1690,7 +1690,7 @@  discard block
 block discarded – undo
1690 1690
             case self::STATE_DETACHED:
1691 1691
                 throw ORMInvalidArgumentException::detachedEntityCannot($entity, "removed");
1692 1692
             default:
1693
-                throw new UnexpectedValueException("Unexpected entity state: $entityState." . self::objToStr($entity));
1693
+                throw new UnexpectedValueException("Unexpected entity state: $entityState.".self::objToStr($entity));
1694 1694
         }
1695 1695
 
1696 1696
     }
@@ -1759,7 +1759,7 @@  discard block
 block discarded – undo
1759 1759
         $class = $this->em->getClassMetadata(get_class($entity));
1760 1760
 
1761 1761
         foreach ($class->getDeclaredPropertiesIterator() as $association) {
1762
-            if (! ($association instanceof AssociationMetadata && in_array('refresh', $association->getCascade()))) {
1762
+            if ( ! ($association instanceof AssociationMetadata && in_array('refresh', $association->getCascade()))) {
1763 1763
                 continue;
1764 1764
             }
1765 1765
 
@@ -1801,7 +1801,7 @@  discard block
 block discarded – undo
1801 1801
         $class = $this->em->getClassMetadata(get_class($entity));
1802 1802
 
1803 1803
         foreach ($class->getDeclaredPropertiesIterator() as $association) {
1804
-            if (! ($association instanceof AssociationMetadata && in_array('persist', $association->getCascade()))) {
1804
+            if ( ! ($association instanceof AssociationMetadata && in_array('persist', $association->getCascade()))) {
1805 1805
                 continue;
1806 1806
             }
1807 1807
 
@@ -1817,7 +1817,7 @@  discard block
 block discarded – undo
1817 1817
 
1818 1818
                 case ($relatedEntities instanceof Collection):
1819 1819
                 case (is_array($relatedEntities)):
1820
-                    if (! ($association instanceof ToManyAssociationMetadata)) {
1820
+                    if ( ! ($association instanceof ToManyAssociationMetadata)) {
1821 1821
                         throw ORMInvalidArgumentException::invalidAssociation(
1822 1822
                             $this->em->getClassMetadata($targetEntity),
1823 1823
                             $association,
@@ -1832,7 +1832,7 @@  discard block
 block discarded – undo
1832 1832
                     break;
1833 1833
 
1834 1834
                 case ($relatedEntities !== null):
1835
-                    if (! $relatedEntities instanceof $targetEntity) {
1835
+                    if ( ! $relatedEntities instanceof $targetEntity) {
1836 1836
                         throw ORMInvalidArgumentException::invalidAssociation(
1837 1837
                             $this->em->getClassMetadata($targetEntity),
1838 1838
                             $association,
@@ -1863,7 +1863,7 @@  discard block
 block discarded – undo
1863 1863
         $class             = $this->em->getClassMetadata(get_class($entity));
1864 1864
 
1865 1865
         foreach ($class->getDeclaredPropertiesIterator() as $association) {
1866
-            if (! ($association instanceof AssociationMetadata && in_array('remove', $association->getCascade()))) {
1866
+            if ( ! ($association instanceof AssociationMetadata && in_array('remove', $association->getCascade()))) {
1867 1867
                 continue;
1868 1868
             }
1869 1869
 
@@ -1946,7 +1946,7 @@  discard block
 block discarded – undo
1946 1946
             case LockMode::NONE === $lockMode:
1947 1947
             case LockMode::PESSIMISTIC_READ === $lockMode:
1948 1948
             case LockMode::PESSIMISTIC_WRITE === $lockMode:
1949
-                if (!$this->em->getConnection()->isTransactionActive()) {
1949
+                if ( ! $this->em->getConnection()->isTransactionActive()) {
1950 1950
                     throw TransactionRequiredException::transactionRequired();
1951 1951
                 }
1952 1952
 
@@ -2190,7 +2190,7 @@  discard block
 block discarded – undo
2190 2190
         }
2191 2191
 
2192 2192
         foreach ($class->getDeclaredPropertiesIterator() as $field => $association) {
2193
-            if (! ($association instanceof AssociationMetadata)) {
2193
+            if ( ! ($association instanceof AssociationMetadata)) {
2194 2194
                 continue;
2195 2195
             }
2196 2196
 
@@ -2239,7 +2239,7 @@  discard block
 block discarded – undo
2239 2239
                 continue;
2240 2240
             }
2241 2241
 
2242
-            if (! $association->isOwningSide()) {
2242
+            if ( ! $association->isOwningSide()) {
2243 2243
                 // use the given entity association
2244 2244
                 if (isset($data[$field]) && is_object($data[$field]) &&
2245 2245
                     isset($this->entityStates[spl_object_hash($data[$field])])) {
@@ -2289,7 +2289,7 @@  discard block
 block discarded – undo
2289 2289
                 $associatedId[$targetField] = $joinColumnValue;
2290 2290
             }
2291 2291
 
2292
-            if (! $associatedId) {
2292
+            if ( ! $associatedId) {
2293 2293
                 // Foreign key is NULL
2294 2294
                 $association->setValue($entity, null);
2295 2295
                 $this->originalEntityData[$oid][$field] = null;
@@ -2298,7 +2298,7 @@  discard block
 block discarded – undo
2298 2298
             }
2299 2299
 
2300 2300
             // @todo guilhermeblanco Can we remove the need of this somehow?
2301
-            if (!isset($hints['fetchMode'][$class->getClassName()][$field])) {
2301
+            if ( ! isset($hints['fetchMode'][$class->getClassName()][$field])) {
2302 2302
                 $hints['fetchMode'][$class->getClassName()][$field] = $association->getFetchMode();
2303 2303
             }
2304 2304
 
@@ -2315,7 +2315,7 @@  discard block
 block discarded – undo
2315 2315
                     // If this is an uninitialized proxy, we are deferring eager loads,
2316 2316
                     // this association is marked as eager fetch, and its an uninitialized proxy (wtf!)
2317 2317
                     // then we can append this entity for eager loading!
2318
-                    if (!$targetClass->isIdentifierComposite() &&
2318
+                    if ( ! $targetClass->isIdentifierComposite() &&
2319 2319
                         $newValue instanceof Proxy &&
2320 2320
                         isset($hints[self::HINT_DEFEREAGERLOAD]) &&
2321 2321
                         $hints['fetchMode'][$class->getClassName()][$field] === FetchMode::EAGER &&
@@ -2346,7 +2346,7 @@  discard block
 block discarded – undo
2346 2346
                             break;
2347 2347
 
2348 2348
                         // Deferred eager load only works for single identifier classes
2349
-                        case (isset($hints[self::HINT_DEFEREAGERLOAD]) && !$targetClass->isIdentifierComposite()):
2349
+                        case (isset($hints[self::HINT_DEFEREAGERLOAD]) && ! $targetClass->isIdentifierComposite()):
2350 2350
                             // TODO: Is there a faster approach?
2351 2351
                             $this->eagerLoadingEntities[$targetClass->getRootClassName()][$relatedIdHash] = current($associatedId);
2352 2352
 
@@ -2716,7 +2716,7 @@  discard block
 block discarded – undo
2716 2716
     {
2717 2717
         $class = $this->em->getClassMetadata(get_class($entity));
2718 2718
 
2719
-        if (! $class->getProperty($propertyName)) {
2719
+        if ( ! $class->getProperty($propertyName)) {
2720 2720
             return; // ignore non-persistent fields
2721 2721
         }
2722 2722
 
@@ -2856,7 +2856,7 @@  discard block
 block discarded – undo
2856 2856
      */
2857 2857
     private function afterTransactionComplete()
2858 2858
     {
2859
-        $this->performCallbackOnCachedPersister(function (CachedPersister $persister) {
2859
+        $this->performCallbackOnCachedPersister(function(CachedPersister $persister) {
2860 2860
             $persister->afterTransactionComplete();
2861 2861
         });
2862 2862
     }
@@ -2866,7 +2866,7 @@  discard block
 block discarded – undo
2866 2866
      */
2867 2867
     private function afterTransactionRolledBack()
2868 2868
     {
2869
-        $this->performCallbackOnCachedPersister(function (CachedPersister $persister) {
2869
+        $this->performCallbackOnCachedPersister(function(CachedPersister $persister) {
2870 2870
             $persister->afterTransactionRolledBack();
2871 2871
         });
2872 2872
     }
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/BasicFunctionalTest.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -5,8 +5,6 @@
 block discarded – undo
5 5
 namespace Doctrine\Tests\ORM\Functional;
6 6
 
7 7
 use Doctrine\DBAL\Logging\DebugStack;
8
-use Doctrine\ORM\EntityNotFoundException;
9
-use Doctrine\ORM\Mapping\ClassMetadata;
10 8
 use Doctrine\ORM\Mapping\FetchMode;
11 9
 use Doctrine\ORM\ORMInvalidArgumentException;
12 10
 use Doctrine\ORM\PersistentCollection;
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php 1 patch
Doc Comments   -2 removed lines patch added patch discarded remove patch
@@ -83,7 +83,6 @@  discard block
 block discarded – undo
83 83
     }
84 84
 
85 85
     /**
86
-     * @param ClassMetadata $class
87 86
      */
88 87
     public function testEntityTableNameAndInheritance()
89 88
     {
@@ -97,7 +96,6 @@  discard block
 block discarded – undo
97 96
 
98 97
     /**
99 98
      *
100
-     * @param ClassMetadata $class
101 99
      */
102 100
     public function testEntityIndexes()
103 101
     {
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/UnitOfWorkTest.php 2 patches
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -7,10 +7,8 @@  discard block
 block discarded – undo
7 7
 use Doctrine\Common\Collections\ArrayCollection;
8 8
 use Doctrine\Common\EventManager;
9 9
 use Doctrine\Common\NotifyPropertyChanged;
10
-use Doctrine\Common\Persistence\Event\LifecycleEventArgs;
11 10
 use Doctrine\Common\PropertyChangedListener;
12 11
 use Doctrine\ORM\Annotation as ORM;
13
-use Doctrine\ORM\Events;
14 12
 use Doctrine\ORM\Mapping\ClassMetadata;
15 13
 use Doctrine\ORM\Mapping\ClassMetadataBuildingContext;
16 14
 use Doctrine\ORM\Mapping\ClassMetadataFactory;
@@ -24,7 +22,6 @@  discard block
 block discarded – undo
24 22
 use Doctrine\Tests\Mocks\EntityPersisterMock;
25 23
 use Doctrine\Tests\Mocks\UnitOfWorkMock;
26 24
 use Doctrine\Tests\Models\CMS\CmsPhonenumber;
27
-use Doctrine\Tests\Models\CMS\CmsUser;
28 25
 use Doctrine\Tests\Models\Forum\ForumAvatar;
29 26
 use Doctrine\Tests\Models\Forum\ForumUser;
30 27
 use Doctrine\Tests\Models\GeoNames\City;
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\Tests\ORM;
6 6
 
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
             'empty string, single field'     => [$emptyString, ''],
451 451
             'non-empty string, single field' => [$nonEmptyString, $nonEmptyString->id],
452 452
             'empty strings, two fields'      => [$emptyStrings, ' '],
453
-            'non-empty strings, two fields'  => [$nonEmptyStrings, $nonEmptyStrings->id1 . ' ' . $nonEmptyStrings->id2],
453
+            'non-empty strings, two fields'  => [$nonEmptyStrings, $nonEmptyStrings->id1.' '.$nonEmptyStrings->id2],
454 454
             'boolean true'                   => [$booleanTrue, '1'],
455 455
             'boolean false'                  => [$booleanFalse, ''],
456 456
         ];
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
 
482 482
     public function entitiesWithInvalidIdentifiersProvider()
483 483
     {
484
-        $firstNullString  = new EntityWithCompositeStringIdentifier();
484
+        $firstNullString = new EntityWithCompositeStringIdentifier();
485 485
 
486 486
         $firstNullString->id2 = uniqid('id2', true);
487 487
 
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Tools/Export/AbstractClassMetadataExporterTest.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\Tests\ORM\Tools\Export;
6 6
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
         $driverMock = new DriverMock();
45 45
         $config     = new Configuration();
46 46
 
47
-        $config->setProxyDir(__DIR__ . '/../../Proxies');
47
+        $config->setProxyDir(__DIR__.'/../../Proxies');
48 48
         $config->setProxyNamespace('Doctrine\Tests\Proxies');
49 49
         $eventManager = new EventManager();
50 50
         $conn = new ConnectionMock([], $driverMock, $config, $eventManager);
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
             'xml'        => XmlDriver::class,
65 65
         ];
66 66
 
67
-        self::assertArrayHasKey($type, $mappingDriver, "There is no metadata driver for the type '" . $type . "'.");
67
+        self::assertArrayHasKey($type, $mappingDriver, "There is no metadata driver for the type '".$type."'.");
68 68
 
69 69
         $class  = $mappingDriver[$type];
70 70
         $driver = ($type === 'annotation')
@@ -87,10 +87,10 @@  discard block
 block discarded – undo
87 87
 
88 88
     public function testExportDirectoryAndFilesAreCreated()
89 89
     {
90
-        $this->deleteDirectory(__DIR__ . '/export/'.$this->getType());
90
+        $this->deleteDirectory(__DIR__.'/export/'.$this->getType());
91 91
 
92 92
         $type = $this->getType();
93
-        $metadataDriver = $this->createMetadataDriver($type, __DIR__ . '/' . $type);
93
+        $metadataDriver = $this->createMetadataDriver($type, __DIR__.'/'.$type);
94 94
         $em = $this->createEntityManager($metadataDriver);
95 95
         $cmf = $this->createClassMetadataFactory($em, $type);
96 96
         $metadata = $cmf->getAllMetadata();
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 
103 103
         $type = $this->getType();
104 104
         $cme = new ClassMetadataExporter();
105
-        $exporter = $cme->getExporter($type, __DIR__ . '/export/' . $type);
105
+        $exporter = $cme->getExporter($type, __DIR__.'/export/'.$type);
106 106
 
107 107
         if ($type === 'annotation') {
108 108
             $exporter->setEntityGenerator(new EntityGenerator());
@@ -114,9 +114,9 @@  discard block
 block discarded – undo
114 114
         $exporter->export();
115 115
 
116 116
         if ($type == 'annotation') {
117
-            self::assertTrue(file_exists(__DIR__ . '/export/' . $type . '/'.str_replace('\\', '/', ExportedUser::class).$this->extension));
117
+            self::assertTrue(file_exists(__DIR__.'/export/'.$type.'/'.str_replace('\\', '/', ExportedUser::class).$this->extension));
118 118
         } else {
119
-            self::assertTrue(file_exists(__DIR__ . '/export/' . $type . '/Doctrine.Tests.ORM.Tools.Export.ExportedUser'.$this->extension));
119
+            self::assertTrue(file_exists(__DIR__.'/export/'.$type.'/Doctrine.Tests.ORM.Tools.Export.ExportedUser'.$this->extension));
120 120
         }
121 121
     }
122 122
 
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
     {
128 128
         $type = $this->getType();
129 129
 
130
-        $metadataDriver = $this->createMetadataDriver($type, __DIR__ . '/export/' . $type);
130
+        $metadataDriver = $this->createMetadataDriver($type, __DIR__.'/export/'.$type);
131 131
         $em = $this->createEntityManager($metadataDriver);
132 132
         $cmf = $this->createClassMetadataFactory($em, $type);
133 133
         $metadata = $cmf->getAllMetadata();
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
         $type = $this->getType();
381 381
 
382 382
         if ($type === 'xml') {
383
-            $xml = simplexml_load_file(__DIR__ . '/export/'.$type.'/Doctrine.Tests.ORM.Tools.Export.ExportedUser.dcm.xml');
383
+            $xml = simplexml_load_file(__DIR__.'/export/'.$type.'/Doctrine.Tests.ORM.Tools.Export.ExportedUser.dcm.xml');
384 384
 
385 385
             $xml->registerXPathNamespace("d", "http://doctrine-project.org/schemas/orm/doctrine-mapping");
386 386
             $nodes = $xml->xpath("/d:doctrine-mapping/d:entity/d:one-to-many[@field='interests']/d:cascade/d:*");
@@ -404,10 +404,10 @@  discard block
 block discarded – undo
404 404
         if (is_file($path)) {
405 405
             return unlink($path);
406 406
         } else if (is_dir($path)) {
407
-            $files = glob(rtrim($path,'/').'/*');
407
+            $files = glob(rtrim($path, '/').'/*');
408 408
 
409 409
             if (is_array($files)) {
410
-                foreach ($files as $file){
410
+                foreach ($files as $file) {
411 411
                     $this->deleteDirectory($file);
412 412
                 }
413 413
             }
Please login to merge, or discard this patch.