Completed
Pull Request — master (#6208)
by Pierre
10:51
created
lib/Doctrine/ORM/Persisters/SqlExpressionVisitor.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -95,15 +95,15 @@
 block discarded – undo
95 95
             $expressionList[] = $this->dispatch($child);
96 96
         }
97 97
 
98
-        switch($expr->getType()) {
98
+        switch ($expr->getType()) {
99 99
             case CompositeExpression::TYPE_AND:
100
-                return '(' . implode(' AND ', $expressionList) . ')';
100
+                return '('.implode(' AND ', $expressionList).')';
101 101
 
102 102
             case CompositeExpression::TYPE_OR:
103
-                return '(' . implode(' OR ', $expressionList) . ')';
103
+                return '('.implode(' OR ', $expressionList).')';
104 104
 
105 105
             default:
106
-                throw new \RuntimeException("Unknown composite " . $expr->getType());
106
+                throw new \RuntimeException("Unknown composite ".$expr->getType());
107 107
         }
108 108
     }
109 109
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Persisters/PersisterException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
     static public function matchingAssocationFieldRequiresObject($class, $associationName)
30 30
     {
31 31
         return new self(sprintf(
32
-            "Cannot match on %s::%s with a non-object value. Matching objects by id is " .
32
+            "Cannot match on %s::%s with a non-object value. Matching objects by id is ".
33 33
             "not compatible with matching on an in-memory collection, which compares objects by reference.",
34 34
             $class, $associationName
35 35
         ));
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Persisters/Collection/OneToManyPersister.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -218,8 +218,8 @@  discard block
 block discarded – undo
218 218
             $parameters[] = $identifier[$sourceClass->getFieldForColumn($joinColumn['referencedColumnName'])];
219 219
         }
220 220
 
221
-        $statement = 'DELETE FROM ' . $this->quoteStrategy->getTableName($targetClass, $this->platform)
222
-            . ' WHERE ' . implode(' = ? AND ', $columns) . ' = ?';
221
+        $statement = 'DELETE FROM '.$this->quoteStrategy->getTableName($targetClass, $this->platform)
222
+            . ' WHERE '.implode(' = ? AND ', $columns).' = ?';
223 223
 
224 224
         return $this->conn->executeUpdate($statement, $parameters);
225 225
     }
@@ -256,18 +256,18 @@  discard block
 block discarded – undo
256 256
             );
257 257
         }
258 258
 
259
-        $statement = $this->platform->getCreateTemporaryTableSnippetSQL() . ' ' . $tempTable
260
-            . ' (' . $this->platform->getColumnDeclarationListSQL($columnDefinitions) . ')';
259
+        $statement = $this->platform->getCreateTemporaryTableSnippetSQL().' '.$tempTable
260
+            . ' ('.$this->platform->getColumnDeclarationListSQL($columnDefinitions).')';
261 261
 
262 262
         $this->conn->executeUpdate($statement);
263 263
 
264 264
         // 2) Build insert table records into temporary table
265 265
         $query = $this->em->createQuery(
266
-            ' SELECT t0.' . implode(', t0.', $rootClass->getIdentifierFieldNames())
267
-            . ' FROM ' . $targetClass->name . ' t0 WHERE t0.' . $mapping['mappedBy'] . ' = :owner'
266
+            ' SELECT t0.'.implode(', t0.', $rootClass->getIdentifierFieldNames())
267
+            . ' FROM '.$targetClass->name.' t0 WHERE t0.'.$mapping['mappedBy'].' = :owner'
268 268
         )->setParameter('owner', $collection->getOwner());
269 269
 
270
-        $statement  = 'INSERT INTO ' . $tempTable . ' (' . $idColumnList . ') ' . $query->getSQL();
270
+        $statement  = 'INSERT INTO '.$tempTable.' ('.$idColumnList.') '.$query->getSQL();
271 271
         $parameters = array_values($sourceClass->getIdentifierValues($collection->getOwner()));
272 272
         $numDeleted = $this->conn->executeUpdate($statement, $parameters);
273 273
 
@@ -276,8 +276,8 @@  discard block
 block discarded – undo
276 276
 
277 277
         foreach (array_reverse($classNames) as $className) {
278 278
             $tableName = $this->quoteStrategy->getTableName($this->em->getClassMetadata($className), $this->platform);
279
-            $statement = 'DELETE FROM ' . $tableName . ' WHERE (' . $idColumnList . ')'
280
-                . ' IN (SELECT ' . $idColumnList . ' FROM ' . $tempTable . ')';
279
+            $statement = 'DELETE FROM '.$tableName.' WHERE ('.$idColumnList.')'
280
+                . ' IN (SELECT '.$idColumnList.' FROM '.$tempTable.')';
281 281
 
282 282
             $this->conn->executeUpdate($statement);
283 283
         }
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -715,9 +715,9 @@
 block discarded – undo
715 715
         );
716 716
     }
717 717
 
718
-     /**
719
-     * {@inheritdoc}
720
-     */
718
+        /**
719
+         * {@inheritdoc}
720
+         */
721 721
     protected function getHash()
722 722
     {
723 723
         return sha1(parent::getHash(). '-'. $this->_firstResult . '-' . $this->_maxResults);
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -339,8 +339,8 @@  discard block
 block discarded – undo
339 339
 
340 340
         // FIXME: Order with composite keys might not be correct
341 341
         $sql = 'SELECT ' . $columnName
342
-             . ' FROM '  . $tableName
343
-             . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?';
342
+                . ' FROM '  . $tableName
343
+                . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?';
344 344
 
345 345
         $flatId = $this->identifierFlattener->flattenIdentifier($versionedClass, $id);
346 346
 
@@ -474,8 +474,8 @@  discard block
 block discarded – undo
474 474
         }
475 475
 
476 476
         $sql = 'UPDATE ' . $quotedTableName
