@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | */ |
57 | 57 | public function generateProxyClasses(array $classes) : int |
58 | 58 | { |
59 | - $concreteClasses = array_filter($classes, static function (ClassMetadata $metadata) : bool { |
|
59 | + $concreteClasses = array_filter($classes, static function(ClassMetadata $metadata) : bool { |
|
60 | 60 | return ! ($metadata->isMappedSuperclass || $metadata->getReflectionClass()->isAbstract()); |
61 | 61 | }); |
62 | 62 | |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | ->proxyFactory |
66 | 66 | ->createProxy( |
67 | 67 | $metadata->getClassName(), |
68 | - static function () { |
|
68 | + static function() { |
|
69 | 69 | // empty closure, serves its purpose, for now |
70 | 70 | }, |
71 | 71 | $this->skippedFieldsFqns($metadata) |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | ->getUnitOfWork() |
90 | 90 | ->getEntityPersister($metadata->getClassName()); |
91 | 91 | |
92 | - $proxyInstance = $this |
|
92 | + $proxyInstance = $this |
|
93 | 93 | ->proxyFactory |
94 | 94 | ->createProxy( |
95 | 95 | $metadata->getClassName(), |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | |
109 | 109 | private function makeInitializer(ClassMetadata $metadata, EntityPersister $persister) : Closure |
110 | 110 | { |
111 | - return static function ( |
|
111 | + return static function( |
|
112 | 112 | GhostObjectInterface $ghostObject, |
113 | 113 | string $method, |
114 | 114 | // we don't care |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | $identifier = $persister->getIdentifier($ghostObject); |
128 | 128 | |
129 | 129 | // @TODO how do we use `$properties` in the persister? That would be a massive optimisation |
130 | - if (! $persister->loadById($identifier, $ghostObject)) { |
|
130 | + if ( ! $persister->loadById($identifier, $ghostObject)) { |
|
131 | 131 | $initializer = $originalInitializer; |
132 | 132 | |
133 | 133 | throw EntityNotFoundException::fromClassNameAndIdentifier( |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | $transientFieldsFqns = []; |
160 | 160 | |
161 | 161 | foreach ($metadata->getPropertiesIterator() as $name => $property) { |
162 | - if (! $property instanceof TransientMetadata) { |
|
162 | + if ( ! $property instanceof TransientMetadata) { |
|
163 | 163 | continue; |
164 | 164 | } |
165 | 165 | |
@@ -197,11 +197,11 @@ discard block |
||
197 | 197 | private function propertyFqcn(ReflectionProperty $property) : string |
198 | 198 | { |
199 | 199 | if ($property->isPrivate()) { |
200 | - return "\0" . $property->getDeclaringClass()->getName() . "\0" . $property->getName(); |
|
200 | + return "\0".$property->getDeclaringClass()->getName()."\0".$property->getName(); |
|
201 | 201 | } |
202 | 202 | |
203 | 203 | if ($property->isProtected()) { |
204 | - return "\0*\0" . $property->getName(); |
|
204 | + return "\0*\0".$property->getName(); |
|
205 | 205 | } |
206 | 206 | |
207 | 207 | return $property->getName(); |
@@ -296,16 +296,16 @@ discard block |
||
296 | 296 | $tableName = $versionedClass->table->getQuotedQualifiedName($this->platform); |
297 | 297 | $columnName = $this->platform->quoteIdentifier($versionProperty->getColumnName()); |
298 | 298 | $identifier = array_map( |
299 | - function ($columnName) { |
|
299 | + function($columnName) { |
|
300 | 300 | return $this->platform->quoteIdentifier($columnName); |
301 | 301 | }, |
302 | 302 | array_keys($versionedClass->getIdentifierColumns($this->em)) |
303 | 303 | ); |
304 | 304 | |
305 | 305 | // FIXME: Order with composite keys might not be correct |
306 | - $sql = 'SELECT ' . $columnName |
|
307 | - . ' FROM ' . $tableName |
|
308 | - . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
306 | + $sql = 'SELECT '.$columnName |
|
307 | + . ' FROM '.$tableName |
|
308 | + . ' WHERE '.implode(' = ? AND ', $identifier).' = ?'; |
|
309 | 309 | |
310 | 310 | $flattenedId = $this->em->getIdentifierFlattener()->flattenIdentifier($versionedClass, $id); |
311 | 311 | $versionType = $versionProperty->getType(); |
@@ -344,13 +344,13 @@ discard block |
||
344 | 344 | $tableName = $this->class->getTableName(); |
345 | 345 | $updateData = $this->prepareUpdateData($entity); |
346 | 346 | |
347 | - if (! isset($updateData[$tableName])) { |
|
347 | + if ( ! isset($updateData[$tableName])) { |
|
348 | 348 | return; |
349 | 349 | } |
350 | 350 | |
351 | 351 | $data = $updateData[$tableName]; |
352 | 352 | |
353 | - if (! $data) { |
|
353 | + if ( ! $data) { |
|
354 | 354 | return; |
355 | 355 | } |
356 | 356 | |
@@ -402,7 +402,7 @@ discard block |
||
402 | 402 | |
403 | 403 | if ($value !== null) { |
404 | 404 | // @todo guilhermeblanco Make sure we do not have flat association values. |
405 | - if (! is_array($value)) { |
|
405 | + if ( ! is_array($value)) { |
|
406 | 406 | $value = [$targetClass->identifier[0] => $value]; |
407 | 407 | } |
408 | 408 | |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
416 | 416 | $targetField = $targetClass->fieldNames[$referencedColumnName]; |
417 | 417 | |
418 | - if (! $joinColumn->getType()) { |
|
418 | + if ( ! $joinColumn->getType()) { |
|
419 | 419 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
420 | 420 | } |
421 | 421 | |
@@ -481,7 +481,7 @@ discard block |
||
481 | 481 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
482 | 482 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
483 | 483 | |
484 | - if (! $joinColumn->getType()) { |
|
484 | + if ( ! $joinColumn->getType()) { |
|
485 | 485 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
486 | 486 | } |
487 | 487 | |
@@ -508,18 +508,18 @@ discard block |
||
508 | 508 | case Type::SMALLINT: |
509 | 509 | case Type::INTEGER: |
510 | 510 | case Type::BIGINT: |
511 | - $set[] = $versionColumnName . ' = ' . $versionColumnName . ' + 1'; |
|
511 | + $set[] = $versionColumnName.' = '.$versionColumnName.' + 1'; |
|
512 | 512 | break; |
513 | 513 | |
514 | 514 | case Type::DATETIME: |
515 | - $set[] = $versionColumnName . ' = CURRENT_TIMESTAMP'; |
|
515 | + $set[] = $versionColumnName.' = CURRENT_TIMESTAMP'; |
|
516 | 516 | break; |
517 | 517 | } |
518 | 518 | } |
519 | 519 | |
520 | - $sql = 'UPDATE ' . $quotedTableName |
|
521 | - . ' SET ' . implode(', ', $set) |
|
522 | - . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
520 | + $sql = 'UPDATE '.$quotedTableName |
|
521 | + . ' SET '.implode(', ', $set) |
|
522 | + . ' WHERE '.implode(' = ? AND ', $where).' = ?'; |
|
523 | 523 | |
524 | 524 | $result = $this->conn->executeUpdate($sql, $params, $types); |
525 | 525 | |
@@ -536,7 +536,7 @@ discard block |
||
536 | 536 | protected function deleteJoinTableRecords($identifier) |
537 | 537 | { |
538 | 538 | foreach ($this->class->getPropertiesIterator() as $association) { |
539 | - if (! ($association instanceof ManyToManyAssociationMetadata)) { |
|
539 | + if ( ! ($association instanceof ManyToManyAssociationMetadata)) { |
|
540 | 540 | continue; |
541 | 541 | } |
542 | 542 | |
@@ -548,7 +548,7 @@ discard block |
||
548 | 548 | $otherKeys = []; |
549 | 549 | $keys = []; |
550 | 550 | |
551 | - if (! $owningAssociation->isOwningSide()) { |
|
551 | + if ( ! $owningAssociation->isOwningSide()) { |
|
552 | 552 | $class = $this->em->getClassMetadata($association->getTargetEntity()); |
553 | 553 | $owningAssociation = $class->getProperty($association->getMappedBy()); |
554 | 554 | } |
@@ -658,7 +658,7 @@ discard block |
||
658 | 658 | } |
659 | 659 | |
660 | 660 | // Only owning side of x-1 associations can have a FK column. |
661 | - if (! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) { |
|
661 | + if ( ! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) { |
|
662 | 662 | continue; |
663 | 663 | } |
664 | 664 | |
@@ -678,7 +678,7 @@ discard block |
||
678 | 678 | /** @var JoinColumnMetadata $joinColumn */ |
679 | 679 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
680 | 680 | |
681 | - if (! $joinColumn->getType()) { |
|
681 | + if ( ! $joinColumn->getType()) { |
|
682 | 682 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
683 | 683 | } |
684 | 684 | |
@@ -705,7 +705,7 @@ discard block |
||
705 | 705 | $propertyName = $this->class->fieldNames[$columnName]; |
706 | 706 | $property = $this->class->getProperty($propertyName); |
707 | 707 | |
708 | - if (! $property) { |
|
708 | + if ( ! $property) { |
|
709 | 709 | return null; |
710 | 710 | } |
711 | 711 | |
@@ -724,7 +724,7 @@ discard block |
||
724 | 724 | /** @var JoinColumnMetadata $joinColumn */ |
725 | 725 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
726 | 726 | |
727 | - if (! $joinColumn->getType()) { |
|
727 | + if ( ! $joinColumn->getType()) { |
|
728 | 728 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
729 | 729 | } |
730 | 730 | |
@@ -829,7 +829,7 @@ discard block |
||
829 | 829 | $sourceKeyColumn = $joinColumn->getReferencedColumnName(); |
830 | 830 | $targetKeyColumn = $joinColumn->getColumnName(); |
831 | 831 | |
832 | - if (! isset($sourceClass->fieldNames[$sourceKeyColumn])) { |
|
832 | + if ( ! isset($sourceClass->fieldNames[$sourceKeyColumn])) { |
|
833 | 833 | throw MappingException::joinColumnMustPointToMappedField( |
834 | 834 | $sourceClass->getClassName(), |
835 | 835 | $sourceKeyColumn |
@@ -1056,7 +1056,7 @@ discard block |
||
1056 | 1056 | $criteria = []; |
1057 | 1057 | $parameters = []; |
1058 | 1058 | |
1059 | - if (! $association->isOwningSide()) { |
|
1059 | + if ( ! $association->isOwningSide()) { |
|
1060 | 1060 | $class = $this->em->getClassMetadata($association->getTargetEntity()); |
1061 | 1061 | $owningAssoc = $class->getProperty($association->getMappedBy()); |
1062 | 1062 | } |
@@ -1084,7 +1084,7 @@ discard block |
||
1084 | 1084 | $value = $value[$targetClass->identifier[0]]; |
1085 | 1085 | } |
1086 | 1086 | |
1087 | - $criteria[$joinTableName . '.' . $quotedColumnName] = $value; |
|
1087 | + $criteria[$joinTableName.'.'.$quotedColumnName] = $value; |
|
1088 | 1088 | $parameters[] = [ |
1089 | 1089 | 'value' => $value, |
1090 | 1090 | 'field' => $fieldName, |
@@ -1134,11 +1134,11 @@ discard block |
||
1134 | 1134 | |
1135 | 1135 | switch ($lockMode) { |
1136 | 1136 | case LockMode::PESSIMISTIC_READ: |
1137 | - $lockSql = ' ' . $this->platform->getReadLockSQL(); |
|
1137 | + $lockSql = ' '.$this->platform->getReadLockSQL(); |
|
1138 | 1138 | break; |
1139 | 1139 | |
1140 | 1140 | case LockMode::PESSIMISTIC_WRITE: |
1141 | - $lockSql = ' ' . $this->platform->getWriteLockSQL(); |
|
1141 | + $lockSql = ' '.$this->platform->getWriteLockSQL(); |
|
1142 | 1142 | break; |
1143 | 1143 | } |
1144 | 1144 | |
@@ -1149,14 +1149,14 @@ discard block |
||
1149 | 1149 | |
1150 | 1150 | if ($filterSql !== '') { |
1151 | 1151 | $conditionSql = $conditionSql |
1152 | - ? $conditionSql . ' AND ' . $filterSql |
|
1152 | + ? $conditionSql.' AND '.$filterSql |
|
1153 | 1153 | : $filterSql; |
1154 | 1154 | } |
1155 | 1155 | |
1156 | - $select = 'SELECT ' . $columnList; |
|
1157 | - $from = ' FROM ' . $tableName . ' ' . $tableAlias; |
|
1158 | - $join = $this->currentPersisterContext->selectJoinSql . $joinSql; |
|
1159 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : ''); |
|
1156 | + $select = 'SELECT '.$columnList; |
|
1157 | + $from = ' FROM '.$tableName.' '.$tableAlias; |
|
1158 | + $join = $this->currentPersisterContext->selectJoinSql.$joinSql; |
|
1159 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : ''); |
|
1160 | 1160 | $lock = $this->platform->appendLockHint($from, $lockMode); |
1161 | 1161 | $query = $select |
1162 | 1162 | . $lock |
@@ -1164,7 +1164,7 @@ discard block |
||
1164 | 1164 | . $where |
1165 | 1165 | . $orderBySql; |
1166 | 1166 | |
1167 | - return $this->platform->modifyLimitQuery($query, $limit, $offset ?? 0) . $lockSql; |
|
1167 | + return $this->platform->modifyLimitQuery($query, $limit, $offset ?? 0).$lockSql; |
|
1168 | 1168 | } |
1169 | 1169 | |
1170 | 1170 | /** |
@@ -1183,13 +1183,13 @@ discard block |
||
1183 | 1183 | |
1184 | 1184 | if ($filterSql !== '') { |
1185 | 1185 | $conditionSql = $conditionSql |
1186 | - ? $conditionSql . ' AND ' . $filterSql |
|
1186 | + ? $conditionSql.' AND '.$filterSql |
|
1187 | 1187 | : $filterSql; |
1188 | 1188 | } |
1189 | 1189 | |
1190 | 1190 | return 'SELECT COUNT(*) ' |
1191 | - . 'FROM ' . $tableName . ' ' . $tableAlias |
|
1192 | - . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql); |
|
1191 | + . 'FROM '.$tableName.' '.$tableAlias |
|
1192 | + . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql); |
|
1193 | 1193 | } |
1194 | 1194 | |
1195 | 1195 | /** |
@@ -1204,7 +1204,7 @@ discard block |
||
1204 | 1204 | */ |
1205 | 1205 | final protected function getOrderBySQL(array $orderBy, $baseTableAlias) |
1206 | 1206 | { |
1207 | - if (! $orderBy) { |
|
1207 | + if ( ! $orderBy) { |
|
1208 | 1208 | return ''; |
1209 | 1209 | } |
1210 | 1210 | |
@@ -1213,7 +1213,7 @@ discard block |
||
1213 | 1213 | foreach ($orderBy as $fieldName => $orientation) { |
1214 | 1214 | $orientation = strtoupper(trim($orientation)); |
1215 | 1215 | |
1216 | - if (! in_array($orientation, ['ASC', 'DESC'], true)) { |
|
1216 | + if ( ! in_array($orientation, ['ASC', 'DESC'], true)) { |
|
1217 | 1217 | throw InvalidOrientation::fromClassNameAndField($this->class->getClassName(), $fieldName); |
1218 | 1218 | } |
1219 | 1219 | |
@@ -1223,11 +1223,11 @@ discard block |
||
1223 | 1223 | $tableAlias = $this->getSQLTableAlias($property->getTableName()); |
1224 | 1224 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
1225 | 1225 | |
1226 | - $orderByList[] = $tableAlias . '.' . $columnName . ' ' . $orientation; |
|
1226 | + $orderByList[] = $tableAlias.'.'.$columnName.' '.$orientation; |
|
1227 | 1227 | |
1228 | 1228 | continue; |
1229 | 1229 | } elseif ($property instanceof AssociationMetadata) { |
1230 | - if (! $property->isOwningSide()) { |
|
1230 | + if ( ! $property->isOwningSide()) { |
|
1231 | 1231 | throw InvalidFindByCall::fromInverseSideUsage( |
1232 | 1232 | $this->class->getClassName(), |
1233 | 1233 | $fieldName |
@@ -1243,7 +1243,7 @@ discard block |
||
1243 | 1243 | /** @var JoinColumnMetadata $joinColumn */ |
1244 | 1244 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
1245 | 1245 | |
1246 | - $orderByList[] = $tableAlias . '.' . $quotedColumnName . ' ' . $orientation; |
|
1246 | + $orderByList[] = $tableAlias.'.'.$quotedColumnName.' '.$orientation; |
|
1247 | 1247 | } |
1248 | 1248 | |
1249 | 1249 | continue; |
@@ -1252,7 +1252,7 @@ discard block |
||
1252 | 1252 | throw UnrecognizedField::byName($fieldName); |
1253 | 1253 | } |
1254 | 1254 | |
1255 | - return ' ORDER BY ' . implode(', ', $orderByList); |
|
1255 | + return ' ORDER BY '.implode(', ', $orderByList); |
|
1256 | 1256 | } |
1257 | 1257 | |
1258 | 1258 | /** |
@@ -1294,7 +1294,7 @@ discard block |
||
1294 | 1294 | $isAssocToOneInverseSide = $property instanceof ToOneAssociationMetadata && ! $property->isOwningSide(); |
1295 | 1295 | $isAssocFromOneEager = ! $property instanceof ManyToManyAssociationMetadata && $property->getFetchMode() === FetchMode::EAGER; |
1296 | 1296 | |
1297 | - if (! ($isAssocFromOneEager || $isAssocToOneInverseSide)) { |
|
1297 | + if ( ! ($isAssocFromOneEager || $isAssocToOneInverseSide)) { |
|
1298 | 1298 | break; |
1299 | 1299 | } |
1300 | 1300 | |
@@ -1309,7 +1309,7 @@ discard block |
||
1309 | 1309 | break; // now this is why you shouldn't use inheritance |
1310 | 1310 | } |
1311 | 1311 | |
1312 | - $assocAlias = 'e' . ($eagerAliasCounter++); |
|
1312 | + $assocAlias = 'e'.($eagerAliasCounter++); |
|
1313 | 1313 | |
1314 | 1314 | $this->currentPersisterContext->rsm->addJoinedEntityResult($targetEntity, $assocAlias, 'r', $fieldName); |
1315 | 1315 | |
@@ -1337,14 +1337,14 @@ discard block |
||
1337 | 1337 | $this->currentPersisterContext->rsm->addIndexBy($assocAlias, $property->getIndexedBy()); |
1338 | 1338 | } |
1339 | 1339 | |
1340 | - if (! $property->isOwningSide()) { |
|
1340 | + if ( ! $property->isOwningSide()) { |
|
1341 | 1341 | $owningAssociation = $eagerEntity->getProperty($property->getMappedBy()); |
1342 | 1342 | } |
1343 | 1343 | |
1344 | 1344 | $joinTableAlias = $this->getSQLTableAlias($eagerEntity->getTableName(), $assocAlias); |
1345 | 1345 | $joinTableName = $eagerEntity->table->getQuotedQualifiedName($this->platform); |
1346 | 1346 | |
1347 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $this->getJoinSQLForAssociation($property); |
|
1347 | + $this->currentPersisterContext->selectJoinSql .= ' '.$this->getJoinSQLForAssociation($property); |
|
1348 | 1348 | |
1349 | 1349 | $sourceClass = $this->em->getClassMetadata($owningAssociation->getSourceEntity()); |
1350 | 1350 | $targetClass = $this->em->getClassMetadata($owningAssociation->getTargetEntity()); |
@@ -1368,7 +1368,7 @@ discard block |
||
1368 | 1368 | $joinCondition[] = $filterSql; |
1369 | 1369 | } |
1370 | 1370 | |
1371 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $joinTableName . ' ' . $joinTableAlias . ' ON '; |
|
1371 | + $this->currentPersisterContext->selectJoinSql .= ' '.$joinTableName.' '.$joinTableAlias.' ON '; |
|
1372 | 1372 | $this->currentPersisterContext->selectJoinSql .= implode(' AND ', $joinCondition); |
1373 | 1373 | |
1374 | 1374 | break; |
@@ -1390,7 +1390,7 @@ discard block |
||
1390 | 1390 | */ |
1391 | 1391 | protected function getSelectColumnAssociationSQL($field, AssociationMetadata $association, ClassMetadata $class, $alias = 'r') |
1392 | 1392 | { |
1393 | - if (! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) { |
|
1393 | + if ( ! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) { |
|
1394 | 1394 | return ''; |
1395 | 1395 | } |
1396 | 1396 | |
@@ -1405,7 +1405,7 @@ discard block |
||
1405 | 1405 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
1406 | 1406 | $resultColumnName = $this->getSQLColumnAlias(); |
1407 | 1407 | |
1408 | - if (! $joinColumn->getType()) { |
|
1408 | + if ( ! $joinColumn->getType()) { |
|
1409 | 1409 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
1410 | 1410 | } |
1411 | 1411 | |
@@ -1435,7 +1435,7 @@ discard block |
||
1435 | 1435 | $owningAssociation = $association; |
1436 | 1436 | $sourceTableAlias = $this->getSQLTableAlias($this->class->getTableName()); |
1437 | 1437 | |
1438 | - if (! $association->isOwningSide()) { |
|
1438 | + if ( ! $association->isOwningSide()) { |
|
1439 | 1439 | $targetEntity = $this->em->getClassMetadata($association->getTargetEntity()); |
1440 | 1440 | $owningAssociation = $targetEntity->getProperty($association->getMappedBy()); |
1441 | 1441 | } |
@@ -1456,7 +1456,7 @@ discard block |
||
1456 | 1456 | ); |
1457 | 1457 | } |
1458 | 1458 | |
1459 | - return ' INNER JOIN ' . $joinTableName . ' ON ' . implode(' AND ', $conditions); |
|
1459 | + return ' INNER JOIN '.$joinTableName.' ON '.implode(' AND ', $conditions); |
|
1460 | 1460 | } |
1461 | 1461 | |
1462 | 1462 | /** |
@@ -1550,7 +1550,7 @@ discard block |
||
1550 | 1550 | $columnName = $joinColumn->getColumnName(); |
1551 | 1551 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
1552 | 1552 | |
1553 | - if (! $joinColumn->getType()) { |
|
1553 | + if ( ! $joinColumn->getType()) { |
|
1554 | 1554 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
1555 | 1555 | } |
1556 | 1556 | |
@@ -1589,7 +1589,7 @@ discard block |
||
1589 | 1589 | |
1590 | 1590 | $this->currentPersisterContext->rsm->addFieldResult($alias, $columnAlias, $field, $class->getClassName()); |
1591 | 1591 | |
1592 | - return $property->getType()->convertToPHPValueSQL($sql, $this->platform) . ' AS ' . $columnAlias; |
|
1592 | + return $property->getType()->convertToPHPValueSQL($sql, $this->platform).' AS '.$columnAlias; |
|
1593 | 1593 | } |
1594 | 1594 | |
1595 | 1595 | /** |
@@ -1603,14 +1603,14 @@ discard block |
||
1603 | 1603 | protected function getSQLTableAlias($tableName, $assocName = '') |
1604 | 1604 | { |
1605 | 1605 | if ($tableName) { |
1606 | - $tableName .= '#' . $assocName; |
|
1606 | + $tableName .= '#'.$assocName; |
|
1607 | 1607 | } |
1608 | 1608 | |
1609 | 1609 | if (isset($this->currentPersisterContext->sqlTableAliases[$tableName])) { |
1610 | 1610 | return $this->currentPersisterContext->sqlTableAliases[$tableName]; |
1611 | 1611 | } |
1612 | 1612 | |
1613 | - $tableAlias = 't' . $this->currentPersisterContext->sqlAliasCounter++; |
|
1613 | + $tableAlias = 't'.$this->currentPersisterContext->sqlAliasCounter++; |
|
1614 | 1614 | |
1615 | 1615 | $this->currentPersisterContext->sqlTableAliases[$tableName] = $tableAlias; |
1616 | 1616 | |
@@ -1636,7 +1636,7 @@ discard block |
||
1636 | 1636 | } |
1637 | 1637 | |
1638 | 1638 | $lock = $this->getLockTablesSql($lockMode); |
1639 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' '; |
|
1639 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : '').' '; |
|
1640 | 1640 | $sql = 'SELECT 1 ' |
1641 | 1641 | . $lock |
1642 | 1642 | . $where |
@@ -1659,7 +1659,7 @@ discard block |
||
1659 | 1659 | $tableName = $this->class->table->getQuotedQualifiedName($this->platform); |
1660 | 1660 | |
1661 | 1661 | return $this->platform->appendLockHint( |
1662 | - 'FROM ' . $tableName . ' ' . $this->getSQLTableAlias($this->class->getTableName()), |
|
1662 | + 'FROM '.$tableName.' '.$this->getSQLTableAlias($this->class->getTableName()), |
|
1663 | 1663 | $lockMode |
1664 | 1664 | ); |
1665 | 1665 | } |
@@ -1709,19 +1709,19 @@ discard block |
||
1709 | 1709 | |
1710 | 1710 | if ($comparison !== null) { |
1711 | 1711 | // special case null value handling |
1712 | - if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && $value ===null) { |
|
1713 | - $selectedColumns[] = $column . ' IS NULL'; |
|
1712 | + if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && $value === null) { |
|
1713 | + $selectedColumns[] = $column.' IS NULL'; |
|
1714 | 1714 | |
1715 | 1715 | continue; |
1716 | 1716 | } |
1717 | 1717 | |
1718 | 1718 | if ($comparison === Comparison::NEQ && $value === null) { |
1719 | - $selectedColumns[] = $column . ' IS NOT NULL'; |
|
1719 | + $selectedColumns[] = $column.' IS NOT NULL'; |
|
1720 | 1720 | |
1721 | 1721 | continue; |
1722 | 1722 | } |
1723 | 1723 | |
1724 | - $selectedColumns[] = $column . ' ' . sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
1724 | + $selectedColumns[] = $column.' '.sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
1725 | 1725 | |
1726 | 1726 | continue; |
1727 | 1727 | } |
@@ -1769,7 +1769,7 @@ discard block |
||
1769 | 1769 | $tableAlias = $this->getSQLTableAlias($property->getTableName()); |
1770 | 1770 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
1771 | 1771 | |
1772 | - return [$tableAlias . '.' . $columnName]; |
|
1772 | + return [$tableAlias.'.'.$columnName]; |
|
1773 | 1773 | } |
1774 | 1774 | |
1775 | 1775 | if ($property instanceof AssociationMetadata) { |
@@ -1778,7 +1778,7 @@ discard block |
||
1778 | 1778 | |
1779 | 1779 | // Many-To-Many requires join table check for joinColumn |
1780 | 1780 | if ($owningAssociation instanceof ManyToManyAssociationMetadata) { |
1781 | - if (! $owningAssociation->isOwningSide()) { |
|
1781 | + if ( ! $owningAssociation->isOwningSide()) { |
|
1782 | 1782 | $owningAssociation = $association; |
1783 | 1783 | } |
1784 | 1784 | |
@@ -1791,10 +1791,10 @@ discard block |
||
1791 | 1791 | foreach ($joinColumns as $joinColumn) { |
1792 | 1792 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
1793 | 1793 | |
1794 | - $columns[] = $joinTableName . '.' . $quotedColumnName; |
|
1794 | + $columns[] = $joinTableName.'.'.$quotedColumnName; |
|
1795 | 1795 | } |
1796 | 1796 | } else { |
1797 | - if (! $owningAssociation->isOwningSide()) { |
|
1797 | + if ( ! $owningAssociation->isOwningSide()) { |
|
1798 | 1798 | throw InvalidFindByCall::fromInverseSideUsage( |
1799 | 1799 | $this->class->getClassName(), |
1800 | 1800 | $field |
@@ -1809,7 +1809,7 @@ discard block |
||
1809 | 1809 | foreach ($owningAssociation->getJoinColumns() as $joinColumn) { |
1810 | 1810 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
1811 | 1811 | |
1812 | - $columns[] = $tableAlias . '.' . $quotedColumnName; |
|
1812 | + $columns[] = $tableAlias.'.'.$quotedColumnName; |
|
1813 | 1813 | } |
1814 | 1814 | } |
1815 | 1815 | |
@@ -1917,7 +1917,7 @@ discard block |
||
1917 | 1917 | $value = $value[$targetClass->identifier[0]]; |
1918 | 1918 | } |
1919 | 1919 | |
1920 | - $criteria[$tableAlias . '.' . $quotedColumnName] = $value; |
|
1920 | + $criteria[$tableAlias.'.'.$quotedColumnName] = $value; |
|
1921 | 1921 | $parameters[] = [ |
1922 | 1922 | 'value' => $value, |
1923 | 1923 | 'field' => $fieldName, |
@@ -2002,7 +2002,7 @@ discard block |
||
2002 | 2002 | case $property instanceof AssociationMetadata: |
2003 | 2003 | $class = $this->em->getClassMetadata($property->getTargetEntity()); |
2004 | 2004 | |
2005 | - if (! $property->isOwningSide()) { |
|
2005 | + if ( ! $property->isOwningSide()) { |
|
2006 | 2006 | $property = $class->getProperty($property->getMappedBy()); |
2007 | 2007 | $class = $this->em->getClassMetadata($property->getTargetEntity()); |
2008 | 2008 | } |
@@ -2015,7 +2015,7 @@ discard block |
||
2015 | 2015 | /** @var JoinColumnMetadata $joinColumn */ |
2016 | 2016 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
2017 | 2017 | |
2018 | - if (! $joinColumn->getType()) { |
|
2018 | + if ( ! $joinColumn->getType()) { |
|
2019 | 2019 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $class, $this->em)); |
2020 | 2020 | } |
2021 | 2021 | |
@@ -2030,7 +2030,7 @@ discard block |
||
2030 | 2030 | } |
2031 | 2031 | |
2032 | 2032 | if (is_array($value)) { |
2033 | - return array_map(static function ($type) { |
|
2033 | + return array_map(static function($type) { |
|
2034 | 2034 | return $type->getBindingType() + Connection::ARRAY_PARAM_OFFSET; |
2035 | 2035 | }, $types); |
2036 | 2036 | } |
@@ -2087,7 +2087,7 @@ discard block |
||
2087 | 2087 | */ |
2088 | 2088 | private function getIndividualValue($value) |
2089 | 2089 | { |
2090 | - if (! is_object($value) || ! $this->em->getMetadataFactory()->hasMetadataFor(StaticClassNameConverter::getClass($value))) { |
|
2090 | + if ( ! is_object($value) || ! $this->em->getMetadataFactory()->hasMetadataFor(StaticClassNameConverter::getClass($value))) { |
|
2091 | 2091 | return $value; |
2092 | 2092 | } |
2093 | 2093 | |
@@ -2101,7 +2101,7 @@ discard block |
||
2101 | 2101 | { |
2102 | 2102 | $criteria = $this->getIdentifier($entity); |
2103 | 2103 | |
2104 | - if (! $criteria) { |
|
2104 | + if ( ! $criteria) { |
|
2105 | 2105 | return false; |
2106 | 2106 | } |
2107 | 2107 | |
@@ -2109,12 +2109,12 @@ discard block |
||
2109 | 2109 | |
2110 | 2110 | $sql = 'SELECT 1 ' |
2111 | 2111 | . $this->getLockTablesSql(null) |
2112 | - . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
2112 | + . ' WHERE '.$this->getSelectConditionSQL($criteria); |
|
2113 | 2113 | |
2114 | 2114 | [$params, $types] = $this->expandParameters($criteria); |
2115 | 2115 | |
2116 | 2116 | if ($extraConditions !== null) { |
2117 | - $sql .= ' AND ' . $this->getSelectConditionCriteriaSQL($extraConditions); |
|
2117 | + $sql .= ' AND '.$this->getSelectConditionCriteriaSQL($extraConditions); |
|
2118 | 2118 | [$criteriaParams, $criteriaTypes] = $this->expandCriteriaParameters($extraConditions); |
2119 | 2119 | |
2120 | 2120 | $params = array_merge($params, $criteriaParams); |
@@ -2124,7 +2124,7 @@ discard block |
||
2124 | 2124 | $filterSql = $this->generateFilterConditionSQL($this->class, $alias); |
2125 | 2125 | |
2126 | 2126 | if ($filterSql) { |
2127 | - $sql .= ' AND ' . $filterSql; |
|
2127 | + $sql .= ' AND '.$filterSql; |
|
2128 | 2128 | } |
2129 | 2129 | |
2130 | 2130 | return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
@@ -2137,13 +2137,13 @@ discard block |
||
2137 | 2137 | */ |
2138 | 2138 | protected function getJoinSQLForAssociation(AssociationMetadata $association) |
2139 | 2139 | { |
2140 | - if (! $association->isOwningSide()) { |
|
2140 | + if ( ! $association->isOwningSide()) { |
|
2141 | 2141 | return 'LEFT JOIN'; |
2142 | 2142 | } |
2143 | 2143 | |
2144 | 2144 | // if one of the join columns is nullable, return left join |
2145 | 2145 | foreach ($association->getJoinColumns() as $joinColumn) { |
2146 | - if (! $joinColumn->isNullable()) { |
|
2146 | + if ( ! $joinColumn->isNullable()) { |
|
2147 | 2147 | continue; |
2148 | 2148 | } |
2149 | 2149 | |
@@ -2160,7 +2160,7 @@ discard block |
||
2160 | 2160 | */ |
2161 | 2161 | public function getSQLColumnAlias() |
2162 | 2162 | { |
2163 | - return $this->platform->getSQLResultCasing('c' . $this->currentPersisterContext->sqlAliasCounter++); |
|
2163 | + return $this->platform->getSQLResultCasing('c'.$this->currentPersisterContext->sqlAliasCounter++); |
|
2164 | 2164 | } |
2165 | 2165 | |
2166 | 2166 | /** |
@@ -2179,13 +2179,13 @@ discard block |
||
2179 | 2179 | $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias); |
2180 | 2180 | |
2181 | 2181 | if ($filterExpr !== '') { |
2182 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
2182 | + $filterClauses[] = '('.$filterExpr.')'; |
|
2183 | 2183 | } |
2184 | 2184 | } |
2185 | 2185 | |
2186 | 2186 | $sql = implode(' AND ', $filterClauses); |
2187 | 2187 | |
2188 | - return $sql ? '(' . $sql . ')' : ''; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
2188 | + return $sql ? '('.$sql.')' : ''; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
2189 | 2189 | } |
2190 | 2190 | |
2191 | 2191 | /** |
@@ -35,7 +35,7 @@ |
||
35 | 35 | $normalizedAssociatedId = []; |
36 | 36 | |
37 | 37 | foreach ($targetClass->getPropertiesIterator() as $name => $property) { |
38 | - if (! array_key_exists($name, $flatIdentifier)) { |
|
38 | + if ( ! array_key_exists($name, $flatIdentifier)) { |
|
39 | 39 | continue; |
40 | 40 | } |
41 | 41 |
@@ -58,14 +58,14 @@ |
||
58 | 58 | |
59 | 59 | // iterate over association mappings |
60 | 60 | foreach ($class->getPropertiesIterator() as $association) { |
61 | - if (! ($association instanceof AssociationMetadata)) { |
|
61 | + if ( ! ($association instanceof AssociationMetadata)) { |
|
62 | 62 | continue; |
63 | 63 | } |
64 | 64 | |
65 | 65 | // resolve join columns over to-one or to-many |
66 | 66 | $targetClass = $em->getClassMetadata($association->getTargetEntity()); |
67 | 67 | |
68 | - if (! $association->isOwningSide()) { |
|
68 | + if ( ! $association->isOwningSide()) { |
|
69 | 69 | $association = $targetClass->getProperty($association->getMappedBy()); |
70 | 70 | $targetClass = $em->getClassMetadata($association->getTargetEntity()); |
71 | 71 | } |
@@ -181,11 +181,11 @@ discard block |
||
181 | 181 | $pkColumns = []; |
182 | 182 | |
183 | 183 | foreach ($class->getPropertiesIterator() as $fieldName => $property) { |
184 | - if (! ($property instanceof FieldMetadata)) { |
|
184 | + if ( ! ($property instanceof FieldMetadata)) { |
|
185 | 185 | continue; |
186 | 186 | } |
187 | 187 | |
188 | - if (! $class->isInheritedProperty($fieldName)) { |
|
188 | + if ( ! $class->isInheritedProperty($fieldName)) { |
|
189 | 189 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
190 | 190 | |
191 | 191 | $this->gatherColumn($class, $property, $table); |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | } |
221 | 221 | } |
222 | 222 | |
223 | - if (! empty($inheritedKeyColumns)) { |
|
223 | + if ( ! empty($inheritedKeyColumns)) { |
|
224 | 224 | // Add a FK constraint on the ID column |
225 | 225 | $rootClass = $this->em->getClassMetadata($class->getRootClassName()); |
226 | 226 | |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | } |
266 | 266 | } |
267 | 267 | |
268 | - if (! $table->hasIndex('primary')) { |
|
268 | + if ( ! $table->hasIndex('primary')) { |
|
269 | 269 | $table->setPrimaryKey($pkColumns); |
270 | 270 | } |
271 | 271 | |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | $processedClasses[$class->getClassName()] = true; |
326 | 326 | |
327 | 327 | foreach ($class->getPropertiesIterator() as $property) { |
328 | - if (! $property instanceof FieldMetadata |
|
328 | + if ( ! $property instanceof FieldMetadata |
|
329 | 329 | || ! $property->hasValueGenerator() |
330 | 330 | || $property->getValueGenerator()->getType() !== GeneratorType::SEQUENCE |
331 | 331 | || $class->getClassName() !== $class->getRootClassName()) { |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | |
335 | 335 | $quotedName = $this->platform->quoteIdentifier($property->getValueGenerator()->getDefinition()['sequenceName']); |
336 | 336 | |
337 | - if (! $schema->hasSequence($quotedName)) { |
|
337 | + if ( ! $schema->hasSequence($quotedName)) { |
|
338 | 338 | $schema->createSequence($quotedName, $property->getValueGenerator()->getDefinition()['allocationSize']); |
339 | 339 | } |
340 | 340 | } |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | } |
348 | 348 | } |
349 | 349 | |
350 | - if (! $this->platform->supportsSchemas() && ! $this->platform->canEmulateSchemas()) { |
|
350 | + if ( ! $this->platform->supportsSchemas() && ! $this->platform->canEmulateSchemas()) { |
|
351 | 351 | $schema->visit(new RemoveNamespacedAssets()); |
352 | 352 | } |
353 | 353 | |
@@ -386,7 +386,7 @@ discard block |
||
386 | 386 | break; |
387 | 387 | } |
388 | 388 | |
389 | - if (! empty($discrColumn->getColumnDefinition())) { |
|
389 | + if ( ! empty($discrColumn->getColumnDefinition())) { |
|
390 | 390 | $options['columnDefinition'] = $discrColumn->getColumnDefinition(); |
391 | 391 | } |
392 | 392 | |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | $pkColumns = []; |
405 | 405 | |
406 | 406 | foreach ($class->getPropertiesIterator() as $fieldName => $property) { |
407 | - if (! ($property instanceof FieldMetadata)) { |
|
407 | + if ( ! ($property instanceof FieldMetadata)) { |
|
408 | 408 | continue; |
409 | 409 | } |
410 | 410 | |
@@ -508,7 +508,7 @@ discard block |
||
508 | 508 | private function gatherRelationsSql($class, $table, $schema, &$addedFks, &$blacklistedFks) |
509 | 509 | { |
510 | 510 | foreach ($class->getPropertiesIterator() as $fieldName => $property) { |
511 | - if (! ($property instanceof AssociationMetadata)) { |
|
511 | + if ( ! ($property instanceof AssociationMetadata)) { |
|
512 | 512 | continue; |
513 | 513 | } |
514 | 514 | |
@@ -516,7 +516,7 @@ discard block |
||
516 | 516 | continue; |
517 | 517 | } |
518 | 518 | |
519 | - if (! $property->isOwningSide()) { |
|
519 | + if ( ! $property->isOwningSide()) { |
|
520 | 520 | continue; |
521 | 521 | } |
522 | 522 | |
@@ -606,7 +606,7 @@ discard block |
||
606 | 606 | $idColumns = $class->getIdentifierColumns($this->em); |
607 | 607 | $idColumnNameList = array_keys($idColumns); |
608 | 608 | |
609 | - if (! in_array($referencedColumnName, $idColumnNameList, true)) { |
|
609 | + if ( ! in_array($referencedColumnName, $idColumnNameList, true)) { |
|
610 | 610 | return null; |
611 | 611 | } |
612 | 612 | |
@@ -614,7 +614,7 @@ discard block |
||
614 | 614 | foreach ($class->getIdentifierFieldNames() as $fieldName) { |
615 | 615 | $property = $class->getProperty($fieldName); |
616 | 616 | |
617 | - if (! ($property instanceof AssociationMetadata)) { |
|
617 | + if ( ! ($property instanceof AssociationMetadata)) { |
|
618 | 618 | continue; |
619 | 619 | } |
620 | 620 | |
@@ -670,7 +670,7 @@ discard block |
||
670 | 670 | $joinColumn->getReferencedColumnName() |
671 | 671 | ); |
672 | 672 | |
673 | - if (! $definingClass) { |
|
673 | + if ( ! $definingClass) { |
|
674 | 674 | throw MissingColumnException::fromColumnSourceAndTarget( |
675 | 675 | $joinColumn->getReferencedColumnName(), |
676 | 676 | $mapping->getSourceEntity(), |
@@ -685,14 +685,14 @@ discard block |
||
685 | 685 | $localColumns[] = $quotedColumnName; |
686 | 686 | $foreignColumns[] = $quotedReferencedColumnName; |
687 | 687 | |
688 | - if (! $theJoinTable->hasColumn($quotedColumnName)) { |
|
688 | + if ( ! $theJoinTable->hasColumn($quotedColumnName)) { |
|
689 | 689 | // Only add the column to the table if it does not exist already. |
690 | 690 | // It might exist already if the foreign key is mapped into a regular |
691 | 691 | // property as well. |
692 | 692 | $property = $definingClass->getProperty($referencedFieldName); |
693 | 693 | $columnDef = null; |
694 | 694 | |
695 | - if (! empty($joinColumn->getColumnDefinition())) { |
|
695 | + if ( ! empty($joinColumn->getColumnDefinition())) { |
|
696 | 696 | $columnDef = $joinColumn->getColumnDefinition(); |
697 | 697 | } elseif ($property->getColumnDefinition()) { |
698 | 698 | $columnDef = $property->getColumnDefinition(); |
@@ -724,7 +724,7 @@ discard block |
||
724 | 724 | $uniqueConstraints[] = ['columns' => [$quotedColumnName]]; |
725 | 725 | } |
726 | 726 | |
727 | - if (! empty($joinColumn->getOnDelete())) { |
|
727 | + if ( ! empty($joinColumn->getOnDelete())) { |
|
728 | 728 | $fkOptions['onDelete'] = $joinColumn->getOnDelete(); |
729 | 729 | } |
730 | 730 | } |
@@ -735,7 +735,7 @@ discard block |
||
735 | 735 | $theJoinTable->addUniqueIndex($unique['columns'], is_numeric($indexName) ? null : $indexName); |
736 | 736 | } |
737 | 737 | |
738 | - $compositeName = $theJoinTable->getName() . '.' . implode('', $localColumns); |
|
738 | + $compositeName = $theJoinTable->getName().'.'.implode('', $localColumns); |
|
739 | 739 | |
740 | 740 | if (isset($addedFks[$compositeName]) |
741 | 741 | && ($foreignTableName !== $addedFks[$compositeName]['foreignTableName'] |
@@ -752,7 +752,7 @@ discard block |
||
752 | 752 | } |
753 | 753 | |
754 | 754 | $blacklistedFks[$compositeName] = true; |
755 | - } elseif (! isset($blacklistedFks[$compositeName])) { |
|
755 | + } elseif ( ! isset($blacklistedFks[$compositeName])) { |
|
756 | 756 | $addedFks[$compositeName] = [ |
757 | 757 | 'foreignTableName' => $foreignTableName, |
758 | 758 | 'foreignColumns' => $foreignColumns, |
@@ -851,7 +851,7 @@ discard block |
||
851 | 851 | $fullSchema = $sm->createSchema(); |
852 | 852 | |
853 | 853 | foreach ($fullSchema->getTables() as $table) { |
854 | - if (! $schema->hasTable($table->getName())) { |
|
854 | + if ( ! $schema->hasTable($table->getName())) { |
|
855 | 855 | foreach ($table->getForeignKeys() as $foreignKey) { |
856 | 856 | /** @var $foreignKey ForeignKeyConstraint */ |
857 | 857 | if ($schema->hasTable($foreignKey->getForeignTableName())) { |
@@ -876,7 +876,7 @@ discard block |
||
876 | 876 | if ($table->hasPrimaryKey()) { |
877 | 877 | $columns = $table->getPrimaryKey()->getColumns(); |
878 | 878 | if (count($columns) === 1) { |
879 | - $checkSequence = $table->getName() . '_' . $columns[0] . '_seq'; |
|
879 | + $checkSequence = $table->getName().'_'.$columns[0].'_seq'; |
|
880 | 880 | if ($fullSchema->hasSequence($checkSequence)) { |
881 | 881 | $visitor->acceptSequence($fullSchema->getSequence($checkSequence)); |
882 | 882 | } |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | $ce = []; |
80 | 80 | |
81 | 81 | foreach ($class->getPropertiesIterator() as $fieldName => $association) { |
82 | - if (! ($association instanceof AssociationMetadata)) { |
|
82 | + if ( ! ($association instanceof AssociationMetadata)) { |
|
83 | 83 | continue; |
84 | 84 | } |
85 | 85 | |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | } |
88 | 88 | |
89 | 89 | foreach ($class->getSubClasses() as $subClass) { |
90 | - if (! in_array($class->getClassName(), class_parents($subClass), true)) { |
|
90 | + if ( ! in_array($class->getClassName(), class_parents($subClass), true)) { |
|
91 | 91 | $message = "According to the discriminator map class, '%s' has to be a child of '%s', but these entities are not related through inheritance."; |
92 | 92 | |
93 | 93 | $ce[] = sprintf($message, $subClass, $class->getClassName()); |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | $fieldName = $association->getName(); |
107 | 107 | $targetEntity = $association->getTargetEntity(); |
108 | 108 | |
109 | - if (! class_exists($targetEntity) || $metadataFactory->isTransient($targetEntity)) { |
|
109 | + if ( ! class_exists($targetEntity) || $metadataFactory->isTransient($targetEntity)) { |
|
110 | 110 | $message = "The target entity '%s' specified on %s#%s is unknown or not an entity."; |
111 | 111 | |
112 | 112 | return [sprintf($message, $targetEntity, $class->getClassName(), $fieldName)]; |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | |
126 | 126 | /** @var ClassMetadata $targetMetadata */ |
127 | 127 | $targetMetadata = $metadataFactory->getMetadataFor($targetEntity); |
128 | - $containsForeignId = array_filter($targetMetadata->identifier, static function ($identifier) use ($targetMetadata) { |
|
128 | + $containsForeignId = array_filter($targetMetadata->identifier, static function($identifier) use ($targetMetadata) { |
|
129 | 129 | $targetProperty = $targetMetadata->getProperty($identifier); |
130 | 130 | |
131 | 131 | return $targetProperty instanceof AssociationMetadata; |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | /** @var AssociationMetadata $targetAssociation */ |
142 | 142 | $targetAssociation = $targetMetadata->getProperty($mappedBy); |
143 | 143 | |
144 | - if (! $targetAssociation) { |
|
144 | + if ( ! $targetAssociation) { |
|
145 | 145 | $message = 'The association %s#%s refers to the owning side property %s#%s which does not exist.'; |
146 | 146 | |
147 | 147 | $ce[] = sprintf($message, $class->getClassName(), $fieldName, $targetEntity, $mappedBy); |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | /** @var AssociationMetadata $targetAssociation */ |
166 | 166 | $targetAssociation = $targetMetadata->getProperty($inversedBy); |
167 | 167 | |
168 | - if (! $targetAssociation) { |
|
168 | + if ( ! $targetAssociation) { |
|
169 | 169 | $message = 'The association %s#%s refers to the inverse side property %s#%s which does not exist.'; |
170 | 170 | |
171 | 171 | $ce[] = sprintf($message, $class->getClassName(), $fieldName, $targetEntity, $inversedBy); |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | $joinTable = $association->getJoinTable(); |
210 | 210 | |
211 | 211 | foreach ($joinTable->getJoinColumns() as $joinColumn) { |
212 | - if (! in_array($joinColumn->getReferencedColumnName(), $classIdentifierColumns, true)) { |
|
212 | + if ( ! in_array($joinColumn->getReferencedColumnName(), $classIdentifierColumns, true)) { |
|
213 | 213 | $message = "The referenced column name '%s' has to be a primary key column on the target entity class '%s'."; |
214 | 214 | |
215 | 215 | $ce[] = sprintf($message, $joinColumn->getReferencedColumnName(), $class->getClassName()); |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | } |
219 | 219 | |
220 | 220 | foreach ($joinTable->getInverseJoinColumns() as $inverseJoinColumn) { |
221 | - if (! in_array($inverseJoinColumn->getReferencedColumnName(), $targetIdentifierColumns, true)) { |
|
221 | + if ( ! in_array($inverseJoinColumn->getReferencedColumnName(), $targetIdentifierColumns, true)) { |
|
222 | 222 | $message = "The referenced column name '%s' has to be a primary key column on the target entity class '%s'."; |
223 | 223 | |
224 | 224 | $ce[] = sprintf($message, $inverseJoinColumn->getReferencedColumnName(), $targetMetadata->getClassName()); |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | |
229 | 229 | if (count($targetIdentifierColumns) !== count($joinTable->getInverseJoinColumns())) { |
230 | 230 | $columnNames = array_map( |
231 | - static function (JoinColumnMetadata $joinColumn) { |
|
231 | + static function(JoinColumnMetadata $joinColumn) { |
|
232 | 232 | return $joinColumn->getReferencedColumnName(); |
233 | 233 | }, |
234 | 234 | $joinTable->getInverseJoinColumns() |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | |
244 | 244 | if (count($classIdentifierColumns) !== count($joinTable->getJoinColumns())) { |
245 | 245 | $columnNames = array_map( |
246 | - static function (JoinColumnMetadata $joinColumn) { |
|
246 | + static function(JoinColumnMetadata $joinColumn) { |
|
247 | 247 | return $joinColumn->getReferencedColumnName(); |
248 | 248 | }, |
249 | 249 | $joinTable->getJoinColumns() |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | $joinColumns = $association->getJoinColumns(); |
261 | 261 | |
262 | 262 | foreach ($joinColumns as $joinColumn) { |
263 | - if (! in_array($joinColumn->getReferencedColumnName(), $identifierColumns, true)) { |
|
263 | + if ( ! in_array($joinColumn->getReferencedColumnName(), $identifierColumns, true)) { |
|
264 | 264 | $message = "The referenced column name '%s' has to be a primary key column on the target entity class '%s'."; |
265 | 265 | |
266 | 266 | $ce[] = sprintf($message, $joinColumn->getReferencedColumnName(), $targetMetadata->getClassName()); |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | continue; |
292 | 292 | } |
293 | 293 | |
294 | - if (! ($targetProperty instanceof AssociationMetadata)) { |
|
294 | + if ( ! ($targetProperty instanceof AssociationMetadata)) { |
|
295 | 295 | $message = "The association %s#%s is ordered by a property '%s' that is non-existing field on the target entity '%s'."; |
296 | 296 | |
297 | 297 | $ce[] = sprintf($message, $class->getClassName(), $fieldName, $orderField, $targetMetadata->getClassName()); |
@@ -62,28 +62,28 @@ discard block |
||
62 | 62 | $fh = fopen($this->file, 'xb+'); |
63 | 63 | |
64 | 64 | if (count($identityMap) === 0) { |
65 | - fwrite($fh, 'Flush Operation [' . $this->context . "] - Empty identity map.\n"); |
|
65 | + fwrite($fh, 'Flush Operation ['.$this->context."] - Empty identity map.\n"); |
|
66 | 66 | |
67 | 67 | return; |
68 | 68 | } |
69 | 69 | |
70 | - fwrite($fh, 'Flush Operation [' . $this->context . "] - Dumping identity map:\n"); |
|
70 | + fwrite($fh, 'Flush Operation ['.$this->context."] - Dumping identity map:\n"); |
|
71 | 71 | |
72 | 72 | foreach ($identityMap as $className => $map) { |
73 | - fwrite($fh, 'Class: ' . $className . "\n"); |
|
73 | + fwrite($fh, 'Class: '.$className."\n"); |
|
74 | 74 | |
75 | 75 | foreach ($map as $entity) { |
76 | - fwrite($fh, ' Entity: ' . $this->getIdString($entity, $uow) . ' ' . spl_object_id($entity) . "\n"); |
|
76 | + fwrite($fh, ' Entity: '.$this->getIdString($entity, $uow).' '.spl_object_id($entity)."\n"); |
|
77 | 77 | fwrite($fh, " Associations:\n"); |
78 | 78 | |
79 | 79 | $cm = $em->getClassMetadata($className); |
80 | 80 | |
81 | 81 | foreach ($cm->getPropertiesIterator() as $field => $association) { |
82 | - if (! ($association instanceof AssociationMetadata)) { |
|
82 | + if ( ! ($association instanceof AssociationMetadata)) { |
|
83 | 83 | continue; |
84 | 84 | } |
85 | 85 | |
86 | - fwrite($fh, ' ' . $field . ' '); |
|
86 | + fwrite($fh, ' '.$field.' '); |
|
87 | 87 | |
88 | 88 | $value = $association->getValue($entity); |
89 | 89 | |
@@ -98,21 +98,21 @@ discard block |
||
98 | 98 | fwrite($fh, '[PROXY] '); |
99 | 99 | } |
100 | 100 | |
101 | - fwrite($fh, $this->getIdString($value, $uow) . ' ' . spl_object_id($value) . "\n"); |
|
101 | + fwrite($fh, $this->getIdString($value, $uow).' '.spl_object_id($value)."\n"); |
|
102 | 102 | } else { |
103 | 103 | $initialized = ! ($value instanceof PersistentCollection) || $value->isInitialized(); |
104 | 104 | |
105 | 105 | if ($initialized) { |
106 | - fwrite($fh, '[INITIALIZED] ' . $this->getType($value) . ' ' . count($value) . " elements\n"); |
|
106 | + fwrite($fh, '[INITIALIZED] '.$this->getType($value).' '.count($value)." elements\n"); |
|
107 | 107 | |
108 | 108 | foreach ($value as $obj) { |
109 | - fwrite($fh, ' ' . $this->getIdString($obj, $uow) . ' ' . spl_object_id($obj) . "\n"); |
|
109 | + fwrite($fh, ' '.$this->getIdString($obj, $uow).' '.spl_object_id($obj)."\n"); |
|
110 | 110 | } |
111 | 111 | } else { |
112 | - fwrite($fh, '[PROXY] ' . $this->getType($value) . " unknown element size\n"); |
|
112 | + fwrite($fh, '[PROXY] '.$this->getType($value)." unknown element size\n"); |
|
113 | 113 | |
114 | 114 | foreach ($value->unwrap() as $obj) { |
115 | - fwrite($fh, ' ' . $this->getIdString($obj, $uow) . ' ' . spl_object_id($obj) . "\n"); |
|
115 | + fwrite($fh, ' '.$this->getIdString($obj, $uow).' '.spl_object_id($obj)."\n"); |
|
116 | 116 | } |
117 | 117 | } |
118 | 118 | } |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | $idstring = ''; |
152 | 152 | |
153 | 153 | foreach ($ids as $k => $v) { |
154 | - $idstring .= $k . '=' . $v; |
|
154 | + $idstring .= $k.'='.$v; |
|
155 | 155 | } |
156 | 156 | } else { |
157 | 157 | $idstring = 'NEWOBJECT '; |
@@ -270,10 +270,10 @@ discard block |
||
270 | 270 | */ |
271 | 271 | public function getSQLTableAlias($tableName, $dqlAlias = '') |
272 | 272 | { |
273 | - $tableName .= $dqlAlias ? '@[' . $dqlAlias . ']' : ''; |
|
273 | + $tableName .= $dqlAlias ? '@['.$dqlAlias.']' : ''; |
|
274 | 274 | |
275 | - if (! isset($this->tableAliasMap[$tableName])) { |
|
276 | - $this->tableAliasMap[$tableName] = 't' . $this->tableAliasCounter++; |
|
275 | + if ( ! isset($this->tableAliasMap[$tableName])) { |
|
276 | + $this->tableAliasMap[$tableName] = 't'.$this->tableAliasCounter++; |
|
277 | 277 | } |
278 | 278 | |
279 | 279 | return $this->tableAliasMap[$tableName]; |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | */ |
292 | 292 | public function setSQLTableAlias($tableName, $alias, $dqlAlias = '') |
293 | 293 | { |
294 | - $tableName .= $dqlAlias ? '@[' . $dqlAlias . ']' : ''; |
|
294 | + $tableName .= $dqlAlias ? '@['.$dqlAlias.']' : ''; |
|
295 | 295 | |
296 | 296 | $this->tableAliasMap[$tableName] = $alias; |
297 | 297 | |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | */ |
306 | 306 | public function getSQLColumnAlias() |
307 | 307 | { |
308 | - return $this->platform->getSQLResultCasing('c' . $this->aliasCounter++); |
|
308 | + return $this->platform->getSQLResultCasing('c'.$this->aliasCounter++); |
|
309 | 309 | } |
310 | 310 | |
311 | 311 | /** |
@@ -332,14 +332,14 @@ discard block |
||
332 | 332 | |
333 | 333 | // If this is a joined association we must use left joins to preserve the correct result. |
334 | 334 | $sql .= isset($this->queryComponents[$dqlAlias]['relation']) ? ' LEFT ' : ' INNER '; |
335 | - $sql .= 'JOIN ' . $tableName . ' ' . $tableAlias . ' ON '; |
|
335 | + $sql .= 'JOIN '.$tableName.' '.$tableAlias.' ON '; |
|
336 | 336 | |
337 | 337 | $sqlParts = []; |
338 | 338 | |
339 | 339 | foreach ($class->getIdentifierColumns($this->em) as $column) { |
340 | 340 | $quotedColumnName = $this->platform->quoteIdentifier($column->getColumnName()); |
341 | 341 | |
342 | - $sqlParts[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName; |
|
342 | + $sqlParts[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName; |
|
343 | 343 | } |
344 | 344 | |
345 | 345 | $filterSql = $this->generateFilterConditionSQL($parentClass, $tableAlias); |
@@ -363,14 +363,14 @@ discard block |
||
363 | 363 | $tableName = $subClass->table->getQuotedQualifiedName($this->platform); |
364 | 364 | $tableAlias = $this->getSQLTableAlias($subClass->getTableName(), $dqlAlias); |
365 | 365 | |
366 | - $sql .= ' LEFT JOIN ' . $tableName . ' ' . $tableAlias . ' ON '; |
|
366 | + $sql .= ' LEFT JOIN '.$tableName.' '.$tableAlias.' ON '; |
|
367 | 367 | |
368 | 368 | $sqlParts = []; |
369 | 369 | |
370 | 370 | foreach ($subClass->getIdentifierColumns($this->em) as $column) { |
371 | 371 | $quotedColumnName = $this->platform->quoteIdentifier($column->getColumnName()); |
372 | 372 | |
373 | - $sqlParts[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName; |
|
373 | + $sqlParts[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName; |
|
374 | 374 | } |
375 | 375 | |
376 | 376 | $sql .= implode(' AND ', $sqlParts); |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | $qComp = $this->queryComponents[$dqlAlias]; |
392 | 392 | $association = $qComp['relation']; |
393 | 393 | |
394 | - if (! ($association instanceof ToManyAssociationMetadata)) { |
|
394 | + if ( ! ($association instanceof ToManyAssociationMetadata)) { |
|
395 | 395 | continue; |
396 | 396 | } |
397 | 397 | |
@@ -399,7 +399,7 @@ discard block |
||
399 | 399 | $property = $qComp['metadata']->getProperty($fieldName); |
400 | 400 | $tableName = $property->getTableName(); |
401 | 401 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
402 | - $orderedColumn = $this->getSQLTableAlias($tableName, $dqlAlias) . '.' . $columnName; |
|
402 | + $orderedColumn = $this->getSQLTableAlias($tableName, $dqlAlias).'.'.$columnName; |
|
403 | 403 | |
404 | 404 | // OrderByClause should replace an ordered relation. see - DDC-2475 |
405 | 405 | if (isset($this->orderedColumnsMap[$orderedColumn])) { |
@@ -407,7 +407,7 @@ discard block |
||
407 | 407 | } |
408 | 408 | |
409 | 409 | $this->orderedColumnsMap[$orderedColumn] = $orientation; |
410 | - $orderedColumns[] = $orderedColumn . ' ' . $orientation; |
|
410 | + $orderedColumns[] = $orderedColumn.' '.$orientation; |
|
411 | 411 | } |
412 | 412 | } |
413 | 413 | |
@@ -447,19 +447,19 @@ discard block |
||
447 | 447 | $discrColumnType = $discrColumn->getType(); |
448 | 448 | $quotedColumnName = $this->platform->quoteIdentifier($discrColumn->getColumnName()); |
449 | 449 | $sqlTableAlias = $this->useSqlTableAliases |
450 | - ? $this->getSQLTableAlias($discrColumn->getTableName(), $dqlAlias) . '.' |
|
450 | + ? $this->getSQLTableAlias($discrColumn->getTableName(), $dqlAlias).'.' |
|
451 | 451 | : ''; |
452 | 452 | |
453 | 453 | $sqlParts[] = sprintf( |
454 | 454 | '%s IN (%s)', |
455 | - $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias . $quotedColumnName, $this->platform), |
|
455 | + $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias.$quotedColumnName, $this->platform), |
|
456 | 456 | implode(', ', $values) |
457 | 457 | ); |
458 | 458 | } |
459 | 459 | |
460 | 460 | $sql = implode(' AND ', $sqlParts); |
461 | 461 | |
462 | - return isset($sqlParts[1]) ? '(' . $sql . ')' : $sql; |
|
462 | + return isset($sqlParts[1]) ? '('.$sql.')' : $sql; |
|
463 | 463 | } |
464 | 464 | |
465 | 465 | /** |
@@ -472,7 +472,7 @@ discard block |
||
472 | 472 | */ |
473 | 473 | private function generateFilterConditionSQL(ClassMetadata $targetEntity, $targetTableAlias) |
474 | 474 | { |
475 | - if (! $this->em->hasFilters()) { |
|
475 | + if ( ! $this->em->hasFilters()) { |
|
476 | 476 | return ''; |
477 | 477 | } |
478 | 478 | |
@@ -505,7 +505,7 @@ discard block |
||
505 | 505 | $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias); |
506 | 506 | |
507 | 507 | if ($filterExpr !== '') { |
508 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
508 | + $filterClauses[] = '('.$filterExpr.')'; |
|
509 | 509 | } |
510 | 510 | } |
511 | 511 | |
@@ -536,11 +536,11 @@ discard block |
||
536 | 536 | $sql .= $this->walkOrderByClause($AST->orderByClause); |
537 | 537 | } |
538 | 538 | |
539 | - if (! $AST->orderByClause) { |
|
539 | + if ( ! $AST->orderByClause) { |
|
540 | 540 | $orderBySql = $this->generateOrderedCollectionOrderByItems(); |
541 | 541 | |
542 | 542 | if ($orderBySql) { |
543 | - $sql .= ' ORDER BY ' . $orderBySql; |
|
543 | + $sql .= ' ORDER BY '.$orderBySql; |
|
544 | 544 | } |
545 | 545 | } |
546 | 546 | |
@@ -553,11 +553,11 @@ discard block |
||
553 | 553 | } |
554 | 554 | |
555 | 555 | if ($lockMode === LockMode::PESSIMISTIC_READ) { |
556 | - return $sql . ' ' . $this->platform->getReadLockSQL(); |
|
556 | + return $sql.' '.$this->platform->getReadLockSQL(); |
|
557 | 557 | } |
558 | 558 | |
559 | 559 | if ($lockMode === LockMode::PESSIMISTIC_WRITE) { |
560 | - return $sql . ' ' . $this->platform->getWriteLockSQL(); |
|
560 | + return $sql.' '.$this->platform->getWriteLockSQL(); |
|
561 | 561 | } |
562 | 562 | |
563 | 563 | if ($lockMode !== LockMode::OPTIMISTIC) { |
@@ -565,7 +565,7 @@ discard block |
||
565 | 565 | } |
566 | 566 | |
567 | 567 | foreach ($this->selectedClasses as $selectedClass) { |
568 | - if (! $selectedClass['class']->isVersioned()) { |
|
568 | + if ( ! $selectedClass['class']->isVersioned()) { |
|
569 | 569 | throw OptimisticLockException::lockFailed($selectedClass['class']->getClassName()); |
570 | 570 | } |
571 | 571 | } |
@@ -614,7 +614,7 @@ discard block |
||
614 | 614 | foreach ($class->getIdentifierColumns($this->em) as $column) { |
615 | 615 | $quotedColumnName = $this->platform->quoteIdentifier($column->getColumnName()); |
616 | 616 | |
617 | - $sqlParts[] = $tableAlias . '.' . $quotedColumnName; |
|
617 | + $sqlParts[] = $tableAlias.'.'.$quotedColumnName; |
|
618 | 618 | } |
619 | 619 | |
620 | 620 | return implode(', ', $sqlParts); |
@@ -632,7 +632,7 @@ discard block |
||
632 | 632 | { |
633 | 633 | $class = $this->queryComponents[$identificationVariable]['metadata']; |
634 | 634 | |
635 | - if (! $fieldName) { |
|
635 | + if ( ! $fieldName) { |
|
636 | 636 | return $this->getSQLTableAlias($class->getTableName(), $identificationVariable); |
637 | 637 | } |
638 | 638 | |
@@ -661,7 +661,7 @@ discard block |
||
661 | 661 | $property = $class->getProperty($fieldName); |
662 | 662 | |
663 | 663 | if ($this->useSqlTableAliases) { |
664 | - $sql .= $this->walkIdentificationVariable($dqlAlias, $fieldName) . '.'; |
|
664 | + $sql .= $this->walkIdentificationVariable($dqlAlias, $fieldName).'.'; |
|
665 | 665 | } |
666 | 666 | |
667 | 667 | $sql .= $this->platform->quoteIdentifier($property->getColumnName()); |
@@ -675,7 +675,7 @@ discard block |
||
675 | 675 | $class = $this->queryComponents[$dqlAlias]['metadata']; |
676 | 676 | $association = $class->getProperty($fieldName); |
677 | 677 | |
678 | - if (! $association->isOwningSide()) { |
|
678 | + if ( ! $association->isOwningSide()) { |
|
679 | 679 | throw QueryException::associationPathInverseSideNotSupported($pathExpr); |
680 | 680 | } |
681 | 681 | |
@@ -689,7 +689,7 @@ discard block |
||
689 | 689 | $joinColumn = reset($joinColumns); |
690 | 690 | |
691 | 691 | if ($this->useSqlTableAliases) { |
692 | - $sql .= $this->getSQLTableAlias($joinColumn->getTableName(), $dqlAlias) . '.'; |
|
692 | + $sql .= $this->getSQLTableAlias($joinColumn->getTableName(), $dqlAlias).'.'; |
|
693 | 693 | } |
694 | 694 | |
695 | 695 | $sql .= $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
@@ -707,7 +707,7 @@ discard block |
||
707 | 707 | */ |
708 | 708 | public function walkSelectClause($selectClause) |
709 | 709 | { |
710 | - $sql = 'SELECT ' . ($selectClause->isDistinct ? 'DISTINCT ' : ''); |
|
710 | + $sql = 'SELECT '.($selectClause->isDistinct ? 'DISTINCT ' : ''); |
|
711 | 711 | $sqlSelectExpressions = array_filter(array_map([$this, 'walkSelectExpression'], $selectClause->selectExpressions)); |
712 | 712 | |
713 | 713 | if ($this->query->getHint(Query::HINT_INTERNAL_ITERATION) === true && $selectClause->isDistinct) { |
@@ -750,7 +750,7 @@ discard block |
||
750 | 750 | |
751 | 751 | $sqlSelectExpressions[] = sprintf( |
752 | 752 | '%s AS %s', |
753 | - $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias . '.' . $quotedColumnName, $this->platform), |
|
753 | + $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias.'.'.$quotedColumnName, $this->platform), |
|
754 | 754 | $sqlColumnAlias |
755 | 755 | ); |
756 | 756 | |
@@ -760,7 +760,7 @@ discard block |
||
760 | 760 | |
761 | 761 | // Add foreign key columns of class and also parent classes |
762 | 762 | foreach ($class->getPropertiesIterator() as $association) { |
763 | - if (! ($association instanceof ToOneAssociationMetadata && $association->isOwningSide()) |
|
763 | + if ( ! ($association instanceof ToOneAssociationMetadata && $association->isOwningSide()) |
|
764 | 764 | || ( ! $addMetaColumns && ! $association->isPrimaryKey())) { |
765 | 765 | continue; |
766 | 766 | } |
@@ -775,7 +775,7 @@ discard block |
||
775 | 775 | $columnAlias = $this->getSQLColumnAlias(); |
776 | 776 | $sqlTableAlias = $this->getSQLTableAlias($joinColumn->getTableName(), $dqlAlias); |
777 | 777 | |
778 | - if (! $joinColumn->getType()) { |
|
778 | + if ( ! $joinColumn->getType()) { |
|
779 | 779 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
780 | 780 | } |
781 | 781 | |
@@ -791,7 +791,7 @@ discard block |
||
791 | 791 | } |
792 | 792 | |
793 | 793 | // Add foreign key columns to SQL, if necessary |
794 | - if (! $addMetaColumns) { |
|
794 | + if ( ! $addMetaColumns) { |
|
795 | 795 | continue; |
796 | 796 | } |
797 | 797 | |
@@ -805,7 +805,7 @@ discard block |
||
805 | 805 | continue; |
806 | 806 | } |
807 | 807 | |
808 | - if (! ($association instanceof ToOneAssociationMetadata && $association->isOwningSide())) { |
|
808 | + if ( ! ($association instanceof ToOneAssociationMetadata && $association->isOwningSide())) { |
|
809 | 809 | continue; |
810 | 810 | } |
811 | 811 | |
@@ -819,7 +819,7 @@ discard block |
||
819 | 819 | $columnAlias = $this->getSQLColumnAlias(); |
820 | 820 | $sqlTableAlias = $this->getSQLTableAlias($joinColumn->getTableName(), $dqlAlias); |
821 | 821 | |
822 | - if (! $joinColumn->getType()) { |
|
822 | + if ( ! $joinColumn->getType()) { |
|
823 | 823 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
824 | 824 | } |
825 | 825 | |
@@ -836,7 +836,7 @@ discard block |
||
836 | 836 | } |
837 | 837 | } |
838 | 838 | |
839 | - return $sql . implode(', ', $sqlSelectExpressions); |
|
839 | + return $sql.implode(', ', $sqlSelectExpressions); |
|
840 | 840 | } |
841 | 841 | |
842 | 842 | /** |
@@ -851,7 +851,7 @@ discard block |
||
851 | 851 | $sqlParts[] = $this->walkIdentificationVariableDeclaration($identificationVariableDecl); |
852 | 852 | } |
853 | 853 | |
854 | - return ' FROM ' . implode(', ', $sqlParts); |
|
854 | + return ' FROM '.implode(', ', $sqlParts); |
|
855 | 855 | } |
856 | 856 | |
857 | 857 | /** |
@@ -926,7 +926,7 @@ discard block |
||
926 | 926 | $tableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
927 | 927 | |
928 | 928 | $sql = $this->platform->appendLockHint( |
929 | - $tableName . ' ' . $tableAlias, |
|
929 | + $tableName.' '.$tableAlias, |
|
930 | 930 | $this->query->getHint(Query::HINT_LOCK_MODE) |
931 | 931 | ); |
932 | 932 | |
@@ -936,11 +936,11 @@ discard block |
||
936 | 936 | |
937 | 937 | $classTableInheritanceJoins = $this->generateClassTableInheritanceJoins($class, $dqlAlias); |
938 | 938 | |
939 | - if (! $buildNestedJoins) { |
|
940 | - return $sql . $classTableInheritanceJoins; |
|
939 | + if ( ! $buildNestedJoins) { |
|
940 | + return $sql.$classTableInheritanceJoins; |
|
941 | 941 | } |
942 | 942 | |
943 | - return $classTableInheritanceJoins === '' ? $sql : '(' . $sql . $classTableInheritanceJoins . ')'; |
|
943 | + return $classTableInheritanceJoins === '' ? $sql : '('.$sql.$classTableInheritanceJoins.')'; |
|
944 | 944 | } |
945 | 945 | |
946 | 946 | /** |
@@ -976,7 +976,7 @@ discard block |
||
976 | 976 | : $association; |
977 | 977 | |
978 | 978 | if ($this->query->getHint(Query::HINT_INTERNAL_ITERATION) === true && |
979 | - (! $this->query->getHint(self::HINT_DISTINCT) || isset($this->selectedClasses[$joinedDqlAlias]))) { |
|
979 | + ( ! $this->query->getHint(self::HINT_DISTINCT) || isset($this->selectedClasses[$joinedDqlAlias]))) { |
|
980 | 980 | if ($association instanceof ToManyAssociationMetadata) { |
981 | 981 | throw QueryException::iterateWithFetchJoinNotAllowed($owningAssociation); |
982 | 982 | } |
@@ -1030,7 +1030,7 @@ discard block |
||
1030 | 1030 | } |
1031 | 1031 | |
1032 | 1032 | $targetTableJoin = [ |
1033 | - 'table' => $targetTableName . ' ' . $targetTableAlias, |
|
1033 | + 'table' => $targetTableName.' '.$targetTableAlias, |
|
1034 | 1034 | 'condition' => implode(' AND ', $conditions), |
1035 | 1035 | ]; |
1036 | 1036 | } elseif ($owningAssociation instanceof ManyToManyAssociationMetadata) { |
@@ -1057,7 +1057,7 @@ discard block |
||
1057 | 1057 | ); |
1058 | 1058 | } |
1059 | 1059 | |
1060 | - $sql .= $joinTableName . ' ' . $joinTableAlias . ' ON ' . implode(' AND ', $conditions); |
|
1060 | + $sql .= $joinTableName.' '.$joinTableAlias.' ON '.implode(' AND ', $conditions); |
|
1061 | 1061 | |
1062 | 1062 | // Join target table |
1063 | 1063 | $sql .= $joinType === AST\Join::JOIN_TYPE_LEFT || $joinType === AST\Join::JOIN_TYPE_LEFTOUTER ? ' LEFT JOIN ' : ' INNER JOIN '; |
@@ -1095,7 +1095,7 @@ discard block |
||
1095 | 1095 | } |
1096 | 1096 | |
1097 | 1097 | $targetTableJoin = [ |
1098 | - 'table' => $targetTableName . ' ' . $targetTableAlias, |
|
1098 | + 'table' => $targetTableName.' '.$targetTableAlias, |
|
1099 | 1099 | 'condition' => implode(' AND ', $conditions), |
1100 | 1100 | ]; |
1101 | 1101 | } else { |
@@ -1103,23 +1103,23 @@ discard block |
||
1103 | 1103 | } |
1104 | 1104 | |
1105 | 1105 | // Handle WITH clause |
1106 | - $withCondition = $condExpr === null ? '' : ('(' . $this->walkConditionalExpression($condExpr) . ')'); |
|
1106 | + $withCondition = $condExpr === null ? '' : ('('.$this->walkConditionalExpression($condExpr).')'); |
|
1107 | 1107 | |
1108 | 1108 | if ($targetClass->inheritanceType === InheritanceType::JOINED) { |
1109 | 1109 | $ctiJoins = $this->generateClassTableInheritanceJoins($targetClass, $joinedDqlAlias); |
1110 | 1110 | |
1111 | 1111 | // If we have WITH condition, we need to build nested joins for target class table and cti joins |
1112 | 1112 | if ($withCondition) { |
1113 | - $sql .= '(' . $targetTableJoin['table'] . $ctiJoins . ') ON ' . $targetTableJoin['condition']; |
|
1113 | + $sql .= '('.$targetTableJoin['table'].$ctiJoins.') ON '.$targetTableJoin['condition']; |
|
1114 | 1114 | } else { |
1115 | - $sql .= $targetTableJoin['table'] . ' ON ' . $targetTableJoin['condition'] . $ctiJoins; |
|
1115 | + $sql .= $targetTableJoin['table'].' ON '.$targetTableJoin['condition'].$ctiJoins; |
|
1116 | 1116 | } |
1117 | 1117 | } else { |
1118 | - $sql .= $targetTableJoin['table'] . ' ON ' . $targetTableJoin['condition']; |
|
1118 | + $sql .= $targetTableJoin['table'].' ON '.$targetTableJoin['condition']; |
|
1119 | 1119 | } |
1120 | 1120 | |
1121 | 1121 | if ($withCondition) { |
1122 | - $sql .= ' AND ' . $withCondition; |
|
1122 | + $sql .= ' AND '.$withCondition; |
|
1123 | 1123 | } |
1124 | 1124 | |
1125 | 1125 | // Apply the indexes |
@@ -1153,7 +1153,7 @@ discard block |
||
1153 | 1153 | $orderByItems = array_merge($orderByItems, (array) $collectionOrderByItems); |
1154 | 1154 | } |
1155 | 1155 | |
1156 | - return ' ORDER BY ' . implode(', ', $orderByItems); |
|
1156 | + return ' ORDER BY '.implode(', ', $orderByItems); |
|
1157 | 1157 | } |
1158 | 1158 | |
1159 | 1159 | /** |
@@ -1170,10 +1170,10 @@ discard block |
||
1170 | 1170 | $this->orderedColumnsMap[$sql] = $type; |
1171 | 1171 | |
1172 | 1172 | if ($expr instanceof AST\Subselect) { |
1173 | - return '(' . $sql . ') ' . $type; |
|
1173 | + return '('.$sql.') '.$type; |
|
1174 | 1174 | } |
1175 | 1175 | |
1176 | - return $sql . ' ' . $type; |
|
1176 | + return $sql.' '.$type; |
|
1177 | 1177 | } |
1178 | 1178 | |
1179 | 1179 | /** |
@@ -1181,7 +1181,7 @@ discard block |
||
1181 | 1181 | */ |
1182 | 1182 | public function walkHavingClause($havingClause) |
1183 | 1183 | { |
1184 | - return ' HAVING ' . $this->walkConditionalExpression($havingClause->conditionalExpression); |
|
1184 | + return ' HAVING '.$this->walkConditionalExpression($havingClause->conditionalExpression); |
|
1185 | 1185 | } |
1186 | 1186 | |
1187 | 1187 | /** |
@@ -1204,7 +1204,7 @@ discard block |
||
1204 | 1204 | $conditions = []; |
1205 | 1205 | |
1206 | 1206 | if ($join->conditionalExpression) { |
1207 | - $conditions[] = '(' . $this->walkConditionalExpression($join->conditionalExpression) . ')'; |
|
1207 | + $conditions[] = '('.$this->walkConditionalExpression($join->conditionalExpression).')'; |
|
1208 | 1208 | } |
1209 | 1209 | |
1210 | 1210 | $isUnconditionalJoin = empty($conditions); |
@@ -1229,7 +1229,7 @@ discard block |
||
1229 | 1229 | } |
1230 | 1230 | |
1231 | 1231 | if ($conditions) { |
1232 | - $sql .= $condExprConjunction . implode(' AND ', $conditions); |
|
1232 | + $sql .= $condExprConjunction.implode(' AND ', $conditions); |
|
1233 | 1233 | } |
1234 | 1234 | |
1235 | 1235 | break; |
@@ -1259,7 +1259,7 @@ discard block |
||
1259 | 1259 | $scalarExpressions[] = $this->walkSimpleArithmeticExpression($scalarExpression); |
1260 | 1260 | } |
1261 | 1261 | |
1262 | - return $sql . implode(', ', $scalarExpressions) . ')'; |
|
1262 | + return $sql.implode(', ', $scalarExpressions).')'; |
|
1263 | 1263 | } |
1264 | 1264 | |
1265 | 1265 | /** |
@@ -1279,7 +1279,7 @@ discard block |
||
1279 | 1279 | ? $this->conn->quote($nullIfExpression->secondExpression) |
1280 | 1280 | : $this->walkSimpleArithmeticExpression($nullIfExpression->secondExpression); |
1281 | 1281 | |
1282 | - return 'NULLIF(' . $firstExpression . ', ' . $secondExpression . ')'; |
|
1282 | + return 'NULLIF('.$firstExpression.', '.$secondExpression.')'; |
|
1283 | 1283 | } |
1284 | 1284 | |
1285 | 1285 | /** |
@@ -1292,11 +1292,11 @@ discard block |
||
1292 | 1292 | $sql = 'CASE'; |
1293 | 1293 | |
1294 | 1294 | foreach ($generalCaseExpression->whenClauses as $whenClause) { |
1295 | - $sql .= ' WHEN ' . $this->walkConditionalExpression($whenClause->caseConditionExpression); |
|
1296 | - $sql .= ' THEN ' . $this->walkSimpleArithmeticExpression($whenClause->thenScalarExpression); |
|
1295 | + $sql .= ' WHEN '.$this->walkConditionalExpression($whenClause->caseConditionExpression); |
|
1296 | + $sql .= ' THEN '.$this->walkSimpleArithmeticExpression($whenClause->thenScalarExpression); |
|
1297 | 1297 | } |
1298 | 1298 | |
1299 | - $sql .= ' ELSE ' . $this->walkSimpleArithmeticExpression($generalCaseExpression->elseScalarExpression) . ' END'; |
|
1299 | + $sql .= ' ELSE '.$this->walkSimpleArithmeticExpression($generalCaseExpression->elseScalarExpression).' END'; |
|
1300 | 1300 | |
1301 | 1301 | return $sql; |
1302 | 1302 | } |
@@ -1310,14 +1310,14 @@ discard block |
||
1310 | 1310 | */ |
1311 | 1311 | public function walkSimpleCaseExpression($simpleCaseExpression) |
1312 | 1312 | { |
1313 | - $sql = 'CASE ' . $this->walkStateFieldPathExpression($simpleCaseExpression->caseOperand); |
|
1313 | + $sql = 'CASE '.$this->walkStateFieldPathExpression($simpleCaseExpression->caseOperand); |
|
1314 | 1314 | |
1315 | 1315 | foreach ($simpleCaseExpression->simpleWhenClauses as $simpleWhenClause) { |
1316 | - $sql .= ' WHEN ' . $this->walkSimpleArithmeticExpression($simpleWhenClause->caseScalarExpression); |
|
1317 | - $sql .= ' THEN ' . $this->walkSimpleArithmeticExpression($simpleWhenClause->thenScalarExpression); |
|
1316 | + $sql .= ' WHEN '.$this->walkSimpleArithmeticExpression($simpleWhenClause->caseScalarExpression); |
|
1317 | + $sql .= ' THEN '.$this->walkSimpleArithmeticExpression($simpleWhenClause->thenScalarExpression); |
|
1318 | 1318 | } |
1319 | 1319 | |
1320 | - $sql .= ' ELSE ' . $this->walkSimpleArithmeticExpression($simpleCaseExpression->elseScalarExpression) . ' END'; |
|
1320 | + $sql .= ' ELSE '.$this->walkSimpleArithmeticExpression($simpleCaseExpression->elseScalarExpression).' END'; |
|
1321 | 1321 | |
1322 | 1322 | return $sql; |
1323 | 1323 | } |
@@ -1358,7 +1358,7 @@ discard block |
||
1358 | 1358 | |
1359 | 1359 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
1360 | 1360 | |
1361 | - if (! $hidden) { |
|
1361 | + if ( ! $hidden) { |
|
1362 | 1362 | $this->rsm->addScalarResult($columnAlias, $resultAlias, $property->getType()); |
1363 | 1363 | $this->scalarFields[$dqlAlias][$fieldName] = $columnAlias; |
1364 | 1364 | } |
@@ -1379,11 +1379,11 @@ discard block |
||
1379 | 1379 | $columnAlias = $this->getSQLColumnAlias(); |
1380 | 1380 | $resultAlias = $selectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
1381 | 1381 | |
1382 | - $sql .= $expr->dispatch($this) . ' AS ' . $columnAlias; |
|
1382 | + $sql .= $expr->dispatch($this).' AS '.$columnAlias; |
|
1383 | 1383 | |
1384 | 1384 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
1385 | 1385 | |
1386 | - if (! $hidden) { |
|
1386 | + if ( ! $hidden) { |
|
1387 | 1387 | // Conceptually we could resolve field type here by traverse through AST to retrieve field type, |
1388 | 1388 | // but this is not a feasible solution; assume 'string'. |
1389 | 1389 | $this->rsm->addScalarResult($columnAlias, $resultAlias, Type::getType('string')); |
@@ -1394,11 +1394,11 @@ discard block |
||
1394 | 1394 | $columnAlias = $this->getSQLColumnAlias(); |
1395 | 1395 | $resultAlias = $selectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
1396 | 1396 | |
1397 | - $sql .= '(' . $this->walkSubselect($expr) . ') AS ' . $columnAlias; |
|
1397 | + $sql .= '('.$this->walkSubselect($expr).') AS '.$columnAlias; |
|
1398 | 1398 | |
1399 | 1399 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
1400 | 1400 | |
1401 | - if (! $hidden) { |
|
1401 | + if ( ! $hidden) { |
|
1402 | 1402 | // We cannot resolve field type here; assume 'string'. |
1403 | 1403 | $this->rsm->addScalarResult($columnAlias, $resultAlias, Type::getType('string')); |
1404 | 1404 | } |
@@ -1422,7 +1422,7 @@ discard block |
||
1422 | 1422 | $class = $queryComp['metadata']; |
1423 | 1423 | $resultAlias = $selectExpression->fieldIdentificationVariable ?: null; |
1424 | 1424 | |
1425 | - if (! isset($this->selectedClasses[$dqlAlias])) { |
|
1425 | + if ( ! isset($this->selectedClasses[$dqlAlias])) { |
|
1426 | 1426 | $this->selectedClasses[$dqlAlias] = [ |
1427 | 1427 | 'class' => $class, |
1428 | 1428 | 'dqlAlias' => $dqlAlias, |
@@ -1434,7 +1434,7 @@ discard block |
||
1434 | 1434 | |
1435 | 1435 | // Select all fields from the queried class |
1436 | 1436 | foreach ($class->getPropertiesIterator() as $fieldName => $property) { |
1437 | - if (! ($property instanceof FieldMetadata)) { |
|
1437 | + if ( ! ($property instanceof FieldMetadata)) { |
|
1438 | 1438 | continue; |
1439 | 1439 | } |
1440 | 1440 | |
@@ -1469,7 +1469,7 @@ discard block |
||
1469 | 1469 | $subClass = $this->em->getClassMetadata($subClassName); |
1470 | 1470 | |
1471 | 1471 | foreach ($subClass->getPropertiesIterator() as $fieldName => $property) { |
1472 | - if (! ($property instanceof FieldMetadata)) { |
|
1472 | + if ( ! ($property instanceof FieldMetadata)) { |
|
1473 | 1473 | continue; |
1474 | 1474 | } |
1475 | 1475 | |
@@ -1508,7 +1508,7 @@ discard block |
||
1508 | 1508 | */ |
1509 | 1509 | public function walkQuantifiedExpression($qExpr) |
1510 | 1510 | { |
1511 | - return ' ' . strtoupper($qExpr->type) . '(' . $this->walkSubselect($qExpr->subselect) . ')'; |
|
1511 | + return ' '.strtoupper($qExpr->type).'('.$this->walkSubselect($qExpr->subselect).')'; |
|
1512 | 1512 | } |
1513 | 1513 | |
1514 | 1514 | /** |
@@ -1548,7 +1548,7 @@ discard block |
||
1548 | 1548 | $sqlParts[] = $this->walkIdentificationVariableDeclaration($subselectIdVarDecl); |
1549 | 1549 | } |
1550 | 1550 | |
1551 | - return ' FROM ' . implode(', ', $sqlParts); |
|
1551 | + return ' FROM '.implode(', ', $sqlParts); |
|
1552 | 1552 | } |
1553 | 1553 | |
1554 | 1554 | /** |
@@ -1556,7 +1556,7 @@ discard block |
||
1556 | 1556 | */ |
1557 | 1557 | public function walkSimpleSelectClause($simpleSelectClause) |
1558 | 1558 | { |
1559 | - return 'SELECT' . ($simpleSelectClause->isDistinct ? ' DISTINCT' : '') |
|
1559 | + return 'SELECT'.($simpleSelectClause->isDistinct ? ' DISTINCT' : '') |
|
1560 | 1560 | . $this->walkSimpleSelectExpression($simpleSelectClause->simpleSelectExpression); |
1561 | 1561 | } |
1562 | 1562 | |
@@ -1590,7 +1590,7 @@ discard block |
||
1590 | 1590 | break; |
1591 | 1591 | |
1592 | 1592 | case $e instanceof AST\Subselect: |
1593 | - $sqlSelectExpressions[] = '(' . $e->dispatch($this) . ') AS ' . $columnAlias; |
|
1593 | + $sqlSelectExpressions[] = '('.$e->dispatch($this).') AS '.$columnAlias; |
|
1594 | 1594 | break; |
1595 | 1595 | |
1596 | 1596 | case $e instanceof AST\PathExpression: |
@@ -1599,7 +1599,7 @@ discard block |
||
1599 | 1599 | $class = $qComp['metadata']; |
1600 | 1600 | $fieldType = $class->getProperty($e->field)->getType(); |
1601 | 1601 | |
1602 | - $sqlSelectExpressions[] = trim((string) $e->dispatch($this)) . ' AS ' . $columnAlias; |
|
1602 | + $sqlSelectExpressions[] = trim((string) $e->dispatch($this)).' AS '.$columnAlias; |
|
1603 | 1603 | break; |
1604 | 1604 | |
1605 | 1605 | case $e instanceof AST\Literal: |
@@ -1613,11 +1613,11 @@ discard block |
||
1613 | 1613 | break; |
1614 | 1614 | } |
1615 | 1615 | |
1616 | - $sqlSelectExpressions[] = trim((string) $e->dispatch($this)) . ' AS ' . $columnAlias; |
|
1616 | + $sqlSelectExpressions[] = trim((string) $e->dispatch($this)).' AS '.$columnAlias; |
|
1617 | 1617 | break; |
1618 | 1618 | |
1619 | 1619 | default: |
1620 | - $sqlSelectExpressions[] = trim((string) $e->dispatch($this)) . ' AS ' . $columnAlias; |
|
1620 | + $sqlSelectExpressions[] = trim((string) $e->dispatch($this)).' AS '.$columnAlias; |
|
1621 | 1621 | break; |
1622 | 1622 | } |
1623 | 1623 | |
@@ -1650,10 +1650,10 @@ discard block |
||
1650 | 1650 | case $expr instanceof AST\Subselect: |
1651 | 1651 | $alias = $simpleSelectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
1652 | 1652 | |
1653 | - $columnAlias = 'sclr' . $this->aliasCounter++; |
|
1653 | + $columnAlias = 'sclr'.$this->aliasCounter++; |
|
1654 | 1654 | $this->scalarResultAliasMap[$alias] = $columnAlias; |
1655 | 1655 | |
1656 | - $sql .= '(' . $this->walkSubselect($expr) . ') AS ' . $columnAlias; |
|
1656 | + $sql .= '('.$this->walkSubselect($expr).') AS '.$columnAlias; |
|
1657 | 1657 | break; |
1658 | 1658 | |
1659 | 1659 | case $expr instanceof AST\Functions\FunctionNode: |
@@ -1670,7 +1670,7 @@ discard block |
||
1670 | 1670 | $columnAlias = $this->getSQLColumnAlias(); |
1671 | 1671 | $this->scalarResultAliasMap[$alias] = $columnAlias; |
1672 | 1672 | |
1673 | - $sql .= $expr->dispatch($this) . ' AS ' . $columnAlias; |
|
1673 | + $sql .= $expr->dispatch($this).' AS '.$columnAlias; |
|
1674 | 1674 | break; |
1675 | 1675 | |
1676 | 1676 | case $expr instanceof AST\ParenthesisExpression: |
@@ -1690,8 +1690,8 @@ discard block |
||
1690 | 1690 | */ |
1691 | 1691 | public function walkAggregateExpression($aggExpression) |
1692 | 1692 | { |
1693 | - return $aggExpression->functionName . '(' . ($aggExpression->isDistinct ? 'DISTINCT ' : '') |
|
1694 | - . $this->walkSimpleArithmeticExpression($aggExpression->pathExpression) . ')'; |
|
1693 | + return $aggExpression->functionName.'('.($aggExpression->isDistinct ? 'DISTINCT ' : '') |
|
1694 | + . $this->walkSimpleArithmeticExpression($aggExpression->pathExpression).')'; |
|
1695 | 1695 | } |
1696 | 1696 | |
1697 | 1697 | /** |
@@ -1705,7 +1705,7 @@ discard block |
||
1705 | 1705 | $sqlParts[] = $this->walkGroupByItem($groupByItem); |
1706 | 1706 | } |
1707 | 1707 | |
1708 | - return ' GROUP BY ' . implode(', ', $sqlParts); |
|
1708 | + return ' GROUP BY '.implode(', ', $sqlParts); |
|
1709 | 1709 | } |
1710 | 1710 | |
1711 | 1711 | /** |
@@ -1714,7 +1714,7 @@ discard block |
||
1714 | 1714 | public function walkGroupByItem($groupByItem) |
1715 | 1715 | { |
1716 | 1716 | // StateFieldPathExpression |
1717 | - if (! is_string($groupByItem)) { |
|
1717 | + if ( ! is_string($groupByItem)) { |
|
1718 | 1718 | return $this->walkPathExpression($groupByItem); |
1719 | 1719 | } |
1720 | 1720 | |
@@ -1768,7 +1768,7 @@ discard block |
||
1768 | 1768 | { |
1769 | 1769 | $class = $this->em->getClassMetadata($deleteClause->abstractSchemaName); |
1770 | 1770 | $tableName = $class->getTableName(); |
1771 | - $sql = 'DELETE FROM ' . $class->table->getQuotedQualifiedName($this->platform); |
|
1771 | + $sql = 'DELETE FROM '.$class->table->getQuotedQualifiedName($this->platform); |
|
1772 | 1772 | |
1773 | 1773 | $this->setSQLTableAlias($tableName, $tableName, $deleteClause->aliasIdentificationVariable); |
1774 | 1774 | |
@@ -1784,12 +1784,12 @@ discard block |
||
1784 | 1784 | { |
1785 | 1785 | $class = $this->em->getClassMetadata($updateClause->abstractSchemaName); |
1786 | 1786 | $tableName = $class->getTableName(); |
1787 | - $sql = 'UPDATE ' . $class->table->getQuotedQualifiedName($this->platform); |
|
1787 | + $sql = 'UPDATE '.$class->table->getQuotedQualifiedName($this->platform); |
|
1788 | 1788 | |
1789 | 1789 | $this->setSQLTableAlias($tableName, $tableName, $updateClause->aliasIdentificationVariable); |
1790 | 1790 | $this->rootAliases[] = $updateClause->aliasIdentificationVariable; |
1791 | 1791 | |
1792 | - return $sql . ' SET ' . implode(', ', array_map([$this, 'walkUpdateItem'], $updateClause->updateItems)); |
|
1792 | + return $sql.' SET '.implode(', ', array_map([$this, 'walkUpdateItem'], $updateClause->updateItems)); |
|
1793 | 1793 | } |
1794 | 1794 | |
1795 | 1795 | /** |
@@ -1800,7 +1800,7 @@ discard block |
||
1800 | 1800 | $useTableAliasesBefore = $this->useSqlTableAliases; |
1801 | 1801 | $this->useSqlTableAliases = false; |
1802 | 1802 | |
1803 | - $sql = $this->walkPathExpression($updateItem->pathExpression) . ' = '; |
|
1803 | + $sql = $this->walkPathExpression($updateItem->pathExpression).' = '; |
|
1804 | 1804 | $newValue = $updateItem->newValue; |
1805 | 1805 | |
1806 | 1806 | switch (true) { |
@@ -1844,7 +1844,7 @@ discard block |
||
1844 | 1844 | |
1845 | 1845 | if ($filterClauses) { |
1846 | 1846 | if ($condSql) { |
1847 | - $condSql = '(' . $condSql . ') AND '; |
|
1847 | + $condSql = '('.$condSql.') AND '; |
|
1848 | 1848 | } |
1849 | 1849 | |
1850 | 1850 | $condSql .= implode(' AND ', $filterClauses); |
@@ -1852,11 +1852,11 @@ discard block |
||
1852 | 1852 | } |
1853 | 1853 | |
1854 | 1854 | if ($condSql) { |
1855 | - return ' WHERE ' . (! $discrSql ? $condSql : '(' . $condSql . ') AND ' . $discrSql); |
|
1855 | + return ' WHERE '.( ! $discrSql ? $condSql : '('.$condSql.') AND '.$discrSql); |
|
1856 | 1856 | } |
1857 | 1857 | |
1858 | 1858 | if ($discrSql) { |
1859 | - return ' WHERE ' . $discrSql; |
|
1859 | + return ' WHERE '.$discrSql; |
|
1860 | 1860 | } |
1861 | 1861 | |
1862 | 1862 | return ''; |
@@ -1869,7 +1869,7 @@ discard block |
||
1869 | 1869 | { |
1870 | 1870 | // Phase 2 AST optimization: Skip processing of ConditionalExpression |
1871 | 1871 | // if only one ConditionalTerm is defined |
1872 | - if (! ($condExpr instanceof AST\ConditionalExpression)) { |
|
1872 | + if ( ! ($condExpr instanceof AST\ConditionalExpression)) { |
|
1873 | 1873 | return $this->walkConditionalTerm($condExpr); |
1874 | 1874 | } |
1875 | 1875 | |
@@ -1883,7 +1883,7 @@ discard block |
||
1883 | 1883 | { |
1884 | 1884 | // Phase 2 AST optimization: Skip processing of ConditionalTerm |
1885 | 1885 | // if only one ConditionalFactor is defined |
1886 | - if (! ($condTerm instanceof AST\ConditionalTerm)) { |
|
1886 | + if ( ! ($condTerm instanceof AST\ConditionalTerm)) { |
|
1887 | 1887 | return $this->walkConditionalFactor($condTerm); |
1888 | 1888 | } |
1889 | 1889 | |
@@ -1899,7 +1899,7 @@ discard block |
||
1899 | 1899 | // if only one ConditionalPrimary is defined |
1900 | 1900 | return ! ($factor instanceof AST\ConditionalFactor) |
1901 | 1901 | ? $this->walkConditionalPrimary($factor) |
1902 | - : ($factor->not ? 'NOT ' : '') . $this->walkConditionalPrimary($factor->conditionalPrimary); |
|
1902 | + : ($factor->not ? 'NOT ' : '').$this->walkConditionalPrimary($factor->conditionalPrimary); |
|
1903 | 1903 | } |
1904 | 1904 | |
1905 | 1905 | /** |
@@ -1914,7 +1914,7 @@ discard block |
||
1914 | 1914 | if ($primary->isConditionalExpression()) { |
1915 | 1915 | $condExpr = $primary->conditionalExpression; |
1916 | 1916 | |
1917 | - return '(' . $this->walkConditionalExpression($condExpr) . ')'; |
|
1917 | + return '('.$this->walkConditionalExpression($condExpr).')'; |
|
1918 | 1918 | } |
1919 | 1919 | |
1920 | 1920 | return ''; |
@@ -1927,7 +1927,7 @@ discard block |
||
1927 | 1927 | { |
1928 | 1928 | $sql = $existsExpr->not ? 'NOT ' : ''; |
1929 | 1929 | |
1930 | - $sql .= 'EXISTS (' . $this->walkSubselect($existsExpr->subselect) . ')'; |
|
1930 | + $sql .= 'EXISTS ('.$this->walkSubselect($existsExpr->subselect).')'; |
|
1931 | 1931 | |
1932 | 1932 | return $sql; |
1933 | 1933 | } |
@@ -1975,7 +1975,7 @@ discard block |
||
1975 | 1975 | $targetTableAlias = $this->getSQLTableAlias($targetClass->getTableName()); |
1976 | 1976 | $sourceTableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
1977 | 1977 | |
1978 | - $sql .= $targetTableName . ' ' . $targetTableAlias . ' WHERE '; |
|
1978 | + $sql .= $targetTableName.' '.$targetTableAlias.' WHERE '; |
|
1979 | 1979 | |
1980 | 1980 | $sqlParts = []; |
1981 | 1981 | |
@@ -1996,7 +1996,7 @@ discard block |
||
1996 | 1996 | $this->parserResult->addParameterMapping($dqlParamKey, $this->sqlParamIndex++); |
1997 | 1997 | } |
1998 | 1998 | |
1999 | - $sqlParts[] = $targetTableAlias . '.' . $quotedTargetColumnName . ' = ' . $entitySql; |
|
1999 | + $sqlParts[] = $targetTableAlias.'.'.$quotedTargetColumnName.' = '.$entitySql; |
|
2000 | 2000 | } |
2001 | 2001 | |
2002 | 2002 | $sql .= implode(' AND ', $sqlParts); |
@@ -2010,7 +2010,7 @@ discard block |
||
2010 | 2010 | $sourceTableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
2011 | 2011 | |
2012 | 2012 | // join to target table |
2013 | - $sql .= $joinTableName . ' ' . $joinTableAlias . ' INNER JOIN ' . $targetTableName . ' ' . $targetTableAlias . ' ON '; |
|
2013 | + $sql .= $joinTableName.' '.$joinTableAlias.' INNER JOIN '.$targetTableName.' '.$targetTableAlias.' ON '; |
|
2014 | 2014 | |
2015 | 2015 | // join conditions |
2016 | 2016 | $joinSqlParts = []; |
@@ -2059,13 +2059,13 @@ discard block |
||
2059 | 2059 | $this->parserResult->addParameterMapping($dqlParamKey, $this->sqlParamIndex++); |
2060 | 2060 | } |
2061 | 2061 | |
2062 | - $sqlParts[] = $targetTableAlias . '.' . $quotedTargetColumnName . ' = ' . $entitySql; |
|
2062 | + $sqlParts[] = $targetTableAlias.'.'.$quotedTargetColumnName.' = '.$entitySql; |
|
2063 | 2063 | } |
2064 | 2064 | |
2065 | 2065 | $sql .= implode(' AND ', $sqlParts); |
2066 | 2066 | } |
2067 | 2067 | |
2068 | - return $sql . ')'; |
|
2068 | + return $sql.')'; |
|
2069 | 2069 | } |
2070 | 2070 | |
2071 | 2071 | /** |
@@ -2076,7 +2076,7 @@ discard block |
||
2076 | 2076 | $sizeFunc = new AST\Functions\SizeFunction('size'); |
2077 | 2077 | $sizeFunc->collectionPathExpression = $emptyCollCompExpr->expression; |
2078 | 2078 | |
2079 | - return $sizeFunc->getSql($this) . ($emptyCollCompExpr->not ? ' > 0' : ' = 0'); |
|
2079 | + return $sizeFunc->getSql($this).($emptyCollCompExpr->not ? ' > 0' : ' = 0'); |
|
2080 | 2080 | } |
2081 | 2081 | |
2082 | 2082 | /** |
@@ -2085,19 +2085,19 @@ discard block |
||
2085 | 2085 | public function walkNullComparisonExpression($nullCompExpr) |
2086 | 2086 | { |
2087 | 2087 | $expression = $nullCompExpr->expression; |
2088 | - $comparison = ' IS' . ($nullCompExpr->not ? ' NOT' : '') . ' NULL'; |
|
2088 | + $comparison = ' IS'.($nullCompExpr->not ? ' NOT' : '').' NULL'; |
|
2089 | 2089 | |
2090 | 2090 | // Handle ResultVariable |
2091 | 2091 | if (is_string($expression) && isset($this->queryComponents[$expression]['resultVariable'])) { |
2092 | - return $this->walkResultVariable($expression) . $comparison; |
|
2092 | + return $this->walkResultVariable($expression).$comparison; |
|
2093 | 2093 | } |
2094 | 2094 | |
2095 | 2095 | // Handle InputParameter mapping inclusion to ParserResult |
2096 | 2096 | if ($expression instanceof AST\InputParameter) { |
2097 | - return $this->walkInputParameter($expression) . $comparison; |
|
2097 | + return $this->walkInputParameter($expression).$comparison; |
|
2098 | 2098 | } |
2099 | 2099 | |
2100 | - return $expression->dispatch($this) . $comparison; |
|
2100 | + return $expression->dispatch($this).$comparison; |
|
2101 | 2101 | } |
2102 | 2102 | |
2103 | 2103 | /** |
@@ -2105,7 +2105,7 @@ discard block |
||
2105 | 2105 | */ |
2106 | 2106 | public function walkInExpression($inExpr) |
2107 | 2107 | { |
2108 | - $sql = $this->walkArithmeticExpression($inExpr->expression) . ($inExpr->not ? ' NOT' : '') . ' IN ('; |
|
2108 | + $sql = $this->walkArithmeticExpression($inExpr->expression).($inExpr->not ? ' NOT' : '').' IN ('; |
|
2109 | 2109 | |
2110 | 2110 | $sql .= $inExpr->subselect |
2111 | 2111 | ? $this->walkSubselect($inExpr->subselect) |
@@ -2130,12 +2130,12 @@ discard block |
||
2130 | 2130 | $discrColumnType = $discrColumn->getType(); |
2131 | 2131 | $quotedColumnName = $this->platform->quoteIdentifier($discrColumn->getColumnName()); |
2132 | 2132 | $sqlTableAlias = $this->useSqlTableAliases |
2133 | - ? $this->getSQLTableAlias($discrColumn->getTableName(), $dqlAlias) . '.' |
|
2133 | + ? $this->getSQLTableAlias($discrColumn->getTableName(), $dqlAlias).'.' |
|
2134 | 2134 | : ''; |
2135 | 2135 | |
2136 | 2136 | return sprintf( |
2137 | 2137 | '%s %sIN %s', |
2138 | - $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias . $quotedColumnName, $this->platform), |
|
2138 | + $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias.$quotedColumnName, $this->platform), |
|
2139 | 2139 | ($instanceOfExpr->not ? 'NOT ' : ''), |
2140 | 2140 | $this->getChildDiscriminatorsFromClassMetadata($discrClass, $instanceOfExpr) |
2141 | 2141 | ); |
@@ -2179,8 +2179,8 @@ discard block |
||
2179 | 2179 | $sql .= ' NOT'; |
2180 | 2180 | } |
2181 | 2181 | |
2182 | - $sql .= ' BETWEEN ' . $this->walkArithmeticExpression($betweenExpr->leftBetweenExpression) |
|
2183 | - . ' AND ' . $this->walkArithmeticExpression($betweenExpr->rightBetweenExpression); |
|
2182 | + $sql .= ' BETWEEN '.$this->walkArithmeticExpression($betweenExpr->leftBetweenExpression) |
|
2183 | + . ' AND '.$this->walkArithmeticExpression($betweenExpr->rightBetweenExpression); |
|
2184 | 2184 | |
2185 | 2185 | return $sql; |
2186 | 2186 | } |
@@ -2195,7 +2195,7 @@ discard block |
||
2195 | 2195 | ? $this->walkResultVariable($stringExpr) |
2196 | 2196 | : $stringExpr->dispatch($this); |
2197 | 2197 | |
2198 | - $sql = $leftExpr . ($likeExpr->not ? ' NOT' : '') . ' LIKE '; |
|
2198 | + $sql = $leftExpr.($likeExpr->not ? ' NOT' : '').' LIKE '; |
|
2199 | 2199 | |
2200 | 2200 | if ($likeExpr->stringPattern instanceof AST\InputParameter) { |
2201 | 2201 | $sql .= $this->walkInputParameter($likeExpr->stringPattern); |
@@ -2208,7 +2208,7 @@ discard block |
||
2208 | 2208 | } |
2209 | 2209 | |
2210 | 2210 | if ($likeExpr->escapeChar) { |
2211 | - $sql .= ' ESCAPE ' . $this->walkLiteral($likeExpr->escapeChar); |
|
2211 | + $sql .= ' ESCAPE '.$this->walkLiteral($likeExpr->escapeChar); |
|
2212 | 2212 | } |
2213 | 2213 | |
2214 | 2214 | return $sql; |
@@ -2235,7 +2235,7 @@ discard block |
||
2235 | 2235 | ? $leftExpr->dispatch($this) |
2236 | 2236 | : (is_numeric($leftExpr) ? $leftExpr : $this->conn->quote($leftExpr)); |
2237 | 2237 | |
2238 | - $sql .= ' ' . $compExpr->operator . ' '; |
|
2238 | + $sql .= ' '.$compExpr->operator.' '; |
|
2239 | 2239 | |
2240 | 2240 | $sql .= $rightExpr instanceof AST\Node |
2241 | 2241 | ? $rightExpr->dispatch($this) |
@@ -2271,7 +2271,7 @@ discard block |
||
2271 | 2271 | { |
2272 | 2272 | return $arithmeticExpr->isSimpleArithmeticExpression() |
2273 | 2273 | ? $this->walkSimpleArithmeticExpression($arithmeticExpr->simpleArithmeticExpression) |
2274 | - : '(' . $this->walkSubselect($arithmeticExpr->subselect) . ')'; |
|
2274 | + : '('.$this->walkSubselect($arithmeticExpr->subselect).')'; |
|
2275 | 2275 | } |
2276 | 2276 | |
2277 | 2277 | /** |
@@ -2279,7 +2279,7 @@ discard block |
||
2279 | 2279 | */ |
2280 | 2280 | public function walkSimpleArithmeticExpression($simpleArithmeticExpr) |
2281 | 2281 | { |
2282 | - if (! ($simpleArithmeticExpr instanceof AST\SimpleArithmeticExpression)) { |
|
2282 | + if ( ! ($simpleArithmeticExpr instanceof AST\SimpleArithmeticExpression)) { |
|
2283 | 2283 | return $this->walkArithmeticTerm($simpleArithmeticExpr); |
2284 | 2284 | } |
2285 | 2285 | |
@@ -2299,7 +2299,7 @@ discard block |
||
2299 | 2299 | |
2300 | 2300 | // Phase 2 AST optimization: Skip processing of ArithmeticTerm |
2301 | 2301 | // if only one ArithmeticFactor is defined |
2302 | - if (! ($term instanceof AST\ArithmeticTerm)) { |
|
2302 | + if ( ! ($term instanceof AST\ArithmeticTerm)) { |
|
2303 | 2303 | return $this->walkArithmeticFactor($term); |
2304 | 2304 | } |
2305 | 2305 | |
@@ -2319,13 +2319,13 @@ discard block |
||
2319 | 2319 | |
2320 | 2320 | // Phase 2 AST optimization: Skip processing of ArithmeticFactor |
2321 | 2321 | // if only one ArithmeticPrimary is defined |
2322 | - if (! ($factor instanceof AST\ArithmeticFactor)) { |
|
2322 | + if ( ! ($factor instanceof AST\ArithmeticFactor)) { |
|
2323 | 2323 | return $this->walkArithmeticPrimary($factor); |
2324 | 2324 | } |
2325 | 2325 | |
2326 | 2326 | $sign = $factor->isNegativeSigned() ? '-' : ($factor->isPositiveSigned() ? '+' : ''); |
2327 | 2327 | |
2328 | - return $sign . $this->walkArithmeticPrimary($factor->arithmeticPrimary); |
|
2328 | + return $sign.$this->walkArithmeticPrimary($factor->arithmeticPrimary); |
|
2329 | 2329 | } |
2330 | 2330 | |
2331 | 2331 | /** |
@@ -2338,7 +2338,7 @@ discard block |
||
2338 | 2338 | public function walkArithmeticPrimary($primary) |
2339 | 2339 | { |
2340 | 2340 | if ($primary instanceof AST\SimpleArithmeticExpression) { |
2341 | - return '(' . $this->walkSimpleArithmeticExpression($primary) . ')'; |
|
2341 | + return '('.$this->walkSimpleArithmeticExpression($primary).')'; |
|
2342 | 2342 | } |
2343 | 2343 | |
2344 | 2344 | if ($primary instanceof AST\Node) { |
@@ -2396,7 +2396,7 @@ discard block |
||
2396 | 2396 | $entityClassName = $entityClass->getClassName(); |
2397 | 2397 | |
2398 | 2398 | if ($entityClassName !== $rootClass->getClassName()) { |
2399 | - if (! $entityClass->getReflectionClass()->isSubclassOf($rootClass->getClassName())) { |
|
2399 | + if ( ! $entityClass->getReflectionClass()->isSubclassOf($rootClass->getClassName())) { |
|
2400 | 2400 | throw QueryException::instanceOfUnrelatedClass($entityClassName, $rootClass->getClassName()); |
2401 | 2401 | } |
2402 | 2402 | } |
@@ -2408,6 +2408,6 @@ discard block |
||
2408 | 2408 | $sqlParameterList[] = $this->conn->quote($discriminator); |
2409 | 2409 | } |
2410 | 2410 | |
2411 | - return '(' . implode(', ', $sqlParameterList) . ')'; |
|
2411 | + return '('.implode(', ', $sqlParameterList).')'; |
|
2412 | 2412 | } |
2413 | 2413 | } |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | $lines[] = null; |
30 | 30 | |
31 | 31 | if ($namespace) { |
32 | - $lines[] = 'namespace ' . $namespace . ';'; |
|
32 | + $lines[] = 'namespace '.$namespace.';'; |
|
33 | 33 | $lines[] = null; |
34 | 34 | } |
35 | 35 | |
@@ -64,31 +64,31 @@ discard block |
||
64 | 64 | { |
65 | 65 | $indentation = str_repeat(self::INDENTATION, $indentationLevel); |
66 | 66 | $bodyIndentation = str_repeat(self::INDENTATION, $indentationLevel + 1); |
67 | - $objectReference = $bodyIndentation . self::VARIABLE; |
|
67 | + $objectReference = $bodyIndentation.self::VARIABLE; |
|
68 | 68 | $lines = []; |
69 | 69 | |
70 | - $lines[] = $indentation . 'public function __construct('; |
|
71 | - $lines[] = $bodyIndentation . 'ClassMetadataBuildingContext $metadataBuildingContext,'; |
|
72 | - $lines[] = $bodyIndentation . '?ClassMetadata $parent = null'; |
|
73 | - $lines[] = $indentation . ')'; |
|
74 | - $lines[] = $indentation . '{'; |
|
75 | - $lines[] = $bodyIndentation . 'parent::__construct("' . $metadata->getClassName() . '", $parent, $metadataBuildingContext);'; |
|
70 | + $lines[] = $indentation.'public function __construct('; |
|
71 | + $lines[] = $bodyIndentation.'ClassMetadataBuildingContext $metadataBuildingContext,'; |
|
72 | + $lines[] = $bodyIndentation.'?ClassMetadata $parent = null'; |
|
73 | + $lines[] = $indentation.')'; |
|
74 | + $lines[] = $indentation.'{'; |
|
75 | + $lines[] = $bodyIndentation.'parent::__construct("'.$metadata->getClassName().'", $parent, $metadataBuildingContext);'; |
|
76 | 76 | |
77 | 77 | if ($metadata->getCustomRepositoryClassName()) { |
78 | 78 | $lines[] = null; |
79 | - $lines[] = $objectReference . '->setCustomRepositoryClassName("' . $metadata->getCustomRepositoryClassName() . '");'; |
|
79 | + $lines[] = $objectReference.'->setCustomRepositoryClassName("'.$metadata->getCustomRepositoryClassName().'");'; |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | if ($metadata->changeTrackingPolicy) { |
83 | 83 | $lines[] = null; |
84 | - $lines[] = $objectReference . '->setChangeTrackingPolicy(Mapping\ChangeTrackingPolicy::' . strtoupper($metadata->changeTrackingPolicy) . ');'; |
|
84 | + $lines[] = $objectReference.'->setChangeTrackingPolicy(Mapping\ChangeTrackingPolicy::'.strtoupper($metadata->changeTrackingPolicy).');'; |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | $lines[] = $this->exportInheritance($metadata, $indentationLevel); |
88 | 88 | $lines[] = $this->exportTable($metadata, $indentationLevel); |
89 | 89 | $lines[] = $this->exportProperties($metadata, $indentationLevel); |
90 | 90 | $lines[] = $this->exportLifecycleCallbacks($metadata, $indentationLevel); |
91 | - $lines[] = $indentation . '}'; |
|
91 | + $lines[] = $indentation.'}'; |
|
92 | 92 | |
93 | 93 | return implode(PHP_EOL, $lines); |
94 | 94 | } |
@@ -96,17 +96,17 @@ discard block |
||
96 | 96 | private function exportInheritance(Mapping\ClassMetadata $metadata, int $indentationLevel) : string |
97 | 97 | { |
98 | 98 | $bodyIndentation = str_repeat(self::INDENTATION, $indentationLevel + 1); |
99 | - $objectReference = $bodyIndentation . self::VARIABLE; |
|
99 | + $objectReference = $bodyIndentation.self::VARIABLE; |
|
100 | 100 | $lines = []; |
101 | 101 | |
102 | 102 | if ($metadata->inheritanceType) { |
103 | 103 | $lines[] = null; |
104 | - $lines[] = $objectReference . '->setInheritanceType(Mapping\InheritanceType::' . strtoupper($metadata->inheritanceType) . ');'; |
|
104 | + $lines[] = $objectReference.'->setInheritanceType(Mapping\InheritanceType::'.strtoupper($metadata->inheritanceType).');'; |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | if ($metadata->discriminatorColumn) { |
108 | 108 | $lines[] = null; |
109 | - $lines[] = $bodyIndentation . '// Discriminator mapping'; |
|
109 | + $lines[] = $bodyIndentation.'// Discriminator mapping'; |
|
110 | 110 | $lines[] = $this->exportDiscriminatorMetadata($metadata, $indentationLevel + 1); |
111 | 111 | } |
112 | 112 | |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | |
121 | 121 | if ($metadata->table) { |
122 | 122 | $lines[] = null; |
123 | - $lines[] = $bodyIndentation . '// Table'; |
|
123 | + $lines[] = $bodyIndentation.'// Table'; |
|
124 | 124 | $lines[] = $this->exportTableMetadata($metadata->table, $indentationLevel + 1); |
125 | 125 | } |
126 | 126 | |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | |
135 | 135 | foreach ($metadata->getPropertiesIterator() as $name => $property) { |
136 | 136 | $lines[] = null; |
137 | - $lines[] = $bodyIndentation . '// Property: ' . $name; |
|
137 | + $lines[] = $bodyIndentation.'// Property: '.$name; |
|
138 | 138 | $lines[] = $this->exportProperty($property, $indentationLevel + 1); |
139 | 139 | } |
140 | 140 | |
@@ -144,16 +144,16 @@ discard block |
||
144 | 144 | private function exportLifecycleCallbacks(Mapping\ClassMetadata $metadata, int $indentationLevel) : string |
145 | 145 | { |
146 | 146 | $bodyIndentation = str_repeat(self::INDENTATION, $indentationLevel + 1); |
147 | - $objectReference = $bodyIndentation . self::VARIABLE; |
|
147 | + $objectReference = $bodyIndentation.self::VARIABLE; |
|
148 | 148 | $lines = []; |
149 | 149 | |
150 | 150 | if ($metadata->lifecycleCallbacks) { |
151 | 151 | $lines[] = null; |
152 | - $lines[] = $bodyIndentation . '// Lifecycle callbacks'; |
|
152 | + $lines[] = $bodyIndentation.'// Lifecycle callbacks'; |
|
153 | 153 | |
154 | 154 | foreach ($metadata->lifecycleCallbacks as $event => $callbacks) { |
155 | 155 | foreach ($callbacks as $callback) { |
156 | - $lines[] = $objectReference . '->addLifecycleCallback("' . $callback . '", "' . $event . '");'; |
|
156 | + $lines[] = $objectReference.'->addLifecycleCallback("'.$callback.'", "'.$event.'");'; |
|
157 | 157 | } |
158 | 158 | } |
159 | 159 | } |
@@ -166,17 +166,17 @@ discard block |
||
166 | 166 | $variableExporter = new VariableExporter(); |
167 | 167 | $discriminatorExporter = new DiscriminatorColumnMetadataExporter(); |
168 | 168 | $indentation = str_repeat(self::INDENTATION, $indentationLevel); |
169 | - $objectReference = $indentation . self::VARIABLE; |
|
169 | + $objectReference = $indentation.self::VARIABLE; |
|
170 | 170 | $lines = []; |
171 | 171 | |
172 | 172 | $lines[] = $discriminatorExporter->export($metadata->discriminatorColumn, $indentationLevel); |
173 | 173 | $lines[] = null; |
174 | - $lines[] = $objectReference . '->setDiscriminatorColumn(' . $discriminatorExporter::VARIABLE . ');'; |
|
174 | + $lines[] = $objectReference.'->setDiscriminatorColumn('.$discriminatorExporter::VARIABLE.');'; |
|
175 | 175 | |
176 | 176 | if ($metadata->discriminatorMap) { |
177 | 177 | $discriminatorMap = $variableExporter->export($metadata->discriminatorMap, $indentationLevel + 1); |
178 | 178 | |
179 | - $lines[] = $objectReference . '->setDiscriminatorMap(' . $discriminatorMap . ');'; |
|
179 | + $lines[] = $objectReference.'->setDiscriminatorMap('.$discriminatorMap.');'; |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | return implode(PHP_EOL, $lines); |
@@ -186,12 +186,12 @@ discard block |
||
186 | 186 | { |
187 | 187 | $tableExporter = new TableMetadataExporter(); |
188 | 188 | $indentation = str_repeat(self::INDENTATION, $indentationLevel); |
189 | - $objectReference = $indentation . self::VARIABLE; |
|
189 | + $objectReference = $indentation.self::VARIABLE; |
|
190 | 190 | $lines = []; |
191 | 191 | |
192 | 192 | $lines[] = $tableExporter->export($table, $indentationLevel); |
193 | 193 | $lines[] = null; |
194 | - $lines[] = $objectReference . '->setTable(' . $tableExporter::VARIABLE . ');'; |
|
194 | + $lines[] = $objectReference.'->setTable('.$tableExporter::VARIABLE.');'; |
|
195 | 195 | |
196 | 196 | return implode(PHP_EOL, $lines); |
197 | 197 | } |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | private function exportProperty(Mapping\Property $property, int $indentationLevel) : string |
200 | 200 | { |
201 | 201 | $indentation = str_repeat(self::INDENTATION, $indentationLevel); |
202 | - $objectReference = $indentation . self::VARIABLE; |
|
202 | + $objectReference = $indentation.self::VARIABLE; |
|
203 | 203 | $lines = []; |
204 | 204 | |
205 | 205 | switch (true) { |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | |
231 | 231 | $lines[] = $propertyExporter->export($property, $indentationLevel); |
232 | 232 | $lines[] = null; |
233 | - $lines[] = $objectReference . '->addProperty(' . $propertyExporter::VARIABLE . ');'; |
|
233 | + $lines[] = $objectReference.'->addProperty('.$propertyExporter::VARIABLE.');'; |
|
234 | 234 | |
235 | 235 | return implode(PHP_EOL, $lines); |
236 | 236 | } |