Failed Conditions
Pull Request — master (#7488)
by Michael
10:50
created
lib/Doctrine/ORM/Persisters/Entity/JoinedSubclassPersister.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
             }
110 110
 
111 111
             foreach ($data as $columnName => $value) {
112
-                if (! is_array($id) || ! isset($id[$columnName])) {
112
+                if ( ! is_array($id) || ! isset($id[$columnName])) {
113 113
                     $type = $this->columns[$columnName]->getType();
114 114
 
115 115
                     $stmt->bindValue($paramIndex++, $value, $type);
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
     {
134 134
         $updateData = $this->prepareUpdateData($entity);
135 135
 
136
-        if (! $updateData) {
136
+        if ( ! $updateData) {
137 137
             return;
138 138
         }
139 139
 
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
             $versionedClass = $this->class->versionProperty->getDeclaringClass();
152 152
             $versionedTable = $versionedClass->getTableName();
153 153
 
154
-            if (! isset($updateData[$versionedTable])) {
154
+            if ( ! isset($updateData[$versionedTable])) {
155 155
                 $tableName = $versionedClass->table->getQuotedQualifiedName($this->platform);
156 156
 
157 157
                 $this->updateTable($entity, $tableName, [], true);
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 
233 233
         if ($filterSql) {
234 234
             $conditionSql .= $conditionSql
235
-                ? ' AND ' . $filterSql
235
+                ? ' AND '.$filterSql
236 236
                 : $filterSql;
237 237
         }
238 238
 
@@ -240,26 +240,26 @@  discard block
 block discarded – undo
240 240
 
241 241
         switch ($lockMode) {
242 242
             case LockMode::PESSIMISTIC_READ:
243
-                $lockSql = ' ' . $this->platform->getReadLockSQL();
243
+                $lockSql = ' '.$this->platform->getReadLockSQL();
244 244
                 break;
245 245
 
246 246
             case LockMode::PESSIMISTIC_WRITE:
247
-                $lockSql = ' ' . $this->platform->getWriteLockSQL();
247
+                $lockSql = ' '.$this->platform->getWriteLockSQL();
248 248
                 break;
249 249
         }
250 250
 
251 251
         $tableName  = $this->class->table->getQuotedQualifiedName($this->platform);
252
-        $from       = ' FROM ' . $tableName . ' ' . $baseTableAlias;
253
-        $where      = $conditionSql !== '' ? ' WHERE ' . $conditionSql : '';
252
+        $from       = ' FROM '.$tableName.' '.$baseTableAlias;
253
+        $where      = $conditionSql !== '' ? ' WHERE '.$conditionSql : '';
254 254
         $lock       = $this->platform->appendLockHint($from, $lockMode);
255 255
         $columnList = $this->getSelectColumnsSQL();
256
-        $query      = 'SELECT ' . $columnList
256
+        $query      = 'SELECT '.$columnList
257 257
                     . $lock
258 258
                     . $joinSql
259 259
                     . $where
260 260
                     . $orderBySql;
261 261
 
262
-        return $this->platform->modifyLimitQuery($query, $limit, $offset ?? 0) . $lockSql;
262
+        return $this->platform->modifyLimitQuery($query, $limit, $offset ?? 0).$lockSql;
263 263
     }
264 264
 
265 265
     /**
@@ -281,14 +281,14 @@  discard block
 block discarded – undo
281 281
 
282 282
         if ($filterSql !== '') {
283 283
             $conditionSql = $conditionSql
284
-                ? $conditionSql . ' AND ' . $filterSql
284
+                ? $conditionSql.' AND '.$filterSql
285 285
                 : $filterSql;
286 286
         }
287 287
 
288 288
         return 'SELECT COUNT(*) '
289
-            . 'FROM ' . $tableName . ' ' . $baseTableAlias
289
+            . 'FROM '.$tableName.' '.$baseTableAlias
290 290
             . $joinSql
291
-            . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql);
291
+            . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql);
292 292
     }
293 293
 
294 294
     /**
@@ -307,18 +307,18 @@  discard block
 block discarded – undo
307 307
             $conditions = [];
308 308
             $tableName  = $parentClass->table->getQuotedQualifiedName($this->platform);
309 309
             $tableAlias = $this->getSQLTableAlias($parentClass->getTableName());
310
-            $joinSql   .= ' INNER JOIN ' . $tableName . ' ' . $tableAlias . ' ON ';
310
+            $joinSql   .= ' INNER JOIN '.$tableName.' '.$tableAlias.' ON ';
311 311
 
312 312
             foreach ($identifierColumns as $idColumn) {
313 313
                 $quotedColumnName = $this->platform->quoteIdentifier($idColumn->getColumnName());
314 314
 
315
-                $conditions[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName;
315
+                $conditions[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName;
316 316
             }
317 317
 
318 318
             $joinSql .= implode(' AND ', $conditions);
319 319
         }
320 320
 
321
-        return parent::getLockTablesSql($lockMode) . $joinSql;
321
+        return parent::getLockTablesSql($lockMode).$joinSql;
322 322
     }
323 323
 
324 324
     /**
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
                 continue;
346 346
             }
347 347
 
348
-            if (! ($property instanceof ToOneAssociationMetadata) || ! $property->isOwningSide()) {
348
+            if ( ! ($property instanceof ToOneAssociationMetadata) || ! $property->isOwningSide()) {
349 349
                 continue;
350 350
             }
351 351
 
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
                 /** @var JoinColumnMetadata $joinColumn */
356 356
                 $referencedColumnName = $joinColumn->getReferencedColumnName();
357 357
 
358
-                if (! $joinColumn->getType()) {
358
+                if ( ! $joinColumn->getType()) {
359 359
                     $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
360 360
                 }
361 361
 
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
         $this->currentPersisterContext->rsm->setDiscriminatorColumn('r', $resultColumnName);
375 375
         $this->currentPersisterContext->rsm->addMetaResult('r', $resultColumnName, $discrColumnName, false, $discrColumnType);
376 376
 
377
-        $columnList[] = $discrColumnType->convertToDatabaseValueSQL($discrTableAlias . '.' . $quotedColumnName, $this->platform);
377
+        $columnList[] = $discrColumnType->convertToDatabaseValueSQL($discrTableAlias.'.'.$quotedColumnName, $this->platform);
378 378
 
379 379
         // sub tables
380 380
         foreach ($this->class->getSubClasses() as $subClassName) {
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
                             /** @var JoinColumnMetadata $joinColumn */
399 399
                             $referencedColumnName = $joinColumn->getReferencedColumnName();
400 400
 
401
-                            if (! $joinColumn->getType()) {
401
+                            if ( ! $joinColumn->getType()) {
402 402
                                 $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
403 403
                             }
404 404
 
@@ -448,7 +448,7 @@  discard block
 block discarded – undo
448 448
                         $columnName           = $joinColumn->getColumnName();
449 449
                         $referencedColumnName = $joinColumn->getReferencedColumnName();
450 450
 
451
-                        if (! $joinColumn->getType()) {
451
+                        if ( ! $joinColumn->getType()) {
452 452
                             $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
453 453
                         }
454 454
 
@@ -504,12 +504,12 @@  discard block
 block discarded – undo
504 504
             $conditions = [];
505 505
             $tableName  = $parentClass->table->getQuotedQualifiedName($this->platform);
506 506
             $tableAlias = $this->getSQLTableAlias($parentClass->getTableName());
507
-            $joinSql   .= ' INNER JOIN ' . $tableName . ' ' . $tableAlias . ' ON ';
507
+            $joinSql   .= ' INNER JOIN '.$tableName.' '.$tableAlias.' ON ';
508 508
 
509 509
             foreach ($identifierColumns as $idColumn) {
510 510
                 $quotedColumnName = $this->platform->quoteIdentifier($idColumn->getColumnName());
511 511
 
512
-                $conditions[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName;
512
+                $conditions[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName;
513 513
             }
514 514
 
515 515
             $joinSql .= implode(' AND ', $conditions);
@@ -521,12 +521,12 @@  discard block
 block discarded – undo
521 521
             $subClass   = $this->em->getClassMetadata($subClassName);
522 522
             $tableName  = $subClass->table->getQuotedQualifiedName($this->platform);
523 523
             $tableAlias = $this->getSQLTableAlias($subClass->getTableName());
524
-            $joinSql   .= ' LEFT JOIN ' . $tableName . ' ' . $tableAlias . ' ON ';
524
+            $joinSql   .= ' LEFT 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);
Please login to merge, or discard this patch.