477
-             . ' SET ' . implode(', ', $set)
478
-             . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?';
477
+                . ' SET ' . implode(', ', $set)
478
+                . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?';
479 479
 
480 480
         $result = $this->conn->executeUpdate($sql, $params, $types);
481 481
 
@@ -1528,9 +1528,9 @@  discard block
 block discarded – undo
1528 1528
         $lock  = $this->getLockTablesSql($lockMode);
1529 1529
         $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' ';
1530 1530
         $sql = 'SELECT 1 '
1531
-             . $lock
1532
-             . $where
1533
-             . $lockSql;
1531
+                . $lock
1532
+                . $where
1533
+                . $lockSql;
1534 1534
 
1535 1535
         list($params, $types) = $this->expandParameters($criteria);
1536 1536
 
@@ -1981,8 +1981,8 @@  discard block
 block discarded – undo
1981 1981
         $alias = $this->getSQLTableAlias($this->class->name);
1982 1982
 
1983 1983
         $sql = 'SELECT 1 '
1984
-             . $this->getLockTablesSql(null)
1985
-             . ' WHERE ' . $this->getSelectConditionSQL($criteria);
1984
+                . $this->getLockTablesSql(null)
1985
+                . ' WHERE ' . $this->getSelectConditionSQL($criteria);
1986 1986
 
1987 1987
         list($params, $types) = $this->expandParameters($criteria);
1988 1988
 
@@ -2012,9 +2012,9 @@  discard block
 block discarded – undo
2012 2012
     {
2013 2013
         // if one of the join columns is nullable, return left join
2014 2014
         foreach ($joinColumns as $joinColumn) {
2015
-             if ( ! isset($joinColumn['nullable']) || $joinColumn['nullable']) {
2016
-                 return 'LEFT JOIN';
2017
-             }
2015
+                if ( ! isset($joinColumn['nullable']) || $joinColumn['nullable']) {
2016
+                    return 'LEFT JOIN';
2017
+                }
2018 2018
         }
2019 2019
 
2020 2020
         return 'INNER JOIN';
Please login to merge, or discard this patch.
Spacing   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -338,9 +338,9 @@  discard block
 block discarded – undo
338 338
         $columnName   = $this->quoteStrategy->getColumnName($versionField, $versionedClass, $this->platform);
339 339
 
340 340
         // FIXME: Order with composite keys might not be correct
341
-        $sql = 'SELECT ' . $columnName
342
-             . ' FROM '  . $tableName
343
-             . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?';
341
+        $sql = 'SELECT '.$columnName
342
+             . ' FROM '.$tableName
343
+             . ' WHERE '.implode(' = ? AND ', $identifier).' = ?';
344 344
 
345 345
         $flatId = $this->identifierFlattener->flattenIdentifier($versionedClass, $id);
346 346
 
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
             }
417 417
 
418 418
             $params[]   = $value;
419
-            $set[]      = $column . ' = ' . $placeholder;
419
+            $set[]      = $column.' = '.$placeholder;
420 420
             $types[]    = $this->columnTypes[$columnName];
421 421
         }
422 422
 
@@ -464,18 +464,18 @@  discard block
 block discarded – undo
464 464
                 case Type::SMALLINT:
465 465
                 case Type::INTEGER:
466 466
                 case Type::BIGINT:
467
-                    $set[] = $versionColumn . ' = ' . $versionColumn . ' + 1';
467
+                    $set[] = $versionColumn.' = '.$versionColumn.' + 1';
468 468
                     break;
469 469
 
470 470
                 case Type::DATETIME:
471
-                    $set[] = $versionColumn . ' = CURRENT_TIMESTAMP';
471
+                    $set[] = $versionColumn.' = CURRENT_TIMESTAMP';
472 472
                     break;
473 473
             }
474 474
         }
475 475
 
476
-        $sql = 'UPDATE ' . $quotedTableName
477
-             . ' SET ' . implode(', ', $set)
478
-             . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?';
476
+        $sql = 'UPDATE '.$quotedTableName
477
+             . ' SET '.implode(', ', $set)
478
+             . ' WHERE '.implode(' = ? AND ', $where).' = ?';
479 479
 
480 480
         $result = $this->conn->executeUpdate($sql, $params, $types);
481 481
 
@@ -518,7 +518,7 @@  discard block
 block discarded – undo
518 518
 
519 519
 
520 520
             if ($selfReferential) {
521
-                $otherColumns = (! $mapping['isOwningSide'])
521
+                $otherColumns = ( ! $mapping['isOwningSide'])
522 522
                     ? $association['joinTable']['joinColumns']
523 523
                     : $association['joinTable']['inverseJoinColumns'];
524 524
             }
@@ -556,7 +556,7 @@  discard block
 block discarded – undo
556 556
         $tableName  = $this->quoteStrategy->getTableName($class, $this->platform);
557 557
         $idColumns  = $this->quoteStrategy->getIdentifierColumnNames($class, $this->platform);
558 558
         $id         = array_combine($idColumns, $identifier);
