Completed
Pull Request — master (#7825)
by
unknown
09:37
created
lib/Doctrine/ORM/Mapping/ComponentMetadata.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@
 block discarded – undo
58 58
         // Restore ReflectionClass and properties
59 59
         $this->reflectionClass = $reflectionService->getClass($this->className);
60 60
 
61
-        if (! $this->reflectionClass) {
61
+        if ( ! $this->reflectionClass) {
62 62
             return;
63 63
         }
64 64
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
                 $fieldName = (string) $overrideElement['name'];
302 302
                 $property  = $classMetadata->getProperty($fieldName);
303 303
 
304
-                if (! $property) {
304
+                if ( ! $property) {
305 305
                     throw Mapping\MappingException::invalidOverrideFieldName($classMetadata->getClassName(), $fieldName);
306 306
                 }
307 307
 
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
                 $fieldName = (string) $overrideElement['name'];
336 336
                 $property  = $classMetadata->getProperty($fieldName);
337 337
 
338
-                if (! $property) {
338
+                if ( ! $property) {
339 339
                     throw Mapping\MappingException::invalidOverrideFieldName($classMetadata->getClassName(), $fieldName);
340 340
                 }
341 341
 
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
                 // Check for fetch
394 394
                 if (isset($overrideElement['fetch'])) {
395 395
                     $override->setFetchMode(
396
-                        constant('Doctrine\ORM\Mapping\FetchMode::' . (string) $overrideElement['fetch'])
396
+                        constant('Doctrine\ORM\Mapping\FetchMode::'.(string) $overrideElement['fetch'])
397 397
                     );
398 398
                 }
399 399
 
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
         // Evaluate <lifecycle-callbacks...>
405 405
         if (isset($xmlRoot->{'lifecycle-callbacks'})) {
406 406
             foreach ($xmlRoot->{'lifecycle-callbacks'}->{'lifecycle-callback'} as $lifecycleCallback) {
407
-                $eventName  = constant(Events::class . '::' . (string) $lifecycleCallback['type']);
407
+                $eventName  = constant(Events::class.'::'.(string) $lifecycleCallback['type']);
408 408
                 $methodName = (string) $lifecycleCallback['method'];
409 409
 
410 410
                 $classMetadata->addLifecycleCallback($eventName, $methodName);
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
             foreach ($xmlRoot->{'entity-listeners'}->{'entity-listener'} as $listenerElement) {
417 417
                 $listenerClassName = (string) $listenerElement['class'];
418 418
 
419
-                if (! class_exists($listenerClassName)) {
419
+                if ( ! class_exists($listenerClassName)) {
420 420
                     throw Mapping\MappingException::entityListenerClassNotFound(
421 421
                         $listenerClassName,
422 422
                         $classMetadata->getClassName()
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
             return $this->classNames;
205 205
         }
206 206
 
207
-        if (! $this->paths) {
207
+        if ( ! $this->paths) {
208 208
             throw Mapping\MappingException::pathRequired();
209 209
         }
210 210
 
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
         $includedFiles = [];
213 213
 
214 214
         foreach ($this->paths as $path) {
215
-            if (! is_dir($path)) {
215
+            if ( ! is_dir($path)) {
216 216
                 throw Mapping\MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path);
217 217
             }
218 218
 
@@ -221,14 +221,14 @@  discard block
 block discarded – undo
221 221
                     new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS),
222 222
                     RecursiveIteratorIterator::LEAVES_ONLY
223 223
                 ),
224
-                '/^.+' . preg_quote($this->fileExtension) . '$/i',
224
+                '/^.+'.preg_quote($this->fileExtension).'$/i',
225 225
                 RecursiveRegexIterator::GET_MATCH
226 226
             );
227 227
 
228 228
             foreach ($iterator as $file) {
229 229
                 $sourceFile = $file[0];
230 230
 
231
-                if (! preg_match('(^phar:)i', $sourceFile)) {
231
+                if ( ! preg_match('(^phar:)i', $sourceFile)) {
232 232
                     $sourceFile = realpath($sourceFile);
233 233
                 }
234 234
 
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
             ->withCacheAnnotation($classAnnotations[Annotation\Cache::class] ?? null)
295 295
             ->build();
296 296
 
297
-        if (! $classMetadata->isEmbeddedClass) {
297
+        if ( ! $classMetadata->isEmbeddedClass) {
298 298
             $this->attachLifecycleCallbacks($classAnnotations, $reflectionClass, $classMetadata);
299 299
             $this->attachEntityListeners($classAnnotations, $classMetadata);
300 300
         }
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
             ];
366 366
 
367 367
             foreach ($entityListenersAnnot->value as $listenerClassName) {
368
-                if (! class_exists($listenerClassName)) {
368
+                if ( ! class_exists($listenerClassName)) {
369 369
                     throw Mapping\MappingException::entityListenerClassNotFound(
370 370
                         $listenerClassName,
371 371
                         $metadata->getClassName()
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
                 $fieldName = $associationOverrideAnnotation->name;
454 454
                 $property  = $metadata->getProperty($fieldName);
455 455
 
456
-                if (! $property) {
456
+                if ( ! $property) {
457 457
                     throw Mapping\MappingException::invalidOverrideFieldName($metadata->getClassName(), $fieldName);
458 458
                 }
459 459
 
@@ -506,7 +506,7 @@  discard block
 block discarded – undo
506 506
 
507 507
                 // Check for fetch
508 508
                 if ($associationOverrideAnnotation->fetch) {
509
-                    $override->setFetchMode(constant(Mapping\FetchMode::class . '::' . $associationOverrideAnnotation->fetch));
509
+                    $override->setFetchMode(constant(Mapping\FetchMode::class.'::'.$associationOverrideAnnotation->fetch));
510 510
                 }
511 511
 
512 512
                 $metadata->setPropertyOverride($override);
@@ -527,7 +527,7 @@  discard block
 block discarded – undo
527 527
                 $fieldName = $attributeOverrideAnnotation->name;
528 528
                 $property  = $metadata->getProperty($fieldName);
529 529
 
530
-                if (! $property) {
530
+                if ( ! $property) {
531 531
                     throw Mapping\MappingException::invalidOverrideFieldName($metadata->getClassName(), $fieldName);
532 532
                 }
533 533
 
@@ -556,7 +556,7 @@  discard block
 block discarded – undo
556 556
         $classAnnotations = $this->reader->getClassAnnotations($reflectionClass);
557 557
 
558 558
         foreach ($classAnnotations as $key => $annot) {
559
-            if (! is_numeric($key)) {
559
+            if ( ! is_numeric($key)) {
560 560
                 continue;
561 561
             }
562 562
 
@@ -574,7 +574,7 @@  discard block
 block discarded – undo
574 574
         $propertyAnnotations = $this->reader->getPropertyAnnotations($reflectionProperty);
575 575
 
576 576
         foreach ($propertyAnnotations as $key => $annot) {
577
-            if (! is_numeric($key)) {
577
+            if ( ! is_numeric($key)) {
578 578
                 continue;
579 579
             }
580 580
 
@@ -592,7 +592,7 @@  discard block
 block discarded – undo
592 592
         $methodAnnotations = $this->reader->getMethodAnnotations($reflectionMethod);
593 593
 
594 594
         foreach ($methodAnnotations as $key => $annot) {
595
-            if (! is_numeric($key)) {
595
+            if ( ! is_numeric($key)) {
596 596
                 continue;
597 597
             }
598 598
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Mapping/Builder/ClassMetadataBuilder.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
         $this->metadataBuildingContext            = $metadataBuildingContext;
67 67
         $this->tableMetadataBuilder               = $tableMetadataBuilder ?: new TableMetadataBuilder($metadataBuildingContext);
68 68
         $this->cacheMetadataBuilder               = $cacheMetadataBuilder ?: new CacheMetadataBuilder($metadataBuildingContext);
69
-        $this->discriminatorColumnMetadataBuilder = $discriminatorColumnMetadataBuilder?: new DiscriminatorColumnMetadataBuilder($metadataBuildingContext);
69
+        $this->discriminatorColumnMetadataBuilder = $discriminatorColumnMetadataBuilder ?: new DiscriminatorColumnMetadataBuilder($metadataBuildingContext);
70 70
     }
71 71
 
72 72
     public function withClassName(string $className) : ClassMetadataBuilder
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
             && $parentMetadata->inheritanceType === Mapping\InheritanceType::SINGLE_TABLE) {
234 234
             // Handle the case where a middle mapped super class inherits from a single table inheritance tree.
235 235
             do {
236
-                if (! $parentMetadata->isMappedSuperclass) {
236
+                if ( ! $parentMetadata->isMappedSuperclass) {
237 237
                     $tableMetadata = $parentMetadata->table;
238 238
                     break;
239 239
                 }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Persisters/Entity/JoinedSubclassPersister.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
         $parentClass = $this->class;
55 55
 
56 56
         while (($parentClass = $parentClass->getParent()) !== null) {
57
-            if (! $parentClass->isMappedSuperclass) {
57
+            if ( ! $parentClass->isMappedSuperclass) {
58 58
                 $parentTableName = $parentClass->getTableName();
59 59
 
60 60
                 if ($parentClass !== $rootClass) {
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
             }
111 111
 
112 112
             foreach ($data as $columnName => $value) {
113
-                if (! is_array($id) || ! isset($id[$columnName])) {
113
+                if ( ! is_array($id) || ! isset($id[$columnName])) {
114 114
                     $type = $this->columns[$columnName]->getType();
115 115
 
116 116
                     $stmt->bindValue($paramIndex++, $value, $type);
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
     {
135 135
         $updateData = $this->prepareUpdateData($entity);
136 136
 
137
-        if (! $updateData) {
137
+        if ( ! $updateData) {
138 138
             return;
139 139
         }
140 140
 
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
             $versionedClass = $this->class->versionProperty->getDeclaringClass();
153 153
             $versionedTable = $versionedClass->getTableName();
154 154
 
155
-            if (! isset($updateData[$versionedTable])) {
155
+            if ( ! isset($updateData[$versionedTable])) {
156 156
                 $tableName = $versionedClass->table->getQuotedQualifiedName($this->platform);
157 157
 
158 158
                 $this->updateTable($entity, $tableName, [], true);
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 
234 234
         if ($filterSql) {
235 235
             $conditionSql .= $conditionSql
236
-                ? ' AND ' . $filterSql
236
+                ? ' AND '.$filterSql
237 237
                 : $filterSql;
238 238
         }
239 239
 
@@ -241,26 +241,26 @@  discard block
 block discarded – undo
241 241
 
242 242
         switch ($lockMode) {
243 243
             case LockMode::PESSIMISTIC_READ:
244
-                $lockSql = ' ' . $this->platform->getReadLockSQL();
244
+                $lockSql = ' '.$this->platform->getReadLockSQL();
245 245
                 break;
246 246
 
247 247
             case LockMode::PESSIMISTIC_WRITE:
248
-                $lockSql = ' ' . $this->platform->getWriteLockSQL();
248
+                $lockSql = ' '.$this->platform->getWriteLockSQL();
249 249
                 break;
250 250
         }
251 251
 
252 252
         $tableName  = $this->class->table->getQuotedQualifiedName($this->platform);
253
-        $from       = ' FROM ' . $tableName . ' ' . $baseTableAlias;
254
-        $where      = $conditionSql !== '' ? ' WHERE ' . $conditionSql : '';
253
+        $from       = ' FROM '.$tableName.' '.$baseTableAlias;
254
+        $where      = $conditionSql !== '' ? ' WHERE '.$conditionSql : '';
255 255
         $lock       = $this->platform->appendLockHint($from, $lockMode);
256 256
         $columnList = $this->getSelectColumnsSQL();
257
-        $query      = 'SELECT ' . $columnList
257
+        $query      = 'SELECT '.$columnList
258 258
                     . $lock
259 259
                     . $joinSql
260 260
                     . $where
261 261
                     . $orderBySql;
262 262
 
263
-        return $this->platform->modifyLimitQuery($query, $limit, $offset ?? 0) . $lockSql;
263
+        return $this->platform->modifyLimitQuery($query, $limit, $offset ?? 0).$lockSql;
264 264
     }
265 265
 
266 266
     /**
@@ -282,14 +282,14 @@  discard block
 block discarded – undo
282 282
 
283 283
         if ($filterSql !== '') {
284 284
             $conditionSql = $conditionSql
285
-                ? $conditionSql . ' AND ' . $filterSql
285
+                ? $conditionSql.' AND '.$filterSql
286 286
                 : $filterSql;
287 287
         }
288 288
 
289 289
         return 'SELECT COUNT(*) '
290
-            . 'FROM ' . $tableName . ' ' . $baseTableAlias
290
+            . 'FROM '.$tableName.' '.$baseTableAlias
291 291
             . $joinSql
292
-            . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql);
292
+            . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql);
293 293
     }
294 294
 
295 295
     /**
@@ -308,18 +308,18 @@  discard block
 block discarded – undo
308 308
             $conditions = [];
309 309
             $tableName  = $parentClass->table->getQuotedQualifiedName($this->platform);
310 310
             $tableAlias = $this->getSQLTableAlias($parentClass->getTableName());
311
-            $joinSql   .= ' INNER JOIN ' . $tableName . ' ' . $tableAlias . ' ON ';
311
+            $joinSql   .= ' INNER JOIN '.$tableName.' '.$tableAlias.' ON ';
312 312
 
313 313
             foreach ($identifierColumns as $idColumn) {
314 314
                 $quotedColumnName = $this->platform->quoteIdentifier($idColumn->getColumnName());
315 315
 
316
-                $conditions[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName;
316
+                $conditions[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName;
317 317
             }
318 318
 
319 319
             $joinSql .= implode(' AND ', $conditions);
320 320
         }
321 321
 
322
-        return parent::getLockTablesSql($lockMode) . $joinSql;
322
+        return parent::getLockTablesSql($lockMode).$joinSql;
323 323
     }
324 324
 
325 325
     /**
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
                 continue;
347 347
             }
348 348
 
349
-            if (! ($property instanceof ToOneAssociationMetadata) || ! $property->isOwningSide()) {
349
+            if ( ! ($property instanceof ToOneAssociationMetadata) || ! $property->isOwningSide()) {
350 350
                 continue;
351 351
             }
352 352
 
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
                 /** @var JoinColumnMetadata $joinColumn */
357 357
                 $referencedColumnName = $joinColumn->getReferencedColumnName();
358 358
 
359
-                if (! $joinColumn->getType()) {
359
+                if ( ! $joinColumn->getType()) {
360 360
                     $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
361 361
                 }
362 362
 
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
         $this->currentPersisterContext->rsm->setDiscriminatorColumn('r', $resultColumnName);
376 376
         $this->currentPersisterContext->rsm->addMetaResult('r', $resultColumnName, $discrColumnName, false, $discrColumnType);
377 377
 
378
-        $columnList[] = $discrColumnType->convertToDatabaseValueSQL($discrTableAlias . '.' . $quotedColumnName, $this->platform);
378
+        $columnList[] = $discrColumnType->convertToDatabaseValueSQL($discrTableAlias.'.'.$quotedColumnName, $this->platform);
379 379
 
380 380
         // sub tables
381 381
         foreach ($this->class->getSubClasses() as $subClassName) {
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
                             /** @var JoinColumnMetadata $joinColumn */
400 400
                             $referencedColumnName = $joinColumn->getReferencedColumnName();
401 401
 
402
-                            if (! $joinColumn->getType()) {
402
+                            if ( ! $joinColumn->getType()) {
403 403
                                 $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
404 404
                             }
405 405
 
@@ -425,7 +425,7 @@  discard block
 block discarded – undo
425 425
         $columns     = [];
426 426
         $parentClass = $this->class;
427 427
         while (($parentClass = $parentClass->getParent()) !== null) {
428
-            if (! $parentClass->isMappedSuperclass) {
428
+            if ( ! $parentClass->isMappedSuperclass) {
429 429
                 $parentColumns = $parentClass->getIdentifierColumns($this->em);
430 430
 
431 431
                 foreach ($parentColumns as $columnName => $column) {
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
                         $columnName           = $joinColumn->getColumnName();
455 455
                         $referencedColumnName = $joinColumn->getReferencedColumnName();
456 456
 
457
-                        if (! $joinColumn->getType()) {
457
+                        if ( ! $joinColumn->getType()) {
458 458
                             $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
459 459
                         }
460 460
 
@@ -507,16 +507,16 @@  discard block
 block discarded – undo
507 507
         $parentClass = $this->class;
508 508
 
509 509
         while (($parentClass = $parentClass->getParent()) !== null) {
510
-            if (! $parentClass->isMappedSuperclass) {
510
+            if ( ! $parentClass->isMappedSuperclass) {
511 511
                 $conditions = [];
512 512
                 $tableName  = $parentClass->table->getQuotedQualifiedName($this->platform);
513 513
                 $tableAlias = $this->getSQLTableAlias($parentClass->getTableName());
514
-                $joinSql   .= ' INNER JOIN ' . $tableName . ' ' . $tableAlias . ' ON ';
514
+                $joinSql   .= ' INNER JOIN '.$tableName.' '.$tableAlias.' ON ';
515 515
 
516 516
                 foreach ($identifierColumns as $idColumn) {
517 517
                     $quotedColumnName = $this->platform->quoteIdentifier($idColumn->getColumnName());
518 518
 
519
-                    $conditions[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName;
519
+                    $conditions[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName;
520 520
                 }
521 521
 
522 522
                 $joinSql .= implode(' AND ', $conditions);
@@ -529,12 +529,12 @@  discard block
 block discarded – undo
529 529
             $subClass   = $this->em->getClassMetadata($subClassName);
530 530
             $tableName  = $subClass->table->getQuotedQualifiedName($this->platform);
531 531
             $tableAlias = $this->getSQLTableAlias($subClass->getTableName());
532
-            $joinSql   .= ' LEFT JOIN ' . $tableName . ' ' . $tableAlias . ' ON ';
532
+            $joinSql   .= ' LEFT JOIN '.$tableName.' '.$tableAlias.' ON ';
533 533
 
534 534
             foreach ($identifierColumns as $idColumn) {
535 535
                 $quotedColumnName = $this->platform->quoteIdentifier($idColumn->getColumnName());
536 536
 
537
-                $conditions[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName;
537
+                $conditions[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName;
538 538
             }
539 539
 
540 540
             $joinSql .= implode(' AND ', $conditions);
Please login to merge, or discard this patch.