@@ -1409,7 +1409,6 @@ |
||
| 1409 | 1409 | * Gets the SQL join fragment used when selecting entities from a |
| 1410 | 1410 | * many-to-many association. |
| 1411 | 1411 | * |
| 1412 | - * @param ManyToManyAssociationMetadata $manyToMany |
|
| 1413 | 1412 | * |
| 1414 | 1413 | * @return string |
| 1415 | 1414 | */ |
@@ -323,8 +323,8 @@ discard block |
||
| 323 | 323 | |
| 324 | 324 | // FIXME: Order with composite keys might not be correct |
| 325 | 325 | $sql = 'SELECT ' . $columnName |
| 326 | - . ' FROM ' . $tableName |
|
| 327 | - . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
| 326 | + . ' FROM ' . $tableName |
|
| 327 | + . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
| 328 | 328 | |
| 329 | 329 | $flattenedId = $this->em->getIdentifierFlattener()->flattenIdentifier($versionedClass, $id); |
| 330 | 330 | $versionType = $versionProperty->getType(); |
@@ -457,8 +457,8 @@ discard block |
||
| 457 | 457 | } |
| 458 | 458 | |
| 459 | 459 | $sql = 'UPDATE ' . $quotedTableName |
| 460 | - . ' SET ' . implode(', ', $set) |
|
| 461 | - . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
| 460 | + . ' SET ' . implode(', ', $set) |
|
| 461 | + . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
| 462 | 462 | |
| 463 | 463 | $result = $this->conn->executeUpdate($sql, $params, $types); |
| 464 | 464 | |
@@ -1626,9 +1626,9 @@ discard block |
||
| 1626 | 1626 | $lock = $this->getLockTablesSql($lockMode); |
| 1627 | 1627 | $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' '; |
| 1628 | 1628 | $sql = 'SELECT 1 ' |
| 1629 | - . $lock |
|
| 1630 | - . $where |
|
| 1631 | - . $lockSql; |
|
| 1629 | + . $lock |
|
| 1630 | + . $where |
|
| 1631 | + . $lockSql; |
|
| 1632 | 1632 | |
| 1633 | 1633 | list($params, $types) = $this->expandParameters($criteria); |
| 1634 | 1634 | |
@@ -2107,8 +2107,8 @@ discard block |
||
| 2107 | 2107 | $alias = $this->getSQLTableAlias($this->class->getTableName()); |
| 2108 | 2108 | |
| 2109 | 2109 | $sql = 'SELECT 1 ' |
| 2110 | - . $this->getLockTablesSql(null) |
|
| 2111 | - . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
| 2110 | + . $this->getLockTablesSql(null) |
|
| 2111 | + . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
| 2112 | 2112 | |
| 2113 | 2113 | list($params, $types) = $this->expandParameters($criteria); |
| 2114 | 2114 | |
@@ -2142,9 +2142,9 @@ discard block |
||
| 2142 | 2142 | |
| 2143 | 2143 | // if one of the join columns is nullable, return left join |
| 2144 | 2144 | foreach ($association->getJoinColumns() as $joinColumn) { |
| 2145 | - if (! $joinColumn->isNullable()) { |
|
| 2146 | - continue; |
|
| 2147 | - } |
|
| 2145 | + if (! $joinColumn->isNullable()) { |
|
| 2146 | + continue; |
|
| 2147 | + } |
|
| 2148 | 2148 | |
| 2149 | 2149 | return 'LEFT JOIN'; |
| 2150 | 2150 | } |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\ORM\Persisters\Entity; |
| 6 | 6 | |
@@ -304,14 +304,14 @@ discard block |
||
| 304 | 304 | $tableName = $versionedClass->table->getQuotedQualifiedName($this->platform); |
| 305 | 305 | $columnName = $this->platform->quoteIdentifier($versionProperty->getColumnName()); |
| 306 | 306 | $identifier = array_map( |
| 307 | - function ($columnName) { return $this->platform->quoteIdentifier($columnName); }, |
|
| 307 | + function($columnName) { return $this->platform->quoteIdentifier($columnName); }, |
|
| 308 | 308 | array_keys($versionedClass->getIdentifierColumns($this->em)) |
| 309 | 309 | ); |
| 310 | 310 | |
| 311 | 311 | // FIXME: Order with composite keys might not be correct |
| 312 | - $sql = 'SELECT ' . $columnName |
|
| 313 | - . ' FROM ' . $tableName |
|
| 314 | - . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
| 312 | + $sql = 'SELECT '.$columnName |
|
| 313 | + . ' FROM '.$tableName |
|
| 314 | + . ' WHERE '.implode(' = ? AND ', $identifier).' = ?'; |
|
| 315 | 315 | |
| 316 | 316 | $flattenedId = $this->em->getIdentifierFlattener()->flattenIdentifier($versionedClass, $id); |
| 317 | 317 | $versionType = $versionProperty->getType(); |
@@ -397,7 +397,7 @@ discard block |
||
| 397 | 397 | |
| 398 | 398 | if (($value = $identifier[$field]) !== null) { |
| 399 | 399 | // @todo guilhermeblanco Make sure we do not have flat association values. |
| 400 | - if (! is_array($value)) { |
|
| 400 | + if ( ! is_array($value)) { |
|
| 401 | 401 | $value = [$targetClass->identifier[0] => $value]; |
| 402 | 402 | } |
| 403 | 403 | |
@@ -410,7 +410,7 @@ discard block |
||
| 410 | 410 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 411 | 411 | $targetField = $targetClass->fieldNames[$referencedColumnName]; |
| 412 | 412 | |
| 413 | - if (! $joinColumn->getType()) { |
|
| 413 | + if ( ! $joinColumn->getType()) { |
|
| 414 | 414 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 415 | 415 | } |
| 416 | 416 | |
@@ -478,7 +478,7 @@ discard block |
||
| 478 | 478 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 479 | 479 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 480 | 480 | |
| 481 | - if (! $joinColumn->getType()) { |
|
| 481 | + if ( ! $joinColumn->getType()) { |
|
| 482 | 482 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 483 | 483 | } |
| 484 | 484 | |
@@ -505,18 +505,18 @@ discard block |
||
| 505 | 505 | case Type::SMALLINT: |
| 506 | 506 | case Type::INTEGER: |
| 507 | 507 | case Type::BIGINT: |
| 508 | - $set[] = $versionColumnName . ' = ' . $versionColumnName . ' + 1'; |
|
| 508 | + $set[] = $versionColumnName.' = '.$versionColumnName.' + 1'; |
|
| 509 | 509 | break; |
| 510 | 510 | |
| 511 | 511 | case Type::DATETIME: |
| 512 | - $set[] = $versionColumnName . ' = CURRENT_TIMESTAMP'; |
|
| 512 | + $set[] = $versionColumnName.' = CURRENT_TIMESTAMP'; |
|
| 513 | 513 | break; |
| 514 | 514 | } |
| 515 | 515 | } |
| 516 | 516 | |
| 517 | - $sql = 'UPDATE ' . $quotedTableName |
|
| 518 | - . ' SET ' . implode(', ', $set) |
|
| 519 | - . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
| 517 | + $sql = 'UPDATE '.$quotedTableName |
|
| 518 | + . ' SET '.implode(', ', $set) |
|
| 519 | + . ' WHERE '.implode(' = ? AND ', $where).' = ?'; |
|
| 520 | 520 | |
| 521 | 521 | $result = $this->conn->executeUpdate($sql, $params, $types); |
| 522 | 522 | |
@@ -535,7 +535,7 @@ discard block |
||
| 535 | 535 | protected function deleteJoinTableRecords($identifier) |
| 536 | 536 | { |
| 537 | 537 | foreach ($this->class->getDeclaredPropertiesIterator() as $association) { |
| 538 | - if (! ($association instanceof ManyToManyAssociationMetadata)) { |
|
| 538 | + if ( ! ($association instanceof ManyToManyAssociationMetadata)) { |
|
| 539 | 539 | continue; |
| 540 | 540 | } |
| 541 | 541 | |
@@ -548,7 +548,7 @@ discard block |
||
| 548 | 548 | $keys = []; |
| 549 | 549 | |
| 550 | 550 | if ( ! $owningAssociation->isOwningSide()) { |
| 551 | - $class = $this->em->getClassMetadata($association->getTargetEntity()); |
|
| 551 | + $class = $this->em->getClassMetadata($association->getTargetEntity()); |
|
| 552 | 552 | $owningAssociation = $class->getProperty($association->getMappedBy()); |
| 553 | 553 | } |
| 554 | 554 | |
@@ -660,7 +660,7 @@ discard block |
||
| 660 | 660 | } |
| 661 | 661 | |
| 662 | 662 | // Only owning side of x-1 associations can have a FK column. |
| 663 | - if (! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) { |
|
| 663 | + if ( ! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) { |
|
| 664 | 664 | continue; |
| 665 | 665 | } |
| 666 | 666 | |
@@ -680,7 +680,7 @@ discard block |
||
| 680 | 680 | /** @var JoinColumnMetadata $joinColumn */ |
| 681 | 681 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 682 | 682 | |
| 683 | - if (! $joinColumn->getType()) { |
|
| 683 | + if ( ! $joinColumn->getType()) { |
|
| 684 | 684 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 685 | 685 | } |
| 686 | 686 | |
@@ -709,7 +709,7 @@ discard block |
||
| 709 | 709 | $propertyName = $this->class->fieldNames[$columnName]; |
| 710 | 710 | $property = $this->class->getProperty($propertyName); |
| 711 | 711 | |
| 712 | - if (! $property) { |
|
| 712 | + if ( ! $property) { |
|
| 713 | 713 | return null; |
| 714 | 714 | } |
| 715 | 715 | |
@@ -728,7 +728,7 @@ discard block |
||
| 728 | 728 | /** @var JoinColumnMetadata $joinColumn */ |
| 729 | 729 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 730 | 730 | |
| 731 | - if (! $joinColumn->getType()) { |
|
| 731 | + if ( ! $joinColumn->getType()) { |
|
| 732 | 732 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 733 | 733 | } |
| 734 | 734 | |
@@ -1065,7 +1065,7 @@ discard block |
||
| 1065 | 1065 | $criteria = []; |
| 1066 | 1066 | $parameters = []; |
| 1067 | 1067 | |
| 1068 | - if (! $association->isOwningSide()) { |
|
| 1068 | + if ( ! $association->isOwningSide()) { |
|
| 1069 | 1069 | $class = $this->em->getClassMetadata($association->getTargetEntity()); |
| 1070 | 1070 | $owningAssoc = $class->getProperty($association->getMappedBy()); |
| 1071 | 1071 | } |
@@ -1093,7 +1093,7 @@ discard block |
||
| 1093 | 1093 | $value = $value[$targetClass->identifier[0]]; |
| 1094 | 1094 | } |
| 1095 | 1095 | |
| 1096 | - $criteria[$joinTableName . '.' . $quotedColumnName] = $value; |
|
| 1096 | + $criteria[$joinTableName.'.'.$quotedColumnName] = $value; |
|
| 1097 | 1097 | $parameters[] = [ |
| 1098 | 1098 | 'value' => $value, |
| 1099 | 1099 | 'field' => $fieldName, |
@@ -1144,11 +1144,11 @@ discard block |
||
| 1144 | 1144 | |
| 1145 | 1145 | switch ($lockMode) { |
| 1146 | 1146 | case LockMode::PESSIMISTIC_READ: |
| 1147 | - $lockSql = ' ' . $this->platform->getReadLockSQL(); |
|
| 1147 | + $lockSql = ' '.$this->platform->getReadLockSQL(); |
|
| 1148 | 1148 | break; |
| 1149 | 1149 | |
| 1150 | 1150 | case LockMode::PESSIMISTIC_WRITE: |
| 1151 | - $lockSql = ' ' . $this->platform->getWriteLockSQL(); |
|
| 1151 | + $lockSql = ' '.$this->platform->getWriteLockSQL(); |
|
| 1152 | 1152 | break; |
| 1153 | 1153 | } |
| 1154 | 1154 | |
@@ -1159,14 +1159,14 @@ discard block |
||
| 1159 | 1159 | |
| 1160 | 1160 | if ('' !== $filterSql) { |
| 1161 | 1161 | $conditionSql = $conditionSql |
| 1162 | - ? $conditionSql . ' AND ' . $filterSql |
|
| 1162 | + ? $conditionSql.' AND '.$filterSql |
|
| 1163 | 1163 | : $filterSql; |
| 1164 | 1164 | } |
| 1165 | 1165 | |
| 1166 | - $select = 'SELECT ' . $columnList; |
|
| 1167 | - $from = ' FROM ' . $tableName . ' '. $tableAlias; |
|
| 1168 | - $join = $this->currentPersisterContext->selectJoinSql . $joinSql; |
|
| 1169 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : ''); |
|
| 1166 | + $select = 'SELECT '.$columnList; |
|
| 1167 | + $from = ' FROM '.$tableName.' '.$tableAlias; |
|
| 1168 | + $join = $this->currentPersisterContext->selectJoinSql.$joinSql; |
|
| 1169 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : ''); |
|
| 1170 | 1170 | $lock = $this->platform->appendLockHint($from, $lockMode); |
| 1171 | 1171 | $query = $select |
| 1172 | 1172 | . $lock |
@@ -1174,7 +1174,7 @@ discard block |
||
| 1174 | 1174 | . $where |
| 1175 | 1175 | . $orderBySql; |
| 1176 | 1176 | |
| 1177 | - return $this->platform->modifyLimitQuery($query, $limit, $offset) . $lockSql; |
|
| 1177 | + return $this->platform->modifyLimitQuery($query, $limit, $offset).$lockSql; |
|
| 1178 | 1178 | } |
| 1179 | 1179 | |
| 1180 | 1180 | /** |
@@ -1193,13 +1193,13 @@ discard block |
||
| 1193 | 1193 | |
| 1194 | 1194 | if ('' !== $filterSql) { |
| 1195 | 1195 | $conditionSql = $conditionSql |
| 1196 | - ? $conditionSql . ' AND ' . $filterSql |
|
| 1196 | + ? $conditionSql.' AND '.$filterSql |
|
| 1197 | 1197 | : $filterSql; |
| 1198 | 1198 | } |
| 1199 | 1199 | |
| 1200 | 1200 | $sql = 'SELECT COUNT(*) ' |
| 1201 | - . 'FROM ' . $tableName . ' ' . $tableAlias |
|
| 1202 | - . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql); |
|
| 1201 | + . 'FROM '.$tableName.' '.$tableAlias |
|
| 1202 | + . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql); |
|
| 1203 | 1203 | |
| 1204 | 1204 | return $sql; |
| 1205 | 1205 | } |
@@ -1216,7 +1216,7 @@ discard block |
||
| 1216 | 1216 | */ |
| 1217 | 1217 | protected final function getOrderBySQL(array $orderBy, $baseTableAlias) |
| 1218 | 1218 | { |
| 1219 | - if (! $orderBy) { |
|
| 1219 | + if ( ! $orderBy) { |
|
| 1220 | 1220 | return ''; |
| 1221 | 1221 | } |
| 1222 | 1222 | |
@@ -1225,7 +1225,7 @@ discard block |
||
| 1225 | 1225 | foreach ($orderBy as $fieldName => $orientation) { |
| 1226 | 1226 | $orientation = strtoupper(trim($orientation)); |
| 1227 | 1227 | |
| 1228 | - if (! in_array($orientation, ['ASC', 'DESC'])) { |
|
| 1228 | + if ( ! in_array($orientation, ['ASC', 'DESC'])) { |
|
| 1229 | 1229 | throw InvalidOrientation::fromClassNameAndField($this->class->getClassName(), $fieldName); |
| 1230 | 1230 | } |
| 1231 | 1231 | |
@@ -1235,11 +1235,11 @@ discard block |
||
| 1235 | 1235 | $tableAlias = $this->getSQLTableAlias($property->getTableName()); |
| 1236 | 1236 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
| 1237 | 1237 | |
| 1238 | - $orderByList[] = $tableAlias . '.' . $columnName . ' ' . $orientation; |
|
| 1238 | + $orderByList[] = $tableAlias.'.'.$columnName.' '.$orientation; |
|
| 1239 | 1239 | |
| 1240 | 1240 | continue; |
| 1241 | 1241 | } else if ($property instanceof AssociationMetadata) { |
| 1242 | - if (! $property->isOwningSide()) { |
|
| 1242 | + if ( ! $property->isOwningSide()) { |
|
| 1243 | 1243 | throw InvalidFindByCall::fromInverseSideUsage( |
| 1244 | 1244 | $this->class->getClassName(), |
| 1245 | 1245 | $fieldName |
@@ -1255,7 +1255,7 @@ discard block |
||
| 1255 | 1255 | /* @var JoinColumnMetadata $joinColumn */ |
| 1256 | 1256 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 1257 | 1257 | |
| 1258 | - $orderByList[] = $tableAlias . '.' . $quotedColumnName . ' ' . $orientation; |
|
| 1258 | + $orderByList[] = $tableAlias.'.'.$quotedColumnName.' '.$orientation; |
|
| 1259 | 1259 | } |
| 1260 | 1260 | |
| 1261 | 1261 | continue; |
@@ -1264,7 +1264,7 @@ discard block |
||
| 1264 | 1264 | throw UnrecognizedField::byName($fieldName); |
| 1265 | 1265 | } |
| 1266 | 1266 | |
| 1267 | - return ' ORDER BY ' . implode(', ', $orderByList); |
|
| 1267 | + return ' ORDER BY '.implode(', ', $orderByList); |
|
| 1268 | 1268 | } |
| 1269 | 1269 | |
| 1270 | 1270 | /** |
@@ -1286,7 +1286,7 @@ discard block |
||
| 1286 | 1286 | |
| 1287 | 1287 | |
| 1288 | 1288 | $this->currentPersisterContext->rsm->addEntityResult($this->class->getClassName(), 'r'); // r for root |
| 1289 | - $this->currentPersisterContext->selectJoinSql = ''; |
|
| 1289 | + $this->currentPersisterContext->selectJoinSql = ''; |
|
| 1290 | 1290 | |
| 1291 | 1291 | $eagerAliasCounter = 0; |
| 1292 | 1292 | $columnList = []; |
@@ -1322,7 +1322,7 @@ discard block |
||
| 1322 | 1322 | break; // now this is why you shouldn't use inheritance |
| 1323 | 1323 | } |
| 1324 | 1324 | |
| 1325 | - $assocAlias = 'e' . ($eagerAliasCounter++); |
|
| 1325 | + $assocAlias = 'e'.($eagerAliasCounter++); |
|
| 1326 | 1326 | |
| 1327 | 1327 | $this->currentPersisterContext->rsm->addJoinedEntityResult($targetEntity, $assocAlias, 'r', $fieldName); |
| 1328 | 1328 | |
@@ -1347,14 +1347,14 @@ discard block |
||
| 1347 | 1347 | $this->currentPersisterContext->rsm->addIndexBy($assocAlias, $property->getIndexedBy()); |
| 1348 | 1348 | } |
| 1349 | 1349 | |
| 1350 | - if (! $property->isOwningSide()) { |
|
| 1350 | + if ( ! $property->isOwningSide()) { |
|
| 1351 | 1351 | $owningAssociation = $eagerEntity->getProperty($property->getMappedBy()); |
| 1352 | 1352 | } |
| 1353 | 1353 | |
| 1354 | 1354 | $joinTableAlias = $this->getSQLTableAlias($eagerEntity->getTableName(), $assocAlias); |
| 1355 | 1355 | $joinTableName = $eagerEntity->table->getQuotedQualifiedName($this->platform); |
| 1356 | 1356 | |
| 1357 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $this->getJoinSQLForAssociation($property); |
|
| 1357 | + $this->currentPersisterContext->selectJoinSql .= ' '.$this->getJoinSQLForAssociation($property); |
|
| 1358 | 1358 | |
| 1359 | 1359 | $sourceClass = $this->em->getClassMetadata($owningAssociation->getSourceEntity()); |
| 1360 | 1360 | $targetClass = $this->em->getClassMetadata($owningAssociation->getTargetEntity()); |
@@ -1376,7 +1376,7 @@ discard block |
||
| 1376 | 1376 | $joinCondition[] = $filterSql; |
| 1377 | 1377 | } |
| 1378 | 1378 | |
| 1379 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $joinTableName . ' ' . $joinTableAlias . ' ON '; |
|
| 1379 | + $this->currentPersisterContext->selectJoinSql .= ' '.$joinTableName.' '.$joinTableAlias.' ON '; |
|
| 1380 | 1380 | $this->currentPersisterContext->selectJoinSql .= implode(' AND ', $joinCondition); |
| 1381 | 1381 | |
| 1382 | 1382 | break; |
@@ -1400,7 +1400,7 @@ discard block |
||
| 1400 | 1400 | */ |
| 1401 | 1401 | protected function getSelectColumnAssociationSQL($field, AssociationMetadata $association, ClassMetadata $class, $alias = 'r') |
| 1402 | 1402 | { |
| 1403 | - if (! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) { |
|
| 1403 | + if ( ! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) { |
|
| 1404 | 1404 | return ''; |
| 1405 | 1405 | } |
| 1406 | 1406 | |
@@ -1415,7 +1415,7 @@ discard block |
||
| 1415 | 1415 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 1416 | 1416 | $resultColumnName = $this->getSQLColumnAlias(); |
| 1417 | 1417 | |
| 1418 | - if (! $joinColumn->getType()) { |
|
| 1418 | + if ( ! $joinColumn->getType()) { |
|
| 1419 | 1419 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 1420 | 1420 | } |
| 1421 | 1421 | |
@@ -1447,7 +1447,7 @@ discard block |
||
| 1447 | 1447 | $owningAssociation = $association; |
| 1448 | 1448 | $sourceTableAlias = $this->getSQLTableAlias($this->class->getTableName()); |
| 1449 | 1449 | |
| 1450 | - if (! $association->isOwningSide()) { |
|
| 1450 | + if ( ! $association->isOwningSide()) { |
|
| 1451 | 1451 | $targetEntity = $this->em->getClassMetadata($association->getTargetEntity()); |
| 1452 | 1452 | $owningAssociation = $targetEntity->getProperty($association->getMappedBy()); |
| 1453 | 1453 | } |
@@ -1469,7 +1469,7 @@ discard block |
||
| 1469 | 1469 | ); |
| 1470 | 1470 | } |
| 1471 | 1471 | |
| 1472 | - return ' INNER JOIN ' . $joinTableName . ' ON ' . implode(' AND ', $conditions); |
|
| 1472 | + return ' INNER JOIN '.$joinTableName.' ON '.implode(' AND ', $conditions); |
|
| 1473 | 1473 | } |
| 1474 | 1474 | |
| 1475 | 1475 | /** |
@@ -1564,7 +1564,7 @@ discard block |
||
| 1564 | 1564 | $columnName = $joinColumn->getColumnName(); |
| 1565 | 1565 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 1566 | 1566 | |
| 1567 | - if (! $joinColumn->getType()) { |
|
| 1567 | + if ( ! $joinColumn->getType()) { |
|
| 1568 | 1568 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 1569 | 1569 | } |
| 1570 | 1570 | |
@@ -1603,7 +1603,7 @@ discard block |
||
| 1603 | 1603 | |
| 1604 | 1604 | $this->currentPersisterContext->rsm->addFieldResult($alias, $columnAlias, $field, $class->getClassName()); |
| 1605 | 1605 | |
| 1606 | - return $property->getType()->convertToPHPValueSQL($sql, $this->platform) . ' AS ' . $columnAlias; |
|
| 1606 | + return $property->getType()->convertToPHPValueSQL($sql, $this->platform).' AS '.$columnAlias; |
|
| 1607 | 1607 | } |
| 1608 | 1608 | |
| 1609 | 1609 | /** |
@@ -1617,14 +1617,14 @@ discard block |
||
| 1617 | 1617 | protected function getSQLTableAlias($tableName, $assocName = '') |
| 1618 | 1618 | { |
| 1619 | 1619 | if ($tableName) { |
| 1620 | - $tableName .= '#' . $assocName; |
|
| 1620 | + $tableName .= '#'.$assocName; |
|
| 1621 | 1621 | } |
| 1622 | 1622 | |
| 1623 | 1623 | if (isset($this->currentPersisterContext->sqlTableAliases[$tableName])) { |
| 1624 | 1624 | return $this->currentPersisterContext->sqlTableAliases[$tableName]; |
| 1625 | 1625 | } |
| 1626 | 1626 | |
| 1627 | - $tableAlias = 't' . $this->currentPersisterContext->sqlAliasCounter++; |
|
| 1627 | + $tableAlias = 't'.$this->currentPersisterContext->sqlAliasCounter++; |
|
| 1628 | 1628 | |
| 1629 | 1629 | $this->currentPersisterContext->sqlTableAliases[$tableName] = $tableAlias; |
| 1630 | 1630 | |
@@ -1651,7 +1651,7 @@ discard block |
||
| 1651 | 1651 | } |
| 1652 | 1652 | |
| 1653 | 1653 | $lock = $this->getLockTablesSql($lockMode); |
| 1654 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' '; |
|
| 1654 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : '').' '; |
|
| 1655 | 1655 | $sql = 'SELECT 1 ' |
| 1656 | 1656 | . $lock |
| 1657 | 1657 | . $where |
@@ -1674,7 +1674,7 @@ discard block |
||
| 1674 | 1674 | $tableName = $this->class->table->getQuotedQualifiedName($this->platform); |
| 1675 | 1675 | |
| 1676 | 1676 | return $this->platform->appendLockHint( |
| 1677 | - 'FROM ' . $tableName . ' ' . $this->getSQLTableAlias($this->class->getTableName()), |
|
| 1677 | + 'FROM '.$tableName.' '.$this->getSQLTableAlias($this->class->getTableName()), |
|
| 1678 | 1678 | $lockMode |
| 1679 | 1679 | ); |
| 1680 | 1680 | } |
@@ -1727,19 +1727,19 @@ discard block |
||
| 1727 | 1727 | |
| 1728 | 1728 | if (null !== $comparison) { |
| 1729 | 1729 | // special case null value handling |
| 1730 | - if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && null ===$value) { |
|
| 1731 | - $selectedColumns[] = $column . ' IS NULL'; |
|
| 1730 | + if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && null === $value) { |
|
| 1731 | + $selectedColumns[] = $column.' IS NULL'; |
|
| 1732 | 1732 | |
| 1733 | 1733 | continue; |
| 1734 | 1734 | } |
| 1735 | 1735 | |
| 1736 | 1736 | if ($comparison === Comparison::NEQ && null === $value) { |
| 1737 | - $selectedColumns[] = $column . ' IS NOT NULL'; |
|
| 1737 | + $selectedColumns[] = $column.' IS NOT NULL'; |
|
| 1738 | 1738 | |
| 1739 | 1739 | continue; |
| 1740 | 1740 | } |
| 1741 | 1741 | |
| 1742 | - $selectedColumns[] = $column . ' ' . sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
| 1742 | + $selectedColumns[] = $column.' '.sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
| 1743 | 1743 | |
| 1744 | 1744 | continue; |
| 1745 | 1745 | } |
@@ -1788,7 +1788,7 @@ discard block |
||
| 1788 | 1788 | $tableAlias = $this->getSQLTableAlias($property->getTableName()); |
| 1789 | 1789 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
| 1790 | 1790 | |
| 1791 | - return [$tableAlias . '.' . $columnName]; |
|
| 1791 | + return [$tableAlias.'.'.$columnName]; |
|
| 1792 | 1792 | } |
| 1793 | 1793 | |
| 1794 | 1794 | if ($property instanceof AssociationMetadata) { |
@@ -1797,7 +1797,7 @@ discard block |
||
| 1797 | 1797 | |
| 1798 | 1798 | // Many-To-Many requires join table check for joinColumn |
| 1799 | 1799 | if ($owningAssociation instanceof ManyToManyAssociationMetadata) { |
| 1800 | - if (! $owningAssociation->isOwningSide()) { |
|
| 1800 | + if ( ! $owningAssociation->isOwningSide()) { |
|
| 1801 | 1801 | $owningAssociation = $association; |
| 1802 | 1802 | } |
| 1803 | 1803 | |
@@ -1811,18 +1811,18 @@ discard block |
||
| 1811 | 1811 | foreach ($joinColumns as $joinColumn) { |
| 1812 | 1812 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 1813 | 1813 | |
| 1814 | - $columns[] = $joinTableName . '.' . $quotedColumnName; |
|
| 1814 | + $columns[] = $joinTableName.'.'.$quotedColumnName; |
|
| 1815 | 1815 | } |
| 1816 | 1816 | |
| 1817 | 1817 | } else { |
| 1818 | - if (! $owningAssociation->isOwningSide()) { |
|
| 1818 | + if ( ! $owningAssociation->isOwningSide()) { |
|
| 1819 | 1819 | throw InvalidFindByCall::fromInverseSideUsage( |
| 1820 | 1820 | $this->class->getClassName(), |
| 1821 | 1821 | $field |
| 1822 | 1822 | ); |
| 1823 | 1823 | } |
| 1824 | 1824 | |
| 1825 | - $class = $this->class->isInheritedProperty($field) |
|
| 1825 | + $class = $this->class->isInheritedProperty($field) |
|
| 1826 | 1826 | ? $owningAssociation->getDeclaringClass() |
| 1827 | 1827 | : $this->class |
| 1828 | 1828 | ; |
@@ -1831,7 +1831,7 @@ discard block |
||
| 1831 | 1831 | foreach ($owningAssociation->getJoinColumns() as $joinColumn) { |
| 1832 | 1832 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 1833 | 1833 | |
| 1834 | - $columns[] = $tableAlias . '.' . $quotedColumnName; |
|
| 1834 | + $columns[] = $tableAlias.'.'.$quotedColumnName; |
|
| 1835 | 1835 | } |
| 1836 | 1836 | } |
| 1837 | 1837 | |
@@ -1944,7 +1944,7 @@ discard block |
||
| 1944 | 1944 | $value = $value[$targetClass->identifier[0]]; |
| 1945 | 1945 | } |
| 1946 | 1946 | |
| 1947 | - $criteria[$tableAlias . "." . $quotedColumnName] = $value; |
|
| 1947 | + $criteria[$tableAlias.".".$quotedColumnName] = $value; |
|
| 1948 | 1948 | $parameters[] = [ |
| 1949 | 1949 | 'value' => $value, |
| 1950 | 1950 | 'field' => $fieldName, |
@@ -2031,7 +2031,7 @@ discard block |
||
| 2031 | 2031 | case ($property instanceof AssociationMetadata): |
| 2032 | 2032 | $class = $this->em->getClassMetadata($property->getTargetEntity()); |
| 2033 | 2033 | |
| 2034 | - if (! $property->isOwningSide()) { |
|
| 2034 | + if ( ! $property->isOwningSide()) { |
|
| 2035 | 2035 | $property = $class->getProperty($property->getMappedBy()); |
| 2036 | 2036 | $class = $this->em->getClassMetadata($property->getTargetEntity()); |
| 2037 | 2037 | } |
@@ -2045,7 +2045,7 @@ discard block |
||
| 2045 | 2045 | /** @var JoinColumnMetadata $joinColumn */ |
| 2046 | 2046 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 2047 | 2047 | |
| 2048 | - if (! $joinColumn->getType()) { |
|
| 2048 | + if ( ! $joinColumn->getType()) { |
|
| 2049 | 2049 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $class, $this->em)); |
| 2050 | 2050 | } |
| 2051 | 2051 | |
@@ -2060,7 +2060,7 @@ discard block |
||
| 2060 | 2060 | } |
| 2061 | 2061 | |
| 2062 | 2062 | if (is_array($value)) { |
| 2063 | - return array_map(function ($type) { |
|
| 2063 | + return array_map(function($type) { |
|
| 2064 | 2064 | return $type->getBindingType() + Connection::ARRAY_PARAM_OFFSET; |
| 2065 | 2065 | }, $types); |
| 2066 | 2066 | } |
@@ -2139,12 +2139,12 @@ discard block |
||
| 2139 | 2139 | |
| 2140 | 2140 | $sql = 'SELECT 1 ' |
| 2141 | 2141 | . $this->getLockTablesSql(null) |
| 2142 | - . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
| 2142 | + . ' WHERE '.$this->getSelectConditionSQL($criteria); |
|
| 2143 | 2143 | |
| 2144 | 2144 | list($params, $types) = $this->expandParameters($criteria); |
| 2145 | 2145 | |
| 2146 | 2146 | if (null !== $extraConditions) { |
| 2147 | - $sql .= ' AND ' . $this->getSelectConditionCriteriaSQL($extraConditions); |
|
| 2147 | + $sql .= ' AND '.$this->getSelectConditionCriteriaSQL($extraConditions); |
|
| 2148 | 2148 | list($criteriaParams, $criteriaTypes) = $this->expandCriteriaParameters($extraConditions); |
| 2149 | 2149 | |
| 2150 | 2150 | $params = array_merge($params, $criteriaParams); |
@@ -2152,7 +2152,7 @@ discard block |
||
| 2152 | 2152 | } |
| 2153 | 2153 | |
| 2154 | 2154 | if ($filterSql = $this->generateFilterConditionSQL($this->class, $alias)) { |
| 2155 | - $sql .= ' AND ' . $filterSql; |
|
| 2155 | + $sql .= ' AND '.$filterSql; |
|
| 2156 | 2156 | } |
| 2157 | 2157 | |
| 2158 | 2158 | return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
@@ -2167,13 +2167,13 @@ discard block |
||
| 2167 | 2167 | */ |
| 2168 | 2168 | protected function getJoinSQLForAssociation(AssociationMetadata $association) |
| 2169 | 2169 | { |
| 2170 | - if (! $association->isOwningSide()) { |
|
| 2170 | + if ( ! $association->isOwningSide()) { |
|
| 2171 | 2171 | return 'LEFT JOIN'; |
| 2172 | 2172 | } |
| 2173 | 2173 | |
| 2174 | 2174 | // if one of the join columns is nullable, return left join |
| 2175 | 2175 | foreach ($association->getJoinColumns() as $joinColumn) { |
| 2176 | - if (! $joinColumn->isNullable()) { |
|
| 2176 | + if ( ! $joinColumn->isNullable()) { |
|
| 2177 | 2177 | continue; |
| 2178 | 2178 | } |
| 2179 | 2179 | |
@@ -2190,7 +2190,7 @@ discard block |
||
| 2190 | 2190 | */ |
| 2191 | 2191 | public function getSQLColumnAlias() |
| 2192 | 2192 | { |
| 2193 | - return $this->platform->getSQLResultCasing('c' . $this->currentPersisterContext->sqlAliasCounter++); |
|
| 2193 | + return $this->platform->getSQLResultCasing('c'.$this->currentPersisterContext->sqlAliasCounter++); |
|
| 2194 | 2194 | } |
| 2195 | 2195 | |
| 2196 | 2196 | /** |
@@ -2207,13 +2207,13 @@ discard block |
||
| 2207 | 2207 | |
| 2208 | 2208 | foreach ($this->em->getFilters()->getEnabledFilters() as $filter) { |
| 2209 | 2209 | if ('' !== $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias)) { |
| 2210 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
| 2210 | + $filterClauses[] = '('.$filterExpr.')'; |
|
| 2211 | 2211 | } |
| 2212 | 2212 | } |
| 2213 | 2213 | |
| 2214 | 2214 | $sql = implode(' AND ', $filterClauses); |
| 2215 | 2215 | |
| 2216 | - return $sql ? "(" . $sql . ")" : ""; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
| 2216 | + return $sql ? "(".$sql.")" : ""; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
| 2217 | 2217 | } |
| 2218 | 2218 | |
| 2219 | 2219 | /** |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | * @param string $entityName Full or partial entity name |
| 166 | 166 | * @param EntityManagerInterface $entityManager |
| 167 | 167 | * |
| 168 | - * @return \Doctrine\ORM\Mapping\ClassMetadata |
|
| 168 | + * @return \Doctrine\Common\Persistence\Mapping\ClassMetadata |
|
| 169 | 169 | */ |
| 170 | 170 | private function getClassMetadata($entityName, EntityManagerInterface $entityManager) |
| 171 | 171 | { |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | * @param string $label Label for the value |
| 249 | 249 | * @param mixed $value A Value to show |
| 250 | 250 | * |
| 251 | - * @return array |
|
| 251 | + * @return string[] |
|
| 252 | 252 | */ |
| 253 | 253 | private function formatField($label, $value) |
| 254 | 254 | { |
@@ -347,7 +347,7 @@ discard block |
||
| 347 | 347 | * |
| 348 | 348 | * @param array $entityListeners |
| 349 | 349 | * |
| 350 | - * @return array |
|
| 350 | + * @return string[] |
|
| 351 | 351 | */ |
| 352 | 352 | private function formatEntityListeners(array $entityListeners) |
| 353 | 353 | { |
@@ -298,7 +298,7 @@ |
||
| 298 | 298 | |
| 299 | 299 | if ($property instanceof FieldMetadata) { |
| 300 | 300 | $output = array_merge($output, $this->formatColumn($property)); |
| 301 | - } else if ($property instanceof AssociationMetadata) { |
|
| 301 | + } else if ($property instanceof AssociationMetadata) { |
|
| 302 | 302 | // @todo guilhermeblanco Fix me! We are trying to iterate through an AssociationMetadata instance |
| 303 | 303 | foreach ($property as $field => $value) { |
| 304 | 304 | $output[] = $this->formatField(sprintf(' %s', $field), $this->formatValue($value)); |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\ORM\Tools\Console\Command; |
| 6 | 6 | |
@@ -165,8 +165,8 @@ discard block |
||
| 165 | 165 | |
| 166 | 166 | $matches = array_filter( |
| 167 | 167 | $this->getMappedEntities($entityManager), |
| 168 | - function ($mappedEntity) use ($entityName) { |
|
| 169 | - return preg_match('{' . preg_quote($entityName) . '}', $mappedEntity); |
|
| 168 | + function($mappedEntity) use ($entityName) { |
|
| 169 | + return preg_match('{'.preg_quote($entityName).'}', $mappedEntity); |
|
| 170 | 170 | } |
| 171 | 171 | ); |
| 172 | 172 | |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | |
| 224 | 224 | $output[] = $this->formatField( |
| 225 | 225 | sprintf(' %s', $parentClass->getParent()), |
| 226 | - ($parentClass->isRootEntity() ? '(Root) ' : '') . $this->formatValue($attributes) |
|
| 226 | + ($parentClass->isRootEntity() ? '(Root) ' : '').$this->formatValue($attributes) |
|
| 227 | 227 | ); |
| 228 | 228 | } |
| 229 | 229 | |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | if (is_bool($value)) { |
| 251 | - return '<comment>' . ($value ? 'True' : 'False') . '</comment>'; |
|
| 251 | + return '<comment>'.($value ? 'True' : 'False').'</comment>'; |
|
| 252 | 252 | } |
| 253 | 253 | |
| 254 | 254 | if (empty($value)) { |
@@ -330,7 +330,7 @@ discard block |
||
| 330 | 330 | |
| 331 | 331 | if ($property instanceof FieldMetadata) { |
| 332 | 332 | $output = array_merge($output, $this->formatColumn($property)); |
| 333 | - } else if ($property instanceof AssociationMetadata) { |
|
| 333 | + } else if ($property instanceof AssociationMetadata) { |
|
| 334 | 334 | // @todo guilhermeblanco Fix me! We are trying to iterate through an AssociationMetadata instance |
| 335 | 335 | foreach ($property as $field => $value) { |
| 336 | 336 | $output[] = $this->formatField(sprintf(' %s', $field), $this->formatValue($value)); |
@@ -386,7 +386,7 @@ discard block |
||
| 386 | 386 | return $this->formatField( |
| 387 | 387 | 'Entity listeners', |
| 388 | 388 | array_map( |
| 389 | - function ($entityListener) { |
|
| 389 | + function($entityListener) { |
|
| 390 | 390 | return get_class($entityListener); |
| 391 | 391 | }, |
| 392 | 392 | $entityListeners |
@@ -21,9 +21,7 @@ |
||
| 21 | 21 | |
| 22 | 22 | namespace Doctrine\ORM\Tools\Pagination; |
| 23 | 23 | |
| 24 | -use Doctrine\DBAL\Types\Type; |
|
| 25 | 24 | use Doctrine\ORM\Mapping\AssociationMetadata; |
| 26 | -use Doctrine\ORM\Mapping\ClassMetadata; |
|
| 27 | 25 | use Doctrine\ORM\Mapping\ToManyAssociationMetadata; |
| 28 | 26 | use Doctrine\ORM\Query; |
| 29 | 27 | use Doctrine\ORM\Query\TreeWalkerAdapter; |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\ORM\Tools\Pagination; |
| 6 | 6 | |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | if ($property instanceof AssociationMetadata) { |
| 74 | 74 | throw new \RuntimeException( |
| 75 | - "Paginating an entity with foreign key as identifier only works when using the Output Walkers. " . |
|
| 75 | + "Paginating an entity with foreign key as identifier only works when using the Output Walkers. ". |
|
| 76 | 76 | "Call Paginator#setUseOutputWalkers(true) before iterating the paginator." |
| 77 | 77 | ); |
| 78 | 78 | } |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | |
| 100 | 100 | $AST->selectClause->selectExpressions[] = new SelectExpression( |
| 101 | 101 | $this->createSelectExpressionItem($item->expression), |
| 102 | - '_dctrn_ord' . $this->aliasCounter++ |
|
| 102 | + '_dctrn_ord'.$this->aliasCounter++ |
|
| 103 | 103 | ); |
| 104 | 104 | } |
| 105 | 105 | } |
@@ -29,7 +29,6 @@ |
||
| 29 | 29 | use Doctrine\ORM\Mapping\FieldMetadata; |
| 30 | 30 | use Doctrine\ORM\Mapping\ManyToManyAssociationMetadata; |
| 31 | 31 | use Doctrine\ORM\Mapping\ToOneAssociationMetadata; |
| 32 | -use Doctrine\ORM\Query\QueryException; |
|
| 33 | 32 | |
| 34 | 33 | /** |
| 35 | 34 | * The PersisterHelper contains logic to infer binding types which is used in |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | |
| 4 | -declare(strict_types=1); |
|
| 4 | +declare(strict_types = 1); |
|
| 5 | 5 | |
| 6 | 6 | namespace Doctrine\ORM\Utility; |
| 7 | 7 | |
@@ -62,14 +62,14 @@ discard block |
||
| 62 | 62 | |
| 63 | 63 | // iterate over association mappings |
| 64 | 64 | foreach ($class->getDeclaredPropertiesIterator() as $association) { |
| 65 | - if (! ($association instanceof AssociationMetadata)) { |
|
| 65 | + if ( ! ($association instanceof AssociationMetadata)) { |
|
| 66 | 66 | continue; |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | // resolve join columns over to-one or to-many |
| 70 | 70 | $targetClass = $em->getClassMetadata($association->getTargetEntity()); |
| 71 | 71 | |
| 72 | - if (! $association->isOwningSide()) { |
|
| 72 | + if ( ! $association->isOwningSide()) { |
|
| 73 | 73 | $association = $targetClass->getProperty($association->getMappedBy()); |
| 74 | 74 | $targetClass = $em->getClassMetadata($association->getTargetEntity()); |
| 75 | 75 | } |
@@ -5,8 +5,6 @@ |
||
| 5 | 5 | namespace Doctrine\Tests\Mocks; |
| 6 | 6 | |
| 7 | 7 | use Doctrine\Common\Collections\Criteria; |
| 8 | -use Doctrine\ORM\Mapping\ClassMetadata; |
|
| 9 | -use Doctrine\ORM\Mapping\GeneratorType; |
|
| 10 | 8 | use Doctrine\ORM\Persisters\Entity\BasicEntityPersister; |
| 11 | 9 | |
| 12 | 10 | /** |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\Tests\Mocks; |
| 6 | 6 | |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | |
| 235 | 235 | /** |
| 236 | 236 | * |
| 237 | - * @return kateglo\application\helpers\collections\ArrayCollection |
|
| 237 | + * @return ArrayCollection |
|
| 238 | 238 | */ |
| 239 | 239 | public function getTypes() |
| 240 | 240 | { |
@@ -337,7 +337,7 @@ discard block |
||
| 337 | 337 | |
| 338 | 338 | /** |
| 339 | 339 | * |
| 340 | - * @param kateglo\application\models\Lemma $lemma |
|
| 340 | + * @param Lemma $lemma |
|
| 341 | 341 | * @return void |
| 342 | 342 | */ |
| 343 | 343 | public function addLemma(Lemma $lemma) |
@@ -350,7 +350,7 @@ discard block |
||
| 350 | 350 | |
| 351 | 351 | /** |
| 352 | 352 | * |
| 353 | - * @param kateglo\application\models\Lemma $lemma |
|
| 353 | + * @param Lemma $lemma |
|
| 354 | 354 | * @return void |
| 355 | 355 | */ |
| 356 | 356 | public function removeLEmma(Lemma $lemma) |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\Tests\ORM\Functional; |
| 6 | 6 | |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | * |
| 207 | 207 | * @return string |
| 208 | 208 | */ |
| 209 | - public function getLemma(){ |
|
| 209 | + public function getLemma() { |
|
| 210 | 210 | return $this->lemma; |
| 211 | 211 | } |
| 212 | 212 | |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | */ |
| 216 | 216 | public function addType(Type $type) |
| 217 | 217 | { |
| 218 | - if (!$this->types->contains($type)) { |
|
| 218 | + if ( ! $this->types->contains($type)) { |
|
| 219 | 219 | $this->types[] = $type; |
| 220 | 220 | $type->addLemma($this); |
| 221 | 221 | } |
@@ -342,7 +342,7 @@ discard block |
||
| 342 | 342 | */ |
| 343 | 343 | public function addLemma(Lemma $lemma) |
| 344 | 344 | { |
| 345 | - if (!$this->lemmas->contains($lemma)) { |
|
| 345 | + if ( ! $this->lemmas->contains($lemma)) { |
|
| 346 | 346 | $this->lemmas[] = $lemma; |
| 347 | 347 | $lemma->addType($this); |
| 348 | 348 | } |
@@ -4,7 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\Tests\ORM\Functional; |
| 6 | 6 | |
| 7 | -use Doctrine\ORM\Mapping\ClassMetadata; |
|
| 8 | 7 | use Doctrine\ORM\Mapping\FetchMode; |
| 9 | 8 | use Doctrine\Tests\Models\CMS\CmsArticle; |
| 10 | 9 | use Doctrine\Tests\Models\CMS\CmsGroup; |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\Tests\ORM\Functional; |
| 6 | 6 | |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | $this->useModelSet('ddc2504'); |
| 44 | 44 | parent::setUp(); |
| 45 | 45 | |
| 46 | - $class = $this->em->getClassMetadata(CmsUser::class); |
|
| 46 | + $class = $this->em->getClassMetadata(CmsUser::class); |
|
| 47 | 47 | |
| 48 | 48 | $class->getProperty('groups')->setFetchMode(FetchMode::EXTRA_LAZY); |
| 49 | 49 | $class->getProperty('articles')->setFetchMode(FetchMode::EXTRA_LAZY); |
@@ -304,7 +304,7 @@ discard block |
||
| 304 | 304 | |
| 305 | 305 | $queryCount = $this->getCurrentQueryCount(); |
| 306 | 306 | self::assertFalse($user->articles->contains($article)); |
| 307 | - self::assertEquals($queryCount+1, $this->getCurrentQueryCount(), "Checking for contains of persisted entity should cause one query to be executed."); |
|
| 307 | + self::assertEquals($queryCount + 1, $this->getCurrentQueryCount(), "Checking for contains of persisted entity should cause one query to be executed."); |
|
| 308 | 308 | self::assertFalse($user->articles->isInitialized(), "Post-Condition: Collection is not initialized."); |
| 309 | 309 | |
| 310 | 310 | // Test One to Many existence with state managed |
@@ -471,7 +471,7 @@ discard block |
||
| 471 | 471 | |
| 472 | 472 | $queryCount = $this->getCurrentQueryCount(); |
| 473 | 473 | self::assertTrue($group->users->contains($user)); |
| 474 | - self::assertEquals($queryCount+1, $this->getCurrentQueryCount(), "Checking for contains of managed entity should cause one query to be executed."); |
|
| 474 | + self::assertEquals($queryCount + 1, $this->getCurrentQueryCount(), "Checking for contains of managed entity should cause one query to be executed."); |
|
| 475 | 475 | self::assertFalse($user->groups->isInitialized(), "Post-Condition: Collection is not initialized."); |
| 476 | 476 | |
| 477 | 477 | $newUser = new CmsUser(); |
@@ -1251,7 +1251,7 @@ discard block |
||
| 1251 | 1251 | $user = new User(); |
| 1252 | 1252 | $userList = new UserList(); |
| 1253 | 1253 | |
| 1254 | - $user->name = 'ocramius'; |
|
| 1254 | + $user->name = 'ocramius'; |
|
| 1255 | 1255 | $userList->listName = 'PHP Developers to follow closely'; |
| 1256 | 1256 | |
| 1257 | 1257 | $user->addUserList($userList); |
@@ -6,8 +6,6 @@ |
||
| 6 | 6 | |
| 7 | 7 | use Doctrine\ORM\Mapping\FetchMode; |
| 8 | 8 | use Doctrine\Tests\Models\ECommerce\ECommerceProduct; |
| 9 | -use Doctrine\ORM\Mapping\AssociationMapping; |
|
| 10 | -use Doctrine\ORM\Mapping\ClassMetadata; |
|
| 11 | 9 | |
| 12 | 10 | /** |
| 13 | 11 | * Tests a self referential many-to-many association mapping (from a model to the same model, without inheritance). |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\Tests\ORM\Functional; |
| 6 | 6 | |
@@ -7,8 +7,6 @@ |
||
| 7 | 7 | use Doctrine\ORM\Mapping\FetchMode; |
| 8 | 8 | use Doctrine\Tests\Models\ECommerce\ECommerceCart; |
| 9 | 9 | use Doctrine\Tests\Models\ECommerce\ECommerceProduct; |
| 10 | -use Doctrine\ORM\Mapping\AssociationMapping; |
|
| 11 | -use Doctrine\ORM\Mapping\ClassMetadata; |
|
| 12 | 10 | |
| 13 | 11 | /** |
| 14 | 12 | * Tests a unidirectional many-to-many association mapping (without inheritance). |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\Tests\ORM\Functional; |
| 6 | 6 | |