Completed
Pull Request — master (#7825)
by
unknown
09:37
created
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.