559
-        $types      = array_map(function ($identifier) use ($class, $self) {
559
+        $types      = array_map(function($identifier) use ($class, $self) {
560 560
             if (isset($class->fieldMappings[$identifier])) {
561 561
                 return $class->fieldMappings[$identifier]['type'];
562 562
             }
@@ -783,7 +783,7 @@  discard block
 block discarded – undo
783 783
 
784 784
             // unset the old value and set the new sql aliased value here. By definition
785 785
             // unset($identifier[$targetKeyColumn] works here with how UnitOfWork::createEntity() calls this method.
786
-            $identifier[$this->getSQLTableAlias($targetClass->name) . "." . $targetKeyColumn] =
786
+            $identifier[$this->getSQLTableAlias($targetClass->name).".".$targetKeyColumn] =
787 787
                 $sourceClass->reflFields[$sourceClass->fieldNames[$sourceKeyColumn]]->getValue($sourceEntity);
788 788
 
789 789
             unset($identifier[$targetKeyColumn]);
@@ -1019,7 +1019,7 @@  discard block
 block discarded – undo
1019 1019
                     );
1020 1020
             }
1021 1021
 
1022
-            $criteria[$quotedJoinTable . '.' . $quotedKeyColumn] = $value;
1022
+            $criteria[$quotedJoinTable.'.'.$quotedKeyColumn] = $value;
1023 1023
             $parameters[] = [
1024 1024
                 'value' => $value,
1025 1025
                 'field' => $field,
@@ -1062,11 +1062,11 @@  discard block
 block discarded – undo
1062 1062
 
1063 1063
         switch ($lockMode) {
1064 1064
             case LockMode::PESSIMISTIC_READ:
1065
-                $lockSql = ' ' . $this->platform->getReadLockSql();
1065
+                $lockSql = ' '.$this->platform->getReadLockSql();
1066 1066
                 break;
1067 1067
 
1068 1068
             case LockMode::PESSIMISTIC_WRITE:
1069
-                $lockSql = ' ' . $this->platform->getWriteLockSql();
1069
+                $lockSql = ' '.$this->platform->getWriteLockSql();
1070 1070
                 break;
1071 1071
         }
1072 1072
 
@@ -1077,14 +1077,14 @@  discard block
 block discarded – undo
1077 1077
 
1078 1078
         if ('' !== $filterSql) {
1079 1079
             $conditionSql = $conditionSql
1080
-                ? $conditionSql . ' AND ' . $filterSql
1080
+                ? $conditionSql.' AND '.$filterSql
1081 1081
                 : $filterSql;
1082 1082
         }
1083 1083
 
1084
-        $select = 'SELECT ' . $columnList;
1085
-        $from   = ' FROM ' . $tableName . ' '. $tableAlias;
1086
-        $join   = $this->currentPersisterContext->selectJoinSql . $joinSql;
1087
-        $where  = ($conditionSql ? ' WHERE ' . $conditionSql : '');
1084
+        $select = 'SELECT '.$columnList;
1085
+        $from   = ' FROM '.$tableName.' '.$tableAlias;
1086
+        $join   = $this->currentPersisterContext->selectJoinSql.$joinSql;
1087
+        $where  = ($conditionSql ? ' WHERE '.$conditionSql : '');
1088 1088
         $lock   = $this->platform->appendLockHint($from, $lockMode);
1089 1089
         $query  = $select
1090 1090
             . $lock
@@ -1092,7 +1092,7 @@  discard block
 block discarded – undo
1092 1092
             . $where
1093 1093
             . $orderBySql;
1094 1094
 
1095
-        return $this->platform->modifyLimitQuery($query, $limit, $offset) . $lockSql;
1095
+        return $this->platform->modifyLimitQuery($query, $limit, $offset).$lockSql;
1096 1096
     }
1097 1097
 
1098 1098
     /**
@@ -1111,13 +1111,13 @@  discard block
 block discarded – undo
1111 1111
 
1112 1112
         if ('' !== $filterSql) {
1113 1113
             $conditionSql = $conditionSql
1114
-                ? $conditionSql . ' AND ' . $filterSql
1114
+                ? $conditionSql.' AND '.$filterSql
1115 1115
                 : $filterSql;
1116 1116
         }
1117 1117
 
1118 1118
         $sql = 'SELECT COUNT(*) '
1119
-            . 'FROM ' . $tableName . ' ' . $tableAlias
1120
-            . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql);
1119
+            . 'FROM '.$tableName.' '.$tableAlias
1120
+            . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql);
1121 1121
 
1122 1122
         return $sql;
1123 1123
     }
@@ -1150,7 +1150,7 @@  discard block
 block discarded – undo
1150 1150
                     : $baseTableAlias;
1151 1151
 
1152 1152
                 $columnName    = $this->quoteStrategy->getColumnName($fieldName, $this->class, $this->platform);
1153
-                $orderByList[] = $tableAlias . '.' . $columnName . ' ' . $orientation;
1153
+                $orderByList[] = $tableAlias.'.'.$columnName.' '.$orientation;
1154 1154
 
1155 1155
                 continue;
1156 1156
             }
@@ -1167,7 +1167,7 @@  discard block
 block discarded – undo
1167 1167
 
1168 1168
                 foreach ($this->class->associationMappings[$fieldName]['joinColumns'] as $joinColumn) {
1169 1169
                     $columnName    = $this->quoteStrategy->getJoinColumnName($joinColumn, $this->class, $this->platform);
1170
-                    $orderByList[] = $tableAlias . '.' . $columnName . ' ' . $orientation;
1170
+                    $orderByList[] = $tableAlias.'.'.$columnName.' '.$orientation;
1171 1171
                 }
1172 1172
 
1173 1173
                 continue;
@@ -1176,7 +1176,7 @@  discard block
 block discarded – undo
1176 1176
             throw ORMException::unrecognizedField($fieldName);
1177 1177
         }
1178 1178
 
1179
-        return ' ORDER BY ' . implode(', ', $orderByList);
1179
+        return ' ORDER BY '.implode(', ', $orderByList);
1180 1180
     }
1181 1181
 
1182 1182
     /**
@@ -1204,8 +1204,8 @@  discard block
 block discarded – undo
1204 1204
             $columnList[] = $this->getSelectColumnSQL($field, $this->class);
1205 1205
         }
1206 1206
 
1207
-        $this->currentPersisterContext->selectJoinSql    = '';
1208
-        $eagerAliasCounter      = 0;
1207
+        $this->currentPersisterContext->selectJoinSql = '';
1208
+        $eagerAliasCounter = 0;
1209 1209
 
1210 1210
         foreach ($this->class->associationMappings as $assocField => $assoc) {
1211 1211
             $assocColumnSQL = $this->getSelectColumnAssociationSQL($assocField, $assoc, $this->class);
@@ -1231,7 +1231,7 @@  discard block
 block discarded – undo
1231 1231
                 continue; // now this is why you shouldn't use inheritance
1232 1232
             }
1233 1233
 
1234
-            $assocAlias = 'e' . ($eagerAliasCounter++);
1234
+            $assocAlias = 'e'.($eagerAliasCounter++);
1235 1235
             $this->currentPersisterContext->rsm->addJoinedEntityResult($assoc['targetEntity'], $assocAlias, 'r', $assocField);
1236 1236
 
1237 1237
             foreach ($eagerEntity->fieldNames as $field) {
@@ -1264,14 +1264,14 @@  discard block
 block discarded – undo
1264 1264
             $joinTableName  = $this->quoteStrategy->getTableName($eagerEntity, $this->platform);
1265 1265
 
1266 1266
             if ($assoc['isOwningSide']) {
1267
-                $tableAlias           = $this->getSQLTableAlias($association['targetEntity'], $assocAlias);
1268
-                $this->currentPersisterContext->selectJoinSql .= ' ' . $this->getJoinSQLForJoinColumns($association['joinColumns']);
1267
+                $tableAlias = $this->getSQLTableAlias($association['targetEntity'], $assocAlias);
1268
+                $this->currentPersisterContext->selectJoinSql .= ' '.$this->getJoinSQLForJoinColumns($association['joinColumns']);
1269 1269
 
1270 1270
                 foreach ($association['joinColumns'] as $joinColumn) {
1271 1271
                     $sourceCol       = $this->quoteStrategy->getJoinColumnName($joinColumn, $this->class, $this->platform);
1272 1272
                     $targetCol       = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $this->class, $this->platform);
1273 1273
                     $joinCondition[] = $this->getSQLTableAlias($association['sourceEntity'])
1274
-                                        . '.' . $sourceCol . ' = ' . $tableAlias . '.' . $targetCol;
1274
+                                        . '.'.$sourceCol.' = '.$tableAlias.'.'.$targetCol;
1275 1275
                 }
1276 1276
 
1277 1277
                 // Add filter SQL
@@ -1287,12 +1287,12 @@  discard block
 block discarded – undo
1287 1287
                     $sourceCol       = $this->quoteStrategy->getJoinColumnName($joinColumn, $this->class, $this->platform);
1288 1288
                     $targetCol       = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $this->class, $this->platform);
1289 1289
 
1290
-                    $joinCondition[] = $this->getSQLTableAlias($association['sourceEntity'], $assocAlias) . '.' . $sourceCol . ' = '
1291
-                        . $this->getSQLTableAlias($association['targetEntity']) . '.' . $targetCol;
1290
+                    $joinCondition[] = $this->getSQLTableAlias($association['sourceEntity'], $assocAlias).'.'.$sourceCol.' = '
1291
+                        . $this->getSQLTableAlias($association['targetEntity']).'.'.$targetCol;
1292 1292
                 }
1293 1293
             }
1294 1294
 
1295
-            $this->currentPersisterContext->selectJoinSql .= ' ' . $joinTableName . ' ' . $joinTableAlias . ' ON ';
1295
+            $this->currentPersisterContext->selectJoinSql .= ' '.$joinTableName.' '.$joinTableAlias.' ON ';
1296 1296
             $this->currentPersisterContext->selectJoinSql .= implode(' AND ', $joinCondition);
1297 1297
         }
1298 1298
 
@@ -1313,7 +1313,7 @@  discard block
 block discarded – undo
1313 1313
      */
1314 1314
     protected function getSelectColumnAssociationSQL($field, $assoc, ClassMetadata $class, $alias = 'r')
1315 1315
     {
1316
-        if ( ! ($assoc['isOwningSide'] && $assoc['type'] & ClassMetadata::TO_ONE) ) {
1316
+        if ( ! ($assoc['isOwningSide'] && $assoc['type'] & ClassMetadata::TO_ONE)) {
1317 1317
             return '';
1318 1318
         }
1319 1319
 
@@ -1362,10 +1362,10 @@  discard block
 block discarded – undo
1362 1362
         foreach ($joinColumns as $joinColumn) {
1363 1363
             $quotedSourceColumn = $this->quoteStrategy->getJoinColumnName($joinColumn, $this->class, $this->platform);
1364 1364
             $quotedTargetColumn = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $this->class, $this->platform);
1365
-            $conditions[]       = $sourceTableAlias . '.' . $quotedTargetColumn . ' = ' . $joinTableName . '.' . $quotedSourceColumn;
1365
+            $conditions[]       = $sourceTableAlias.'.'.$quotedTargetColumn.' = '.$joinTableName.'.'.$quotedSourceColumn;
1366 1366
         }
1367 1367
 
1368
-        return ' INNER JOIN ' . $joinTableName . ' ON ' . implode(' AND ', $conditions);
1368
+        return ' INNER JOIN '.$joinTableName.' ON '.implode(' AND ', $conditions);
1369 1369
     }
1370 1370
 
1371 1371
     /**
@@ -1444,7 +1444,7 @@  discard block
 block discarded – undo
1444 1444
                 continue;
1445 1445
             }
1446 1446
 
1447
-            if (! $this->class->isIdGeneratorIdentity() || $this->class->identifier[0] != $name) {
1447
+            if ( ! $this->class->isIdGeneratorIdentity() || $this->class->identifier[0] != $name) {
1448 1448
                 $columns[]                = $this->quoteStrategy->getColumnName($name, $this->class, $this->platform);
1449 1449
                 $this->columnTypes[$name] = $this->class->fieldMappings[$name]['type'];
1450 1450
             }
@@ -1465,7 +1465,7 @@  discard block
 block discarded – undo
1465 1465
      */
1466 1466
     protected function getSelectColumnSQL($field, ClassMetadata $class, $alias = 'r')
1467 1467
     {
1468
-        $root         = $alias == 'r' ? '' : $alias ;
1468
+        $root         = $alias == 'r' ? '' : $alias;
1469 1469
         $tableAlias   = $this->getSQLTableAlias($class->name, $root);
1470 1470
         $fieldMapping = $class->fieldMappings[$field];
1471 1471
         $sql          = sprintf('%s.%s', $tableAlias, $this->quoteStrategy->getColumnName($field, $class, $this->platform));
@@ -1478,7 +1478,7 @@  discard block
 block discarded – undo
1478 1478
             $sql  = $type->convertToPHPValueSQL($sql, $this->platform);
1479 1479
         }
1480 1480
 
1481
-        return $sql . ' AS ' . $columnAlias;
1481
+        return $sql.' AS '.$columnAlias;
1482 1482
     }
1483 1483
 
1484 1484
     /**
@@ -1494,14 +1494,14 @@  discard block
 block discarded – undo
1494 1494
     protected function getSQLTableAlias($className, $assocName = '')
1495 1495
     {
1496 1496
         if ($assocName) {
1497
-            $className .= '#' . $assocName;
1497
+            $className .= '#'.$assocName;
1498 1498
         }
1499 1499
 
1500 1500
         if (isset($this->currentPersisterContext->sqlTableAliases[$className])) {
1501 1501
             return $this->currentPersisterContext->sqlTableAliases[$className];
1502 1502
         }
1503 1503
 
1504
-        $tableAlias = 't' . $this->currentPersisterContext->sqlAliasCounter++;
1504
+        $tableAlias = 't'.$this->currentPersisterContext->sqlAliasCounter++;
1505 1505
 
1506 1506
         $this->currentPersisterContext->sqlTableAliases[$className] = $tableAlias;
1507 1507
 
@@ -1528,7 +1528,7 @@  discard block
 block discarded – undo
1528 1528
         }
1529 1529
 
1530 1530
         $lock  = $this->getLockTablesSql($lockMode);
1531
-        $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' ';
1531
+        $where = ($conditionSql ? ' WHERE '.$conditionSql : '').' ';
1532 1532
         $sql = 'SELECT 1 '
1533 1533
              . $lock
1534 1534
              . $where
@@ -1550,7 +1550,7 @@  discard block
 block discarded – undo
1550 1550
     {
1551 1551
         return $this->platform->appendLockHint(
1552 1552
             'FROM '
1553
-            . $this->quoteStrategy->getTableName($this->class, $this->platform) . ' '
1553
+            . $this->quoteStrategy->getTableName($this->class, $this->platform).' '
1554 1554
             . $this->getSQLTableAlias($this->class->name),
1555 1555
             $lockMode
1556 1556
         );
@@ -1602,19 +1602,19 @@  discard block
 block discarded – undo
1602 1602
 
1603 1603
             if (null !== $comparison) {
1604 1604
                 // special case null value handling
1605
-                if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && null ===$value) {
1606
-                    $selectedColumns[] = $column . ' IS NULL';
1605
+                if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && null === $value) {
1606
+                    $selectedColumns[] = $column.' IS NULL';
1607 1607
 
1608 1608
                     continue;
1609 1609
                 }
1610 1610
 
1611 1611
                 if ($comparison === Comparison::NEQ && null === $value) {
1612
-                    $selectedColumns[] = $column . ' IS NOT NULL';
1612
+                    $selectedColumns[] = $column.' IS NOT NULL';
1613 1613
 
1614 1614
                     continue;
1615 1615
                 }
1616 1616
 
1617
-                $selectedColumns[] = $column . ' ' . sprintf(self::$comparisonMap[$comparison], $placeholder);
1617
+                $selectedColumns[] = $column.' '.sprintf(self::$comparisonMap[$comparison], $placeholder);
1618 1618
 
1619 1619
                 continue;
1620 1620
             }
@@ -1662,7 +1662,7 @@  discard block
 block discarded – undo
1662 1662
                 ? $this->class->fieldMappings[$field]['inherited']
1663 1663
                 : $this->class->name;
1664 1664
 
1665
-            return [$this->getSQLTableAlias($className) . '.' . $this->quoteStrategy->getColumnName($field, $this->class, $this->platform)];
1665
+            return [$this->getSQLTableAlias($className).'.'.$this->quoteStrategy->getColumnName($field, $this->class, $this->platform)];
1666 1666
         }
1667 1667
 
1668 1668
         if (isset($this->class->associationMappings[$field])) {
@@ -1683,7 +1683,7 @@  discard block
 block discarded – undo
1683 1683
 
1684 1684
 
1685 1685
                 foreach ($joinColumns as $joinColumn) {
1686
-                    $columns[] = $joinTableName . '.' . $this->quoteStrategy->getJoinColumnName($joinColumn, $class, $this->platform);
1686
+                    $columns[] = $joinTableName.'.'.$this->quoteStrategy->getJoinColumnName($joinColumn, $class, $this->platform);
1687 1687
                 }
1688 1688
 
1689 1689
             } else {
@@ -1691,12 +1691,12 @@  discard block
 block discarded – undo
1691 1691
                     throw ORMException::invalidFindByInverseAssociation($this->class->name, $field);
1692 1692
                 }
1693 1693
 
1694
-                $className  = (isset($association['inherited']))
1694
+                $className = (isset($association['inherited']))
1695 1695
                     ? $association['inherited']
1696 1696
                     : $this->class->name;
1697 1697
 
1698 1698
                 foreach ($association['joinColumns'] as $joinColumn) {
1699
-                    $columns[] = $this->getSQLTableAlias($className) . '.' . $this->quoteStrategy->getJoinColumnName($joinColumn, $this->class, $this->platform);
1699
+                    $columns[] = $this->getSQLTableAlias($className).'.'.$this->quoteStrategy->getJoinColumnName($joinColumn, $this->class, $this->platform);
1700 1700
                 }
1701 1701
             }
1702 1702
             return $columns;
@@ -1788,7 +1788,7 @@  discard block
 block discarded – undo
1788 1788
                     $value = $value[$this->em->getClassMetadata($sourceClass->associationMappings[$field]['targetEntity'])->identifier[0]];
1789 1789
                 }
1790 1790
 
1791
-                $criteria[$tableAlias . "." . $targetKeyColumn] = $value;
1791
+                $criteria[$tableAlias.".".$targetKeyColumn] = $value;
1792 1792
                 $parameters[]                                   = [
1793 1793
                     'value' => $value,
1794 1794
                     'field' => $field,
@@ -1801,7 +1801,7 @@  discard block
 block discarded – undo
1801 1801
             $field = $sourceClass->fieldNames[$sourceKeyColumn];
1802 1802
             $value = $sourceClass->reflFields[$field]->getValue($sourceEntity);
1803 1803
 
1804
-            $criteria[$tableAlias . "." . $targetKeyColumn] = $value;
1804
+            $criteria[$tableAlias.".".$targetKeyColumn] = $value;
1805 1805
             $parameters[] = [
1806 1806
                 'value' => $value,
1807 1807
                 'field' => $field,
@@ -1888,7 +1888,7 @@  discard block
 block discarded – undo
1888 1888
                 $assoc = $class->associationMappings[$field];
1889 1889
                 $class = $this->em->getClassMetadata($assoc['targetEntity']);
1890 1890
 
1891
-                if (! $assoc['isOwningSide']) {
1891
+                if ( ! $assoc['isOwningSide']) {
1892 1892
                     $assoc = $class->associationMappings[$assoc['mappedBy']];
1893 1893
                     $class = $this->em->getClassMetadata($assoc['targetEntity']);
1894 1894
                 }
@@ -1897,7 +1897,7 @@  discard block
 block discarded – undo
1897 1897
                     ? $assoc['relationToTargetKeyColumns']
1898 1898
                     : $assoc['sourceToTargetKeyColumns'];
1899 1899
 
1900
-                foreach ($columns as $column){
1900
+                foreach ($columns as $column) {
1901 1901
                     $types[] = PersisterHelper::getTypeOfColumn($column, $class, $this->em);
1902 1902
                 }
1903 1903
                 break;
@@ -1908,7 +1908,7 @@  discard block
 block discarded – undo
1908 1908
         }
1909 1909
 
1910 1910
         if (is_array($value)) {
1911
-            return array_map(function ($type) {
1911
+            return array_map(function($type) {
1912 1912
                 $type = Type::getType($type);
1913 1913
 
1914 1914
                 return $type->getBindingType() + Connection::ARRAY_PARAM_OFFSET;
@@ -1984,12 +1984,12 @@  discard block
 block discarded – undo
1984 1984
 
1985 1985
         $sql = 'SELECT 1 '
1986 1986
              . $this->getLockTablesSql(null)
1987
-             . ' WHERE ' . $this->getSelectConditionSQL($criteria);
1987
+             . ' WHERE '.$this->getSelectConditionSQL($criteria);
1988 1988
 
1989 1989
         list($params, $types) = $this->expandParameters($criteria);
1990 1990
 
1991 1991
         if (null !== $extraConditions) {
1992
-            $sql                                 .= ' AND ' . $this->getSelectConditionCriteriaSQL($extraConditions);
1992
+            $sql                                 .= ' AND '.$this->getSelectConditionCriteriaSQL($extraConditions);
1993 1993
             list($criteriaParams, $criteriaTypes) = $this->expandCriteriaParameters($extraConditions);
1994 1994
 
1995 1995
             $params = array_merge($params, $criteriaParams);
@@ -1997,7 +1997,7 @@  discard block
 block discarded – undo
1997 1997
         }
1998 1998
 
1999 1999
         if ($filterSql = $this->generateFilterConditionSQL($this->class, $alias)) {
2000
-            $sql .= ' AND ' . $filterSql;
2000
+            $sql .= ' AND '.$filterSql;
2001 2001
         }
2002 2002
 
2003 2003
         return (bool) $this->conn->fetchColumn($sql, $params, 0, $types);
@@ -2044,13 +2044,13 @@  discard block
 block discarded – undo
2044 2044
 
2045 2045
         foreach ($this->em->getFilters()->getEnabledFilters() as $filter) {
2046 2046
             if ('' !== $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias)) {
2047
-                $filterClauses[] = '(' . $filterExpr . ')';
2047
+                $filterClauses[] = '('.$filterExpr.')';
2048 2048
             }
2049 2049
         }
2050 2050
 
2051 2051
         $sql = implode(' AND ', $filterClauses);
2052 2052
 
2053
-        return $sql ? "(" . $sql . ")" : ""; // Wrap again to avoid "X or Y and FilterConditionSQL"
2053
+        return $sql ? "(".$sql.")" : ""; // Wrap again to avoid "X or Y and FilterConditionSQL"
2054 2054
     }
2055 2055
 
2056 2056
     /**
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Persisters/Entity/EntityPersister.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -47,17 +47,17 @@
 block discarded – undo
47 47
      * Get all queued inserts.
48 48
      *
49 49
      * @return array
50
-    */
50
+     */
51 51
     public function getInserts();
52 52
 
53
-     /**
54
-     * @TODO - It should not be here.
55
-     * But its necessary since JoinedSubclassPersister#executeInserts invoke the root persister.
56
-     *
57
-     * Gets the INSERT SQL used by the persister to persist a new entity.
58
-     *
59
-     * @return string
60
-     */
53
+        /**
54
+         * @TODO - It should not be here.
55
+         * But its necessary since JoinedSubclassPersister#executeInserts invoke the root persister.
56
+         *
57
+         * Gets the INSERT SQL used by the persister to persist a new entity.
58
+         *
59
+         * @return string
60
+         */
61 61
     public function getInsertSQL();
62 62
 
63 63
     /**
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Persisters/Entity/SingleTablePersister.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
57 57
         $rootClass  = $this->em->getClassMetadata($this->class->rootEntityName);
58 58
         $tableAlias = $this->getSQLTableAlias($rootClass->name);
59 59
 
60
-         // Append discriminator column
60
+            // Append discriminator column
61 61
         $discrColumn     = $this->class->discriminatorColumn['name'];
62 62
         $discrColumnType = $this->class->discriminatorColumn['type'];
63 63
 
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
         $discrColumn     = $this->class->discriminatorColumn['name'];
62 62
         $discrColumnType = $this->class->discriminatorColumn['type'];
63 63
 
64
-        $columnList[]   = $tableAlias . '.' . $discrColumn;
64
+        $columnList[] = $tableAlias.'.'.$discrColumn;
65 65
 
66 66
         $resultColumnName = $this->platform->getSQLResultCasing($discrColumn);
67 67
 
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
             $conditionSql .= ' AND ';
143 143
         }
144 144
 
145
-        return $conditionSql . $this->getSelectConditionDiscriminatorValueSQL();
145
+        return $conditionSql.$this->getSelectConditionDiscriminatorValueSQL();
146 146
     }
147 147
 
148 148
     /**
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
             $conditionSql .= ' AND ';
157 157
         }
158 158
 
159
-        return $conditionSql . $this->getSelectConditionDiscriminatorValueSQL();
159
+        return $conditionSql.$this->getSelectConditionDiscriminatorValueSQL();
160 160
     }
161 161
 
162 162
     /**
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
         $discColumn = $this->class->discriminatorColumn['name'];
181 181
         $tableAlias = $this->getSQLTableAlias($this->class->name);
182 182
 
183
-        return $tableAlias . '.' . $discColumn . ' IN (' . $values . ')';
183
+        return $tableAlias.'.'.$discColumn.' IN ('.$values.')';
184 184
     }
185 185
 
186 186
     /**
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Persisters/Entity/AbstractEntityInheritancePersister.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
             $sql    = $type->convertToPHPValueSQL($sql, $this->platform);
77 77
         }
78 78
 
79
-        return $sql . ' AS ' . $columnAlias;
79
+        return $sql.' AS '.$columnAlias;
80 80
     }
81 81
 
82 82
     /**
@@ -93,6 +93,6 @@  discard block
 block discarded – undo
93 93
 
94 94
         $this->currentPersisterContext->rsm->addMetaResult('r', $columnAlias, $joinColumnName, false, $type);
95 95
 
96
-        return $tableAlias . '.' . $joinColumnName . ' AS ' . $columnAlias;
96
+        return $tableAlias.'.'.$joinColumnName.' AS '.$columnAlias;
97 97
     }
98 98
 }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Persisters/Entity/JoinedSubclassPersister.php 2 patches
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
                 }
209 209
 
210 210
                 foreach ($data as $columnName => $value) {
211
-                    if (!is_array($id) || !isset($id[$columnName])) {
211
+                    if ( ! is_array($id) || ! isset($id[$columnName])) {
212 212
                         $stmt->bindValue($paramIndex++, $value, $this->columnTypes[$columnName]);
213 213
                     }
214 214
                 }
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
         // If the current class in the root entity, add the filters
324 324
         if ($filterSql = $this->generateFilterConditionSQL($this->em->getClassMetadata($this->class->rootEntityName), $this->getSQLTableAlias($this->class->rootEntityName))) {
325 325
             $conditionSql .= $conditionSql
326
-                ? ' AND ' . $filterSql
326
+                ? ' AND '.$filterSql
327 327
                 : $filterSql;
328 328
         }
329 329
 
@@ -342,29 +342,29 @@  discard block
 block discarded – undo
342 342
         switch ($lockMode) {
343 343
             case LockMode::PESSIMISTIC_READ:
344 344
 
345
-                $lockSql = ' ' . $this->platform->getReadLockSql();
345
+                $lockSql = ' '.$this->platform->getReadLockSql();
346 346
 
347 347
                 break;
348 348
 
349 349
             case LockMode::PESSIMISTIC_WRITE:
350 350
 
351
-                $lockSql = ' ' . $this->platform->getWriteLockSql();
351
+                $lockSql = ' '.$this->platform->getWriteLockSql();
352 352
 
353 353
                 break;
354 354
         }
355 355
 
356 356
         $tableName  = $this->quoteStrategy->getTableName($this->class, $this->platform);
357
-        $from       = ' FROM ' . $tableName . ' ' . $baseTableAlias;
358
-        $where      = $conditionSql != '' ? ' WHERE ' . $conditionSql : '';
357
+        $from       = ' FROM '.$tableName.' '.$baseTableAlias;
358
+        $where      = $conditionSql != '' ? ' WHERE '.$conditionSql : '';
359 359
         $lock       = $this->platform->appendLockHint($from, $lockMode);
360 360
         $columnList = $this->getSelectColumnsSQL();
361
-        $query      = 'SELECT '  . $columnList
361
+        $query      = 'SELECT '.$columnList
362 362
                     . $lock
363 363
                     . $joinSql
364 364
                     . $where
365 365
                     . $orderBySql;
366 366
 
367
-        return $this->platform->modifyLimitQuery($query, $limit, $offset) . $lockSql;
367
+        return $this->platform->modifyLimitQuery($query, $limit, $offset).$lockSql;
368 368
     }
369 369
 
370 370
     /**
@@ -384,14 +384,14 @@  discard block
 block discarded – undo
384 384
 
385 385
         if ('' !== $filterSql) {
386 386
             $conditionSql = $conditionSql
387
-                ? $conditionSql . ' AND ' . $filterSql
387
+                ? $conditionSql.' AND '.$filterSql
388 388
                 : $filterSql;
389 389
         }
390 390
 
391 391
         $sql = 'SELECT COUNT(*) '
392
-            . 'FROM ' . $tableName . ' ' . $baseTableAlias
392
+            . 'FROM '.$tableName.' '.$baseTableAlias
393 393
             . $joinSql
394
-            . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql);
394
+            . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql);
395 395
 
396 396
         return $sql;
397 397
     }
@@ -410,16 +410,16 @@  discard block
 block discarded – undo
410 410
             $conditions     = array();
411 411
             $tableAlias     = $this->getSQLTableAlias($parentClassName);
412 412
             $parentClass    = $this->em->getClassMetadata($parentClassName);
413
-            $joinSql       .= ' INNER JOIN ' . $this->quoteStrategy->getTableName($parentClass, $this->platform) . ' ' . $tableAlias . ' ON ';
413
+            $joinSql       .= ' INNER JOIN '.$this->quoteStrategy->getTableName($parentClass, $this->platform).' '.$tableAlias.' ON ';
414 414
 
415 415
             foreach ($identifierColumns as $idColumn) {
416
-                $conditions[] = $baseTableAlias . '.' . $idColumn . ' = ' . $tableAlias . '.' . $idColumn;
416
+                $conditions[] = $baseTableAlias.'.'.$idColumn.' = '.$tableAlias.'.'.$idColumn;
417 417
             }
418 418
 
419 419
             $joinSql .= implode(' AND ', $conditions);
420 420
         }
421 421
 
422
-        return parent::getLockTablesSql($lockMode) . $joinSql;
422
+        return parent::getLockTablesSql($lockMode).$joinSql;
423 423
     }
424 424
 
425 425
     /**
@@ -488,7 +488,7 @@  discard block
 block discarded – undo
488 488
             ? $baseTableAlias
489 489
             : $this->getSQLTableAlias($this->class->rootEntityName);
490 490
 
491
-        $columnList[] = $tableAlias . '.' . $discrColumn;
491
+        $columnList[] = $tableAlias.'.'.$discrColumn;
492 492
 
493 493
         // sub tables
494 494
         foreach ($this->class->subClasses as $subClassName) {
@@ -603,11 +603,11 @@  discard block
 block discarded – undo
603 603
             $conditions   = array();
604 604
             $parentClass  = $this->em->getClassMetadata($parentClassName);
605 605
             $tableAlias   = $this->getSQLTableAlias($parentClassName);
606
-            $joinSql     .= ' INNER JOIN ' . $this->quoteStrategy->getTableName($parentClass, $this->platform) . ' ' . $tableAlias . ' ON ';
606
+            $joinSql     .= ' INNER JOIN '.$this->quoteStrategy->getTableName($parentClass, $this->platform).' '.$tableAlias.' ON ';
607 607
 
608 608
 
609 609
             foreach ($identifierColumn as $idColumn) {
610
-                $conditions[] = $baseTableAlias . '.' . $idColumn . ' = ' . $tableAlias . '.' . $idColumn;
610
+                $conditions[] = $baseTableAlias.'.'.$idColumn.' = '.$tableAlias.'.'.$idColumn;
611 611
             }
612 612
 
613 613
             $joinSql .= implode(' AND ', $conditions);
@@ -618,10 +618,10 @@  discard block
 block discarded – undo
618 618
             $conditions  = array();
619 619
             $subClass    = $this->em->getClassMetadata($subClassName);
620 620
             $tableAlias  = $this->getSQLTableAlias($subClassName);
621
-            $joinSql    .= ' LEFT JOIN ' . $this->quoteStrategy->getTableName($subClass, $this->platform) . ' ' . $tableAlias . ' ON ';
621
+            $joinSql    .= ' LEFT JOIN '.$this->quoteStrategy->getTableName($subClass, $this->platform).' '.$tableAlias.' ON ';
622 622
 
623 623
             foreach ($identifierColumn as $idColumn) {
624
-                $conditions[] = $baseTableAlias . '.' . $idColumn . ' = ' . $tableAlias . '.' . $idColumn;
624
+                $conditions[] = $baseTableAlias.'.'.$idColumn.' = '.$tableAlias.'.'.$idColumn;
625 625
             }
626 626
 
627 627
             $joinSql .= implode(' AND ', $conditions);
Please login to merge, or discard this patch.
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -3,12 +3,10 @@
 block discarded – undo
3 3
 namespace Doctrine\Tests\ORM\Cache\Persister\Entity;
4 4
 
5 5
 use Doctrine\Tests\OrmTestCase;
6
-
7 6
 use Doctrine\ORM\Cache\Region;
8 7
 use Doctrine\ORM\EntityManager;
9 8
 use Doctrine\ORM\Mapping\ClassMetadata;
10 9
 use Doctrine\ORM\Persisters\Entity\EntityPersister;
11
-
12 10
 use Doctrine\Tests\Models\Cache\Country;
13 11
 use Doctrine\Common\Collections\Criteria;
14 12
 use Doctrine\Common\Collections\ArrayCollection;
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Configuration.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -151,7 +151,7 @@
 block discarded – undo
151 151
      */
152 152
     public function newDefaultAnnotationDriver($paths = array(), $useSimpleAnnotationReader = true)
153 153
     {
154
-        AnnotationRegistry::registerFile(__DIR__ . '/Mapping/Driver/DoctrineAnnotations.php');
154
+        AnnotationRegistry::registerFile(__DIR__.'/Mapping/Driver/DoctrineAnnotations.php');
155 155
 
156 156
         if ($useSimpleAnnotationReader) {
157 157
             // Register the ORM Annotations in the AnnotationRegistry
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -918,7 +918,7 @@
 block discarded – undo
918 918
      * @since 2.5
919 919
      *
920 920
      * @param string $name  The name of the hint.
921
-     * @param mixed  $value The value of the hint.
921
+     * @param string  $value The value of the hint.
922 922
      */
923 923
     public function setDefaultQueryHint($name, $value)
924 924
     {
Please login to merge, or discard this patch.