Completed
Pull Request — master (#7825)
by
unknown
09:43
created
lib/Doctrine/ORM/Persisters/Entity/JoinedSubclassPersister.php 1 patch
Spacing   +29 added lines, -29 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
     /**
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
             if ($property instanceof FieldMetadata) {
344 344
                 $tableClass = $parentClass = $this->class;
345 345
                 while ($parentClass !== $property->getDeclaringClass() && ($parentClass = $parentClass->getParent()) !== null) {
346
-                    if (! $parentClass->isMappedSuperclass) {
346
+                    if ( ! $parentClass->isMappedSuperclass) {
347 347
                         $tableClass = $parentClass;
348 348
                     }
349 349
                 }
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
                 continue;
353 353
             }
354 354
 
355
-            if (! ($property instanceof ToOneAssociationMetadata) || ! $property->isOwningSide()) {
355
+            if ( ! ($property instanceof ToOneAssociationMetadata) || ! $property->isOwningSide()) {
356 356
                 continue;
357 357
             }
358 358
 
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
                 /** @var JoinColumnMetadata $joinColumn */
363 363
                 $referencedColumnName = $joinColumn->getReferencedColumnName();
364 364
 
365
-                if (! $joinColumn->getType()) {
365
+                if ( ! $joinColumn->getType()) {
366 366
                     $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
367 367
                 }
368 368
 
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
         $this->currentPersisterContext->rsm->setDiscriminatorColumn('r', $resultColumnName);
382 382
         $this->currentPersisterContext->rsm->addMetaResult('r', $resultColumnName, $discrColumnName, false, $discrColumnType);
383 383
 
384
-        $columnList[] = $discrColumnType->convertToDatabaseValueSQL($discrTableAlias . '.' . $quotedColumnName, $this->platform);
384
+        $columnList[] = $discrColumnType->convertToDatabaseValueSQL($discrTableAlias.'.'.$quotedColumnName, $this->platform);
385 385
 
386 386
         // sub tables
387 387
         foreach ($this->class->getSubClasses() as $subClassName) {
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
                             /** @var JoinColumnMetadata $joinColumn */
406 406
                             $referencedColumnName = $joinColumn->getReferencedColumnName();
407 407
 
408
-                            if (! $joinColumn->getType()) {
408
+                            if ( ! $joinColumn->getType()) {
409 409
                                 $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
410 410
                             }
411 411
 
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
         $columns     = [];
432 432
         $parentClass = $this->class;
433 433
         while (($parentClass = $parentClass->getParent()) !== null) {
434
-            if (! $parentClass->isMappedSuperclass) {
434
+            if ( ! $parentClass->isMappedSuperclass) {
435 435
                 $parentColumns = $parentClass->getIdentifierColumns($this->em);
436 436
 
437 437
                 foreach ($parentColumns as $columnName => $column) {
@@ -460,7 +460,7 @@  discard block
 block discarded – undo
460 460
                         $columnName           = $joinColumn->getColumnName();
461 461
                         $referencedColumnName = $joinColumn->getReferencedColumnName();
462 462
 
463
-                        if (! $joinColumn->getType()) {
463
+                        if ( ! $joinColumn->getType()) {
464 464
                             $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
465 465
                         }
466 466
 
@@ -513,16 +513,16 @@  discard block
 block discarded – undo
513 513
         $parentClass = $this->class;
514 514
 
515 515
         while (($parentClass = $parentClass->getParent()) !== null) {
516
-            if (! $parentClass->isMappedSuperclass) {
516
+            if ( ! $parentClass->isMappedSuperclass) {
517 517
                 $conditions = [];
518 518
                 $tableName  = $parentClass->table->getQuotedQualifiedName($this->platform);
519 519
                 $tableAlias = $this->getSQLTableAlias($parentClass->getTableName());
520
-                $joinSql   .= ' INNER JOIN ' . $tableName . ' ' . $tableAlias . ' ON ';
520
+                $joinSql   .= ' INNER JOIN '.$tableName.' '.$tableAlias.' ON ';
521 521
 
522 522
                 foreach ($identifierColumns as $idColumn) {
523 523
                     $quotedColumnName = $this->platform->quoteIdentifier($idColumn->getColumnName());
524 524
 
525
-                    $conditions[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName;
525
+                    $conditions[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName;
526 526
                 }
527 527
 
528 528
                 $joinSql .= implode(' AND ', $conditions);
@@ -535,12 +535,12 @@  discard block
 block discarded – undo
535 535
             $subClass   = $this->em->getClassMetadata($subClassName);
536 536
             $tableName  = $subClass->table->getQuotedQualifiedName($this->platform);
537 537
             $tableAlias = $this->getSQLTableAlias($subClass->getTableName());
538
-            $joinSql   .= ' LEFT JOIN ' . $tableName . ' ' . $tableAlias . ' ON ';
538
+            $joinSql   .= ' LEFT JOIN '.$tableName.' '.$tableAlias.' ON ';
539 539
 
540 540
             foreach ($identifierColumns as $idColumn) {
541 541
                 $quotedColumnName = $this->platform->quoteIdentifier($idColumn->getColumnName());
542 542
 
543
-                $conditions[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName;
543
+                $conditions[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName;
544 544
             }
545 545
 
546 546
             $joinSql .= implode(' AND ', $conditions);
Please login to merge, or discard this patch.