@@ -12,11 +12,11 @@ |
||
12 | 12 | use Entities\Address; |
13 | 13 | use Entities\User; |
14 | 14 | |
15 | -$em = require_once __DIR__ . '/bootstrap.php'; |
|
15 | +$em = require_once __DIR__.'/bootstrap.php'; |
|
16 | 16 | |
17 | 17 | ## PUT YOUR TEST CODE BELOW |
18 | 18 | |
19 | 19 | $user = new User; |
20 | 20 | $address = new Address; |
21 | 21 | |
22 | -echo 'Hello World!' . PHP_EOL; |
|
22 | +echo 'Hello World!'.PHP_EOL; |
@@ -35,7 +35,7 @@ |
||
35 | 35 | public function generate(EntityManager $em, $entity) |
36 | 36 | { |
37 | 37 | $conn = $em->getConnection(); |
38 | - $sql = 'SELECT ' . $conn->getDatabasePlatform()->getGuidExpression(); |
|
38 | + $sql = 'SELECT '.$conn->getDatabasePlatform()->getGuidExpression(); |
|
39 | 39 | |
40 | 40 | return $conn->query($sql)->fetchColumn(0); |
41 | 41 | } |
@@ -95,15 +95,15 @@ |
||
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 |
@@ -29,7 +29,7 @@ |
||
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 | )); |
@@ -147,9 +147,9 @@ |
||
147 | 147 | return (bool) $persister->count($criteria); |
148 | 148 | } |
149 | 149 | |
150 | - /** |
|
151 | - * {@inheritdoc} |
|
152 | - */ |
|
150 | + /** |
|
151 | + * {@inheritdoc} |
|
152 | + */ |
|
153 | 153 | public function contains(PersistentCollection $collection, $element) |
154 | 154 | { |
155 | 155 | if ( ! $this->isValidEntityState($element)) { |
@@ -217,8 +217,8 @@ discard block |
||
217 | 217 | $parameters[] = $identifier[$sourceClass->getFieldForColumn($joinColumn['referencedColumnName'])]; |
218 | 218 | } |
219 | 219 | |
220 | - $statement = 'DELETE FROM ' . $this->quoteStrategy->getTableName($targetClass, $this->platform) |
|
221 | - . ' WHERE ' . implode(' = ? AND ', $columns) . ' = ?'; |
|
220 | + $statement = 'DELETE FROM '.$this->quoteStrategy->getTableName($targetClass, $this->platform) |
|
221 | + . ' WHERE '.implode(' = ? AND ', $columns).' = ?'; |
|
222 | 222 | |
223 | 223 | return $this->conn->executeUpdate($statement, $parameters); |
224 | 224 | } |
@@ -255,18 +255,18 @@ discard block |
||
255 | 255 | ]; |
256 | 256 | } |
257 | 257 | |
258 | - $statement = $this->platform->getCreateTemporaryTableSnippetSQL() . ' ' . $tempTable |
|
259 | - . ' (' . $this->platform->getColumnDeclarationListSQL($columnDefinitions) . ')'; |
|
258 | + $statement = $this->platform->getCreateTemporaryTableSnippetSQL().' '.$tempTable |
|
259 | + . ' ('.$this->platform->getColumnDeclarationListSQL($columnDefinitions).')'; |
|
260 | 260 | |
261 | 261 | $this->conn->executeUpdate($statement); |
262 | 262 | |
263 | 263 | // 2) Build insert table records into temporary table |
264 | 264 | $query = $this->em->createQuery( |
265 | - ' SELECT t0.' . implode(', t0.', $rootClass->getIdentifierFieldNames()) |
|
266 | - . ' FROM ' . $targetClass->name . ' t0 WHERE t0.' . $mapping['mappedBy'] . ' = :owner' |
|
265 | + ' SELECT t0.'.implode(', t0.', $rootClass->getIdentifierFieldNames()) |
|
266 | + . ' FROM '.$targetClass->name.' t0 WHERE t0.'.$mapping['mappedBy'].' = :owner' |
|
267 | 267 | )->setParameter('owner', $collection->getOwner()); |
268 | 268 | |
269 | - $statement = 'INSERT INTO ' . $tempTable . ' (' . $idColumnList . ') ' . $query->getSQL(); |
|
269 | + $statement = 'INSERT INTO '.$tempTable.' ('.$idColumnList.') '.$query->getSQL(); |
|
270 | 270 | $parameters = array_values($sourceClass->getIdentifierValues($collection->getOwner())); |
271 | 271 | $numDeleted = $this->conn->executeUpdate($statement, $parameters); |
272 | 272 | |
@@ -275,8 +275,8 @@ discard block |
||
275 | 275 | |
276 | 276 | foreach (array_reverse($classNames) as $className) { |
277 | 277 | $tableName = $this->quoteStrategy->getTableName($this->em->getClassMetadata($className), $this->platform); |
278 | - $statement = 'DELETE FROM ' . $tableName . ' WHERE (' . $idColumnList . ')' |
|
279 | - . ' IN (SELECT ' . $idColumnList . ' FROM ' . $tempTable . ')'; |
|
278 | + $statement = 'DELETE FROM '.$tableName.' WHERE ('.$idColumnList.')' |
|
279 | + . ' IN (SELECT '.$idColumnList.' FROM '.$tempTable.')'; |
|
280 | 280 | |
281 | 281 | $this->conn->executeUpdate($statement); |
282 | 282 | } |
@@ -339,8 +339,8 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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'; |
@@ -346,9 +346,9 @@ discard block |
||
346 | 346 | $columnName = $this->quoteStrategy->getColumnName($versionField, $versionedClass, $this->platform); |
347 | 347 | |
348 | 348 | // FIXME: Order with composite keys might not be correct |
349 | - $sql = 'SELECT ' . $columnName |
|
350 | - . ' FROM ' . $tableName |
|
351 | - . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
349 | + $sql = 'SELECT '.$columnName |
|
350 | + . ' FROM '.$tableName |
|
351 | + . ' WHERE '.implode(' = ? AND ', $identifier).' = ?'; |
|
352 | 352 | |
353 | 353 | |
354 | 354 | $flatId = $this->identifierFlattener->flattenIdentifier($versionedClass, $id); |
@@ -441,7 +441,7 @@ discard block |
||
441 | 441 | } |
442 | 442 | |
443 | 443 | $params[] = $value; |
444 | - $set[] = $column . ' = ' . $placeholder; |
|
444 | + $set[] = $column.' = '.$placeholder; |
|
445 | 445 | $types[] = $this->columnTypes[$columnName]; |
446 | 446 | } |
447 | 447 | |
@@ -487,18 +487,18 @@ discard block |
||
487 | 487 | case Type::SMALLINT: |
488 | 488 | case Type::INTEGER: |
489 | 489 | case Type::BIGINT: |
490 | - $set[] = $versionColumn . ' = ' . $versionColumn . ' + 1'; |
|
490 | + $set[] = $versionColumn.' = '.$versionColumn.' + 1'; |
|
491 | 491 | break; |
492 | 492 | |
493 | 493 | case Type::DATETIME: |
494 | - $set[] = $versionColumn . ' = CURRENT_TIMESTAMP'; |
|
494 | + $set[] = $versionColumn.' = CURRENT_TIMESTAMP'; |
|
495 | 495 | break; |
496 | 496 | } |
497 | 497 | } |
498 | 498 | |
499 | - $sql = 'UPDATE ' . $quotedTableName |
|
500 | - . ' SET ' . implode(', ', $set) |
|
501 | - . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
499 | + $sql = 'UPDATE '.$quotedTableName |
|
500 | + . ' SET '.implode(', ', $set) |
|
501 | + . ' WHERE '.implode(' = ? AND ', $where).' = ?'; |
|
502 | 502 | |
503 | 503 | $result = $this->conn->executeUpdate($sql, $params, $types); |
504 | 504 | |
@@ -541,7 +541,7 @@ discard block |
||
541 | 541 | |
542 | 542 | |
543 | 543 | if ($selfReferential) { |
544 | - $otherColumns = (! $mapping['isOwningSide']) |
|
544 | + $otherColumns = ( ! $mapping['isOwningSide']) |
|
545 | 545 | ? $association['joinTable']['joinColumns'] |
546 | 546 | : $association['joinTable']['inverseJoinColumns']; |
547 | 547 | } |
@@ -695,7 +695,7 @@ discard block |
||
695 | 695 | } |
696 | 696 | $oid = spl_object_hash($newVal); |
697 | 697 | $uow = $this->em->getUnitOfWork(); |
698 | - if (! (isset($this->queuedInserts[$oid]) || $uow->isScheduledForInsert($newVal))) { |
|
698 | + if ( ! (isset($this->queuedInserts[$oid]) || $uow->isScheduledForInsert($newVal))) { |
|
699 | 699 | return false; |
700 | 700 | } |
701 | 701 | if ($newVal !== $entity) { |
@@ -1051,7 +1051,7 @@ discard block |
||
1051 | 1051 | ); |
1052 | 1052 | } |
1053 | 1053 | |
1054 | - $criteria[$quotedJoinTable . '.' . $quotedKeyColumn] = $value; |
|
1054 | + $criteria[$quotedJoinTable.'.'.$quotedKeyColumn] = $value; |
|
1055 | 1055 | $parameters[] = [ |
1056 | 1056 | 'value' => $value, |
1057 | 1057 | 'field' => $field, |
@@ -1094,11 +1094,11 @@ discard block |
||
1094 | 1094 | |
1095 | 1095 | switch ($lockMode) { |
1096 | 1096 | case LockMode::PESSIMISTIC_READ: |
1097 | - $lockSql = ' ' . $this->platform->getReadLockSQL(); |
|
1097 | + $lockSql = ' '.$this->platform->getReadLockSQL(); |
|
1098 | 1098 | break; |
1099 | 1099 | |
1100 | 1100 | case LockMode::PESSIMISTIC_WRITE: |
1101 | - $lockSql = ' ' . $this->platform->getWriteLockSQL(); |
|
1101 | + $lockSql = ' '.$this->platform->getWriteLockSQL(); |
|
1102 | 1102 | break; |
1103 | 1103 | } |
1104 | 1104 | |
@@ -1109,14 +1109,14 @@ discard block |
||
1109 | 1109 | |
1110 | 1110 | if ('' !== $filterSql) { |
1111 | 1111 | $conditionSql = $conditionSql |
1112 | - ? $conditionSql . ' AND ' . $filterSql |
|
1112 | + ? $conditionSql.' AND '.$filterSql |
|
1113 | 1113 | : $filterSql; |
1114 | 1114 | } |
1115 | 1115 | |
1116 | - $select = 'SELECT ' . $columnList; |
|
1117 | - $from = ' FROM ' . $tableName . ' '. $tableAlias; |
|
1118 | - $join = $this->currentPersisterContext->selectJoinSql . $joinSql; |
|
1119 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : ''); |
|
1116 | + $select = 'SELECT '.$columnList; |
|
1117 | + $from = ' FROM '.$tableName.' '.$tableAlias; |
|
1118 | + $join = $this->currentPersisterContext->selectJoinSql.$joinSql; |
|
1119 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : ''); |
|
1120 | 1120 | $lock = $this->platform->appendLockHint($from, $lockMode); |
1121 | 1121 | $query = $select |
1122 | 1122 | . $lock |
@@ -1124,7 +1124,7 @@ discard block |
||
1124 | 1124 | . $where |
1125 | 1125 | . $orderBySql; |
1126 | 1126 | |
1127 | - return $this->platform->modifyLimitQuery($query, $limit, $offset) . $lockSql; |
|
1127 | + return $this->platform->modifyLimitQuery($query, $limit, $offset).$lockSql; |
|
1128 | 1128 | } |
1129 | 1129 | |
1130 | 1130 | /** |
@@ -1143,13 +1143,13 @@ discard block |
||
1143 | 1143 | |
1144 | 1144 | if ('' !== $filterSql) { |
1145 | 1145 | $conditionSql = $conditionSql |
1146 | - ? $conditionSql . ' AND ' . $filterSql |
|
1146 | + ? $conditionSql.' AND '.$filterSql |
|
1147 | 1147 | : $filterSql; |
1148 | 1148 | } |
1149 | 1149 | |
1150 | 1150 | $sql = 'SELECT COUNT(*) ' |
1151 | - . 'FROM ' . $tableName . ' ' . $tableAlias |
|
1152 | - . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql); |
|
1151 | + . 'FROM '.$tableName.' '.$tableAlias |
|
1152 | + . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql); |
|
1153 | 1153 | |
1154 | 1154 | return $sql; |
1155 | 1155 | } |
@@ -1182,7 +1182,7 @@ discard block |
||
1182 | 1182 | : $baseTableAlias; |
1183 | 1183 | |
1184 | 1184 | $columnName = $this->quoteStrategy->getColumnName($fieldName, $this->class, $this->platform); |
1185 | - $orderByList[] = $tableAlias . '.' . $columnName . ' ' . $orientation; |
|
1185 | + $orderByList[] = $tableAlias.'.'.$columnName.' '.$orientation; |
|
1186 | 1186 | |
1187 | 1187 | continue; |
1188 | 1188 | } |
@@ -1199,7 +1199,7 @@ discard block |
||
1199 | 1199 | |
1200 | 1200 | foreach ($this->class->associationMappings[$fieldName]['joinColumns'] as $joinColumn) { |
1201 | 1201 | $columnName = $this->quoteStrategy->getJoinColumnName($joinColumn, $this->class, $this->platform); |
1202 | - $orderByList[] = $tableAlias . '.' . $columnName . ' ' . $orientation; |
|
1202 | + $orderByList[] = $tableAlias.'.'.$columnName.' '.$orientation; |
|
1203 | 1203 | } |
1204 | 1204 | |
1205 | 1205 | continue; |
@@ -1208,7 +1208,7 @@ discard block |
||
1208 | 1208 | throw ORMException::unrecognizedField($fieldName); |
1209 | 1209 | } |
1210 | 1210 | |
1211 | - return ' ORDER BY ' . implode(', ', $orderByList); |
|
1211 | + return ' ORDER BY '.implode(', ', $orderByList); |
|
1212 | 1212 | } |
1213 | 1213 | |
1214 | 1214 | /** |
@@ -1236,8 +1236,8 @@ discard block |
||
1236 | 1236 | $columnList[] = $this->getSelectColumnSQL($field, $this->class); |
1237 | 1237 | } |
1238 | 1238 | |
1239 | - $this->currentPersisterContext->selectJoinSql = ''; |
|
1240 | - $eagerAliasCounter = 0; |
|
1239 | + $this->currentPersisterContext->selectJoinSql = ''; |
|
1240 | + $eagerAliasCounter = 0; |
|
1241 | 1241 | |
1242 | 1242 | foreach ($this->class->associationMappings as $assocField => $assoc) { |
1243 | 1243 | $assocColumnSQL = $this->getSelectColumnAssociationSQL($assocField, $assoc, $this->class); |
@@ -1263,7 +1263,7 @@ discard block |
||
1263 | 1263 | continue; // now this is why you shouldn't use inheritance |
1264 | 1264 | } |
1265 | 1265 | |
1266 | - $assocAlias = 'e' . ($eagerAliasCounter++); |
|
1266 | + $assocAlias = 'e'.($eagerAliasCounter++); |
|
1267 | 1267 | $this->currentPersisterContext->rsm->addJoinedEntityResult($assoc['targetEntity'], $assocAlias, 'r', $assocField); |
1268 | 1268 | |
1269 | 1269 | foreach ($eagerEntity->fieldNames as $field) { |
@@ -1296,14 +1296,14 @@ discard block |
||
1296 | 1296 | $joinTableName = $this->quoteStrategy->getTableName($eagerEntity, $this->platform); |
1297 | 1297 | |
1298 | 1298 | if ($assoc['isOwningSide']) { |
1299 | - $tableAlias = $this->getSQLTableAlias($association['targetEntity'], $assocAlias); |
|
1300 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $this->getJoinSQLForJoinColumns($association['joinColumns']); |
|
1299 | + $tableAlias = $this->getSQLTableAlias($association['targetEntity'], $assocAlias); |
|
1300 | + $this->currentPersisterContext->selectJoinSql .= ' '.$this->getJoinSQLForJoinColumns($association['joinColumns']); |
|
1301 | 1301 | |
1302 | 1302 | foreach ($association['joinColumns'] as $joinColumn) { |
1303 | 1303 | $sourceCol = $this->quoteStrategy->getJoinColumnName($joinColumn, $this->class, $this->platform); |
1304 | 1304 | $targetCol = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $this->class, $this->platform); |
1305 | 1305 | $joinCondition[] = $this->getSQLTableAlias($association['sourceEntity']) |
1306 | - . '.' . $sourceCol . ' = ' . $tableAlias . '.' . $targetCol; |
|
1306 | + . '.'.$sourceCol.' = '.$tableAlias.'.'.$targetCol; |
|
1307 | 1307 | } |
1308 | 1308 | |
1309 | 1309 | // Add filter SQL |
@@ -1319,12 +1319,12 @@ discard block |
||
1319 | 1319 | $sourceCol = $this->quoteStrategy->getJoinColumnName($joinColumn, $this->class, $this->platform); |
1320 | 1320 | $targetCol = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $this->class, $this->platform); |
1321 | 1321 | |
1322 | - $joinCondition[] = $this->getSQLTableAlias($association['sourceEntity'], $assocAlias) . '.' . $sourceCol . ' = ' |
|
1323 | - . $this->getSQLTableAlias($association['targetEntity']) . '.' . $targetCol; |
|
1322 | + $joinCondition[] = $this->getSQLTableAlias($association['sourceEntity'], $assocAlias).'.'.$sourceCol.' = ' |
|
1323 | + . $this->getSQLTableAlias($association['targetEntity']).'.'.$targetCol; |
|
1324 | 1324 | } |
1325 | 1325 | } |
1326 | 1326 | |
1327 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $joinTableName . ' ' . $joinTableAlias . ' ON '; |
|
1327 | + $this->currentPersisterContext->selectJoinSql .= ' '.$joinTableName.' '.$joinTableAlias.' ON '; |
|
1328 | 1328 | $this->currentPersisterContext->selectJoinSql .= implode(' AND ', $joinCondition); |
1329 | 1329 | } |
1330 | 1330 | |
@@ -1345,7 +1345,7 @@ discard block |
||
1345 | 1345 | */ |
1346 | 1346 | protected function getSelectColumnAssociationSQL($field, $assoc, ClassMetadata $class, $alias = 'r') |
1347 | 1347 | { |
1348 | - if ( ! ($assoc['isOwningSide'] && $assoc['type'] & ClassMetadata::TO_ONE) ) { |
|
1348 | + if ( ! ($assoc['isOwningSide'] && $assoc['type'] & ClassMetadata::TO_ONE)) { |
|
1349 | 1349 | return ''; |
1350 | 1350 | } |
1351 | 1351 | |
@@ -1394,10 +1394,10 @@ discard block |
||
1394 | 1394 | foreach ($joinColumns as $joinColumn) { |
1395 | 1395 | $quotedSourceColumn = $this->quoteStrategy->getJoinColumnName($joinColumn, $this->class, $this->platform); |
1396 | 1396 | $quotedTargetColumn = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $this->class, $this->platform); |
1397 | - $conditions[] = $sourceTableAlias . '.' . $quotedTargetColumn . ' = ' . $joinTableName . '.' . $quotedSourceColumn; |
|
1397 | + $conditions[] = $sourceTableAlias.'.'.$quotedTargetColumn.' = '.$joinTableName.'.'.$quotedSourceColumn; |
|
1398 | 1398 | } |
1399 | 1399 | |
1400 | - return ' INNER JOIN ' . $joinTableName . ' ON ' . implode(' AND ', $conditions); |
|
1400 | + return ' INNER JOIN '.$joinTableName.' ON '.implode(' AND ', $conditions); |
|
1401 | 1401 | } |
1402 | 1402 | |
1403 | 1403 | /** |
@@ -1476,7 +1476,7 @@ discard block |
||
1476 | 1476 | continue; |
1477 | 1477 | } |
1478 | 1478 | |
1479 | - if (! $this->class->isIdGeneratorIdentity() || $this->class->identifier[0] != $name) { |
|
1479 | + if ( ! $this->class->isIdGeneratorIdentity() || $this->class->identifier[0] != $name) { |
|
1480 | 1480 | $columns[] = $this->quoteStrategy->getColumnName($name, $this->class, $this->platform); |
1481 | 1481 | $this->columnTypes[$name] = $this->class->fieldMappings[$name]['type']; |
1482 | 1482 | } |
@@ -1497,7 +1497,7 @@ discard block |
||
1497 | 1497 | */ |
1498 | 1498 | protected function getSelectColumnSQL($field, ClassMetadata $class, $alias = 'r') |
1499 | 1499 | { |
1500 | - $root = $alias == 'r' ? '' : $alias ; |
|
1500 | + $root = $alias == 'r' ? '' : $alias; |
|
1501 | 1501 | $tableAlias = $this->getSQLTableAlias($class->name, $root); |
1502 | 1502 | $fieldMapping = $class->fieldMappings[$field]; |
1503 | 1503 | $sql = sprintf('%s.%s', $tableAlias, $this->quoteStrategy->getColumnName($field, $class, $this->platform)); |
@@ -1510,7 +1510,7 @@ discard block |
||
1510 | 1510 | $sql = $type->convertToPHPValueSQL($sql, $this->platform); |
1511 | 1511 | } |
1512 | 1512 | |
1513 | - return $sql . ' AS ' . $columnAlias; |
|
1513 | + return $sql.' AS '.$columnAlias; |
|
1514 | 1514 | } |
1515 | 1515 | |
1516 | 1516 | /** |
@@ -1526,14 +1526,14 @@ discard block |
||
1526 | 1526 | protected function getSQLTableAlias($className, $assocName = '') |
1527 | 1527 | { |
1528 | 1528 | if ($assocName) { |
1529 | - $className .= '#' . $assocName; |
|
1529 | + $className .= '#'.$assocName; |
|
1530 | 1530 | } |
1531 | 1531 | |
1532 | 1532 | if (isset($this->currentPersisterContext->sqlTableAliases[$className])) { |
1533 | 1533 | return $this->currentPersisterContext->sqlTableAliases[$className]; |
1534 | 1534 | } |
1535 | 1535 | |
1536 | - $tableAlias = 't' . $this->currentPersisterContext->sqlAliasCounter++; |
|
1536 | + $tableAlias = 't'.$this->currentPersisterContext->sqlAliasCounter++; |
|
1537 | 1537 | |
1538 | 1538 | $this->currentPersisterContext->sqlTableAliases[$className] = $tableAlias; |
1539 | 1539 | |
@@ -1560,7 +1560,7 @@ discard block |
||
1560 | 1560 | } |
1561 | 1561 | |
1562 | 1562 | $lock = $this->getLockTablesSql($lockMode); |
1563 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' '; |
|
1563 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : '').' '; |
|
1564 | 1564 | $sql = 'SELECT 1 ' |
1565 | 1565 | . $lock |
1566 | 1566 | . $where |
@@ -1582,7 +1582,7 @@ discard block |
||
1582 | 1582 | { |
1583 | 1583 | return $this->platform->appendLockHint( |
1584 | 1584 | 'FROM ' |
1585 | - . $this->quoteStrategy->getTableName($this->class, $this->platform) . ' ' |
|
1585 | + . $this->quoteStrategy->getTableName($this->class, $this->platform).' ' |
|
1586 | 1586 | . $this->getSQLTableAlias($this->class->name), |
1587 | 1587 | $lockMode |
1588 | 1588 | ); |
@@ -1634,19 +1634,19 @@ discard block |
||
1634 | 1634 | |
1635 | 1635 | if (null !== $comparison) { |
1636 | 1636 | // special case null value handling |
1637 | - if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && null ===$value) { |
|
1638 | - $selectedColumns[] = $column . ' IS NULL'; |
|
1637 | + if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && null === $value) { |
|
1638 | + $selectedColumns[] = $column.' IS NULL'; |
|
1639 | 1639 | |
1640 | 1640 | continue; |
1641 | 1641 | } |
1642 | 1642 | |
1643 | 1643 | if ($comparison === Comparison::NEQ && null === $value) { |
1644 | - $selectedColumns[] = $column . ' IS NOT NULL'; |
|
1644 | + $selectedColumns[] = $column.' IS NOT NULL'; |
|
1645 | 1645 | |
1646 | 1646 | continue; |
1647 | 1647 | } |
1648 | 1648 | |
1649 | - $selectedColumns[] = $column . ' ' . sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
1649 | + $selectedColumns[] = $column.' '.sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
1650 | 1650 | |
1651 | 1651 | continue; |
1652 | 1652 | } |
@@ -1694,7 +1694,7 @@ discard block |
||
1694 | 1694 | ? $this->class->fieldMappings[$field]['inherited'] |
1695 | 1695 | : $this->class->name; |
1696 | 1696 | |
1697 | - return [$this->getSQLTableAlias($className) . '.' . $this->quoteStrategy->getColumnName($field, $this->class, $this->platform)]; |
|
1697 | + return [$this->getSQLTableAlias($className).'.'.$this->quoteStrategy->getColumnName($field, $this->class, $this->platform)]; |
|
1698 | 1698 | } |
1699 | 1699 | |
1700 | 1700 | if (isset($this->class->associationMappings[$field])) { |
@@ -1715,7 +1715,7 @@ discard block |
||
1715 | 1715 | |
1716 | 1716 | |
1717 | 1717 | foreach ($joinColumns as $joinColumn) { |
1718 | - $columns[] = $joinTableName . '.' . $this->quoteStrategy->getJoinColumnName($joinColumn, $class, $this->platform); |
|
1718 | + $columns[] = $joinTableName.'.'.$this->quoteStrategy->getJoinColumnName($joinColumn, $class, $this->platform); |
|
1719 | 1719 | } |
1720 | 1720 | |
1721 | 1721 | } else { |
@@ -1723,12 +1723,12 @@ discard block |
||
1723 | 1723 | throw ORMException::invalidFindByInverseAssociation($this->class->name, $field); |
1724 | 1724 | } |
1725 | 1725 | |
1726 | - $className = (isset($association['inherited'])) |
|
1726 | + $className = (isset($association['inherited'])) |
|
1727 | 1727 | ? $association['inherited'] |
1728 | 1728 | : $this->class->name; |
1729 | 1729 | |
1730 | 1730 | foreach ($association['joinColumns'] as $joinColumn) { |
1731 | - $columns[] = $this->getSQLTableAlias($className) . '.' . $this->quoteStrategy->getJoinColumnName($joinColumn, $this->class, $this->platform); |
|
1731 | + $columns[] = $this->getSQLTableAlias($className).'.'.$this->quoteStrategy->getJoinColumnName($joinColumn, $this->class, $this->platform); |
|
1732 | 1732 | } |
1733 | 1733 | } |
1734 | 1734 | return $columns; |
@@ -1820,7 +1820,7 @@ discard block |
||
1820 | 1820 | $value = $value[$this->em->getClassMetadata($sourceClass->associationMappings[$field]['targetEntity'])->identifier[0]]; |
1821 | 1821 | } |
1822 | 1822 | |
1823 | - $criteria[$tableAlias . "." . $targetKeyColumn] = $value; |
|
1823 | + $criteria[$tableAlias.".".$targetKeyColumn] = $value; |
|
1824 | 1824 | $parameters[] = [ |
1825 | 1825 | 'value' => $value, |
1826 | 1826 | 'field' => $field, |
@@ -1833,7 +1833,7 @@ discard block |
||
1833 | 1833 | $field = $sourceClass->fieldNames[$sourceKeyColumn]; |
1834 | 1834 | $value = $sourceClass->reflFields[$field]->getValue($sourceEntity); |
1835 | 1835 | |
1836 | - $criteria[$tableAlias . "." . $targetKeyColumn] = $value; |
|
1836 | + $criteria[$tableAlias.".".$targetKeyColumn] = $value; |
|
1837 | 1837 | $parameters[] = [ |
1838 | 1838 | 'value' => $value, |
1839 | 1839 | 'field' => $field, |
@@ -1921,7 +1921,7 @@ discard block |
||
1921 | 1921 | $assoc = $class->associationMappings[$field]; |
1922 | 1922 | $class = $this->em->getClassMetadata($assoc['targetEntity']); |
1923 | 1923 | |
1924 | - if (! $assoc['isOwningSide']) { |
|
1924 | + if ( ! $assoc['isOwningSide']) { |
|
1925 | 1925 | $assoc = $class->associationMappings[$assoc['mappedBy']]; |
1926 | 1926 | $class = $this->em->getClassMetadata($assoc['targetEntity']); |
1927 | 1927 | } |
@@ -1930,7 +1930,7 @@ discard block |
||
1930 | 1930 | ? $assoc['relationToTargetKeyColumns'] |
1931 | 1931 | : $assoc['sourceToTargetKeyColumns']; |
1932 | 1932 | |
1933 | - foreach ($columns as $column){ |
|
1933 | + foreach ($columns as $column) { |
|
1934 | 1934 | $types[] = PersisterHelper::getTypeOfColumn($column, $class, $this->em); |
1935 | 1935 | } |
1936 | 1936 | break; |
@@ -1941,7 +1941,7 @@ discard block |
||
1941 | 1941 | } |
1942 | 1942 | |
1943 | 1943 | if (is_array($value)) { |
1944 | - return array_map(function ($type) { |
|
1944 | + return array_map(function($type) { |
|
1945 | 1945 | $type = Type::getType($type); |
1946 | 1946 | |
1947 | 1947 | return $type->getBindingType() + Connection::ARRAY_PARAM_OFFSET; |
@@ -2017,12 +2017,12 @@ discard block |
||
2017 | 2017 | |
2018 | 2018 | $sql = 'SELECT 1 ' |
2019 | 2019 | . $this->getLockTablesSql(null) |
2020 | - . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
2020 | + . ' WHERE '.$this->getSelectConditionSQL($criteria); |
|
2021 | 2021 | |
2022 | 2022 | list($params, $types) = $this->expandParameters($criteria); |
2023 | 2023 | |
2024 | 2024 | if (null !== $extraConditions) { |
2025 | - $sql .= ' AND ' . $this->getSelectConditionCriteriaSQL($extraConditions); |
|
2025 | + $sql .= ' AND '.$this->getSelectConditionCriteriaSQL($extraConditions); |
|
2026 | 2026 | list($criteriaParams, $criteriaTypes) = $this->expandCriteriaParameters($extraConditions); |
2027 | 2027 | |
2028 | 2028 | $params = array_merge($params, $criteriaParams); |
@@ -2030,7 +2030,7 @@ discard block |
||
2030 | 2030 | } |
2031 | 2031 | |
2032 | 2032 | if ($filterSql = $this->generateFilterConditionSQL($this->class, $alias)) { |
2033 | - $sql .= ' AND ' . $filterSql; |
|
2033 | + $sql .= ' AND '.$filterSql; |
|
2034 | 2034 | } |
2035 | 2035 | |
2036 | 2036 | return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
@@ -2077,13 +2077,13 @@ discard block |
||
2077 | 2077 | |
2078 | 2078 | foreach ($this->em->getFilters()->getEnabledFilters() as $filter) { |
2079 | 2079 | if ('' !== $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias)) { |
2080 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
2080 | + $filterClauses[] = '('.$filterExpr.')'; |
|
2081 | 2081 | } |
2082 | 2082 | } |
2083 | 2083 | |
2084 | 2084 | $sql = implode(' AND ', $filterClauses); |
2085 | 2085 | |
2086 | - return $sql ? "(" . $sql . ")" : ""; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
2086 | + return $sql ? "(".$sql.")" : ""; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
2087 | 2087 | } |
2088 | 2088 | |
2089 | 2089 | /** |
@@ -2113,7 +2113,7 @@ discard block |
||
2113 | 2113 | $entityManager = $this->em; |
2114 | 2114 | |
2115 | 2115 | return array_map( |
2116 | - static function ($fieldName) use ($class, $entityManager) : string { |
|
2116 | + static function($fieldName) use ($class, $entityManager) : string { |
|
2117 | 2117 | $types = PersisterHelper::getTypeOfField($fieldName, $class, $entityManager); |
2118 | 2118 | assert(isset($types[0])); |
2119 | 2119 |
@@ -47,17 +47,17 @@ |
||
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 | /** |
@@ -57,7 +57,7 @@ |
||
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 |
@@ -61,7 +61,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 | /** |
@@ -33,6 +33,6 @@ |
||
33 | 33 | */ |
34 | 34 | public static function noDispatchForNode($node) |
35 | 35 | { |
36 | - return new self("Double-dispatch for node " . get_class($node) . " is not supported."); |
|
36 | + return new self("Double-dispatch for node ".get_class($node)." is not supported."); |
|
37 | 37 | } |
38 | 38 | } |