Completed
Pull Request — master (#7825)
by
unknown
09:01
created
lib/Doctrine/ORM/Persisters/Entity/JoinedSubclassPersister.php 1 patch
Spacing   +31 added lines, -31 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);
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
         $parentClass  = $this->class;
190 190
 
191 191
         while (($parentClass = $parentClass->getParent()) !== null) {
192
-            if (! $parentClass->isMappedSuperclass) {
192
+            if ( ! $parentClass->isMappedSuperclass) {
193 193
                 $parentTable = $parentClass->table->getQuotedQualifiedName($this->platform);
194 194
 
195 195
                 $this->conn->delete($parentTable, $id);
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 
236 236
         if ($filterSql) {
237 237
             $conditionSql .= $conditionSql
238
-                ? ' AND ' . $filterSql
238
+                ? ' AND '.$filterSql
239 239
                 : $filterSql;
240 240
         }
241 241
 
@@ -243,26 +243,26 @@  discard block
 block discarded – undo
243 243
 
244 244
         switch ($lockMode) {
245 245
             case LockMode::PESSIMISTIC_READ:
246
-                $lockSql = ' ' . $this->platform->getReadLockSQL();
246
+                $lockSql = ' '.$this->platform->getReadLockSQL();
247 247
                 break;
248 248
 
249 249
             case LockMode::PESSIMISTIC_WRITE:
250
-                $lockSql = ' ' . $this->platform->getWriteLockSQL();
250
+                $lockSql = ' '.$this->platform->getWriteLockSQL();
251 251
                 break;
252 252
         }
253 253
 
254 254
         $tableName  = $this->class->table->getQuotedQualifiedName($this->platform);
255
-        $from       = ' FROM ' . $tableName . ' ' . $baseTableAlias;
256
-        $where      = $conditionSql !== '' ? ' WHERE ' . $conditionSql : '';
255
+        $from       = ' FROM '.$tableName.' '.$baseTableAlias;
256
+        $where      = $conditionSql !== '' ? ' WHERE '.$conditionSql : '';
257 257
         $lock       = $this->platform->appendLockHint($from, $lockMode);
258 258
         $columnList = $this->getSelectColumnsSQL();
259
-        $query      = 'SELECT ' . $columnList
259
+        $query      = 'SELECT '.$columnList
260 260
                     . $lock
261 261
                     . $joinSql
262 262
                     . $where
263 263
                     . $orderBySql;
264 264
 
265
-        return $this->platform->modifyLimitQuery($query, $limit, $offset ?? 0) . $lockSql;
265
+        return $this->platform->modifyLimitQuery($query, $limit, $offset ?? 0).$lockSql;
266 266
     }
267 267
 
268 268
     /**
@@ -284,14 +284,14 @@  discard block
 block discarded – undo
284 284
 
285 285
         if ($filterSql !== '') {
286 286
             $conditionSql = $conditionSql
287
-                ? $conditionSql . ' AND ' . $filterSql
287
+                ? $conditionSql.' AND '.$filterSql
288 288
                 : $filterSql;
289 289
         }
290 290
 
291 291
         return 'SELECT COUNT(*) '
292
-            . 'FROM ' . $tableName . ' ' . $baseTableAlias
292
+            . 'FROM '.$tableName.' '.$baseTableAlias
293 293
             . $joinSql
294
-            . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql);
294
+            . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql);
295 295
     }
296 296
 
297 297
     /**
@@ -307,23 +307,23 @@  discard block
 block discarded – undo
307 307
         $parentClass = $this->class;
308 308
 
309 309
         while (($parentClass = $parentClass->getParent()) !== null) {
310
-            if (! $parentClass->isMappedSuperclass) {
310
+            if ( ! $parentClass->isMappedSuperclass) {
311 311
                 $conditions = [];
312 312
                 $tableName  = $parentClass->table->getQuotedQualifiedName($this->platform);
313 313
                 $tableAlias = $this->getSQLTableAlias($parentClass->getTableName());
314
-                $joinSql   .= ' INNER JOIN ' . $tableName . ' ' . $tableAlias . ' ON ';
314
+                $joinSql   .= ' INNER JOIN '.$tableName.' '.$tableAlias.' ON ';
315 315
 
316 316
                 foreach ($identifierColumns as $idColumn) {
317 317
                     $quotedColumnName = $this->platform->quoteIdentifier($idColumn->getColumnName());
318 318
 
319
-                    $conditions[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName;
319
+                    $conditions[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName;
320 320
                 }
321 321
 
322 322
                 $joinSql .= implode(' AND ', $conditions);
323 323
             }
324 324
         }
325 325
 
326
-        return parent::getLockTablesSql($lockMode) . $joinSql;
326
+        return parent::getLockTablesSql($lockMode).$joinSql;
327 327
     }
328 328
 
329 329
     /**
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
             if ($property instanceof FieldMetadata) {
348 348
                 $tableClass = $parentClass = $this->class;
349 349
                 while ($parentClass !== $property->getDeclaringClass() && ($parentClass = $parentClass->getParent()) !== null) {
350
-                    if (! $parentClass->isMappedSuperclass) {
350
+                    if ( ! $parentClass->isMappedSuperclass) {
351 351
                         $tableClass = $parentClass;
352 352
                     }
353 353
                 }
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
                 continue;
357 357
             }
358 358
 
359
-            if (! ($property instanceof ToOneAssociationMetadata) || ! $property->isOwningSide()) {
359
+            if ( ! ($property instanceof ToOneAssociationMetadata) || ! $property->isOwningSide()) {
360 360
                 continue;
361 361
             }
362 362
 
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
                 /** @var JoinColumnMetadata $joinColumn */
367 367
                 $referencedColumnName = $joinColumn->getReferencedColumnName();
368 368
 
369
-                if (! $joinColumn->getType()) {
369
+                if ( ! $joinColumn->getType()) {
370 370
                     $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
371 371
                 }
372 372
 
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
         $this->currentPersisterContext->rsm->setDiscriminatorColumn('r', $resultColumnName);
386 386
         $this->currentPersisterContext->rsm->addMetaResult('r', $resultColumnName, $discrColumnName, false, $discrColumnType);
387 387
 
388
-        $columnList[] = $discrColumnType->convertToDatabaseValueSQL($discrTableAlias . '.' . $quotedColumnName, $this->platform);
388
+        $columnList[] = $discrColumnType->convertToDatabaseValueSQL($discrTableAlias.'.'.$quotedColumnName, $this->platform);
389 389
 
390 390
         // sub tables
391 391
         foreach ($this->class->getSubClasses() as $subClassName) {
@@ -409,7 +409,7 @@  discard block
 block discarded – undo
409 409
                             /** @var JoinColumnMetadata $joinColumn */
410 410
                             $referencedColumnName = $joinColumn->getReferencedColumnName();
411 411
 
412
-                            if (! $joinColumn->getType()) {
412
+                            if ( ! $joinColumn->getType()) {
413 413
                                 $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
414 414
                             }
415 415
 
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
         $columns     = [];
436 436
         $parentClass = $this->class;
437 437
         while (($parentClass = $parentClass->getParent()) !== null) {
438
-            if (! $parentClass->isMappedSuperclass) {
438
+            if ( ! $parentClass->isMappedSuperclass) {
439 439
                 $parentColumns = $parentClass->getIdentifierColumns($this->em);
440 440
 
441 441
                 foreach ($parentColumns as $columnName => $column) {
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
                         $columnName           = $joinColumn->getColumnName();
465 465
                         $referencedColumnName = $joinColumn->getReferencedColumnName();
466 466
 
467
-                        if (! $joinColumn->getType()) {
467
+                        if ( ! $joinColumn->getType()) {
468 468
                             $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
469 469
                         }
470 470
 
@@ -517,16 +517,16 @@  discard block
 block discarded – undo
517 517
         $parentClass = $this->class;
518 518
 
519 519
         while (($parentClass = $parentClass->getParent()) !== null) {
520
-            if (! $parentClass->isMappedSuperclass) {
520
+            if ( ! $parentClass->isMappedSuperclass) {
521 521
                 $conditions = [];
522 522
                 $tableName  = $parentClass->table->getQuotedQualifiedName($this->platform);
523 523
                 $tableAlias = $this->getSQLTableAlias($parentClass->getTableName());
524
-                $joinSql   .= ' INNER JOIN ' . $tableName . ' ' . $tableAlias . ' ON ';
524
+                $joinSql   .= ' INNER JOIN '.$tableName.' '.$tableAlias.' ON ';
525 525
 
526 526
                 foreach ($identifierColumns as $idColumn) {
527 527
                     $quotedColumnName = $this->platform->quoteIdentifier($idColumn->getColumnName());
528 528
 
529
-                    $conditions[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName;
529
+                    $conditions[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName;
530 530
                 }
531 531
 
532 532
                 $joinSql .= implode(' AND ', $conditions);
@@ -539,12 +539,12 @@  discard block
 block discarded – undo
539 539
             $subClass   = $this->em->getClassMetadata($subClassName);
540 540
             $tableName  = $subClass->table->getQuotedQualifiedName($this->platform);
541 541
             $tableAlias = $this->getSQLTableAlias($subClass->getTableName());
542
-            $joinSql   .= ' LEFT JOIN ' . $tableName . ' ' . $tableAlias . ' ON ';
542
+            $joinSql   .= ' LEFT JOIN '.$tableName.' '.$tableAlias.' ON ';
543 543
 
544 544
             foreach ($identifierColumns as $idColumn) {
545 545
                 $quotedColumnName = $this->platform->quoteIdentifier($idColumn->getColumnName());
546 546
 
547
-                $conditions[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName;
547
+                $conditions[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName;
548 548
             }
549 549
 
550 550
             $joinSql .= implode(' AND ', $conditions);
Please login to merge, or discard this patch.