@@ -579,7 +579,7 @@ |
||
| 579 | 579 | * Internal note: Tried to implement Serializable first but that did not work well |
| 580 | 580 | * with circular references. This solution seems simpler and works well. |
| 581 | 581 | * |
| 582 | - * @return array |
|
| 582 | + * @return string[] |
|
| 583 | 583 | */ |
| 584 | 584 | public function __sleep() |
| 585 | 585 | { |
@@ -403,7 +403,7 @@ discard block |
||
| 403 | 403 | */ |
| 404 | 404 | public function containsKey($key) |
| 405 | 405 | { |
| 406 | - if (! $this->initialized && $this->association['fetch'] === ClassMetadata::FETCH_EXTRA_LAZY |
|
| 406 | + if ( ! $this->initialized && $this->association['fetch'] === ClassMetadata::FETCH_EXTRA_LAZY |
|
| 407 | 407 | && isset($this->association['indexBy'])) { |
| 408 | 408 | $persister = $this->em->getUnitOfWork()->getCollectionPersister($this->association); |
| 409 | 409 | |
@@ -436,7 +436,7 @@ discard block |
||
| 436 | 436 | && $this->association['fetch'] === ClassMetadata::FETCH_EXTRA_LAZY |
| 437 | 437 | && isset($this->association['indexBy']) |
| 438 | 438 | ) { |
| 439 | - if (!$this->typeClass->isIdentifierComposite && $this->typeClass->isIdentifier($this->association['indexBy'])) { |
|
| 439 | + if ( ! $this->typeClass->isIdentifierComposite && $this->typeClass->isIdentifier($this->association['indexBy'])) { |
|
| 440 | 440 | return $this->em->find($this->typeClass->name, $key); |
| 441 | 441 | } |
| 442 | 442 | |
@@ -20,7 +20,6 @@ |
||
| 20 | 20 | namespace Doctrine\ORM\Persisters\Collection; |
| 21 | 21 | |
| 22 | 22 | use Doctrine\Common\Collections\Criteria; |
| 23 | -use Doctrine\Common\Proxy\Proxy; |
|
| 24 | 23 | use Doctrine\DBAL\Types\Type; |
| 25 | 24 | use Doctrine\ORM\PersistentCollection; |
| 26 | 25 | use Doctrine\ORM\Utility\PersisterHelper; |
@@ -147,9 +147,9 @@ |
||
| 147 | 147 | return (bool) $persister->count($criteria); |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | - /** |
|
| 151 | - * {@inheritdoc} |
|
| 152 | - */ |
|
| 150 | + /** |
|
| 151 | + * {@inheritdoc} |
|
| 152 | + */ |
|
| 153 | 153 | public function contains(PersistentCollection $collection, $element) |
| 154 | 154 | { |
| 155 | 155 | if ( ! $this->isValidEntityState($element)) { |
@@ -218,8 +218,8 @@ discard block |
||
| 218 | 218 | $parameters[] = $identifier[$sourceClass->getFieldForColumn($joinColumn['referencedColumnName'])]; |
| 219 | 219 | } |
| 220 | 220 | |
| 221 | - $statement = 'DELETE FROM ' . $this->quoteStrategy->getTableName($targetClass, $this->platform) |
|
| 222 | - . ' WHERE ' . implode(' = ? AND ', $columns) . ' = ?'; |
|
| 221 | + $statement = 'DELETE FROM '.$this->quoteStrategy->getTableName($targetClass, $this->platform) |
|
| 222 | + . ' WHERE '.implode(' = ? AND ', $columns).' = ?'; |
|
| 223 | 223 | |
| 224 | 224 | return $this->conn->executeUpdate($statement, $parameters); |
| 225 | 225 | } |
@@ -256,18 +256,18 @@ discard block |
||
| 256 | 256 | ); |
| 257 | 257 | } |
| 258 | 258 | |
| 259 | - $statement = $this->platform->getCreateTemporaryTableSnippetSQL() . ' ' . $tempTable |
|
| 260 | - . ' (' . $this->platform->getColumnDeclarationListSQL($columnDefinitions) . ')'; |
|
| 259 | + $statement = $this->platform->getCreateTemporaryTableSnippetSQL().' '.$tempTable |
|
| 260 | + . ' ('.$this->platform->getColumnDeclarationListSQL($columnDefinitions).')'; |
|
| 261 | 261 | |
| 262 | 262 | $this->conn->executeUpdate($statement); |
| 263 | 263 | |
| 264 | 264 | // 2) Build insert table records into temporary table |
| 265 | 265 | $query = $this->em->createQuery( |
| 266 | - ' SELECT t0.' . implode(', t0.', $rootClass->getIdentifierFieldNames()) |
|
| 267 | - . ' FROM ' . $targetClass->name . ' t0 WHERE t0.' . $mapping['mappedBy'] . ' = :owner' |
|
| 266 | + ' SELECT t0.'.implode(', t0.', $rootClass->getIdentifierFieldNames()) |
|
| 267 | + . ' FROM '.$targetClass->name.' t0 WHERE t0.'.$mapping['mappedBy'].' = :owner' |
|
| 268 | 268 | )->setParameter('owner', $collection->getOwner()); |
| 269 | 269 | |
| 270 | - $statement = 'INSERT INTO ' . $tempTable . ' (' . $idColumnList . ') ' . $query->getSQL(); |
|
| 270 | + $statement = 'INSERT INTO '.$tempTable.' ('.$idColumnList.') '.$query->getSQL(); |
|
| 271 | 271 | $parameters = array_values($sourceClass->getIdentifierValues($collection->getOwner())); |
| 272 | 272 | $numDeleted = $this->conn->executeUpdate($statement, $parameters); |
| 273 | 273 | |
@@ -276,8 +276,8 @@ discard block |
||
| 276 | 276 | |
| 277 | 277 | foreach (array_reverse($classNames) as $className) { |
| 278 | 278 | $tableName = $this->quoteStrategy->getTableName($this->em->getClassMetadata($className), $this->platform); |
| 279 | - $statement = 'DELETE FROM ' . $tableName . ' WHERE (' . $idColumnList . ')' |
|
| 280 | - . ' IN (SELECT ' . $idColumnList . ' FROM ' . $tempTable . ')'; |
|
| 279 | + $statement = 'DELETE FROM '.$tableName.' WHERE ('.$idColumnList.')' |
|
| 280 | + . ' IN (SELECT '.$idColumnList.' FROM '.$tempTable.')'; |
|
| 281 | 281 | |
| 282 | 282 | $this->conn->executeUpdate($statement); |
| 283 | 283 | } |
@@ -20,11 +20,8 @@ |
||
| 20 | 20 | namespace Doctrine\ORM\Persisters\Entity; |
| 21 | 21 | |
| 22 | 22 | use Doctrine\ORM\Mapping\ClassMetadata; |
| 23 | -use Doctrine\ORM\Query\ResultSetMapping; |
|
| 24 | - |
|
| 25 | 23 | use Doctrine\DBAL\LockMode; |
| 26 | 24 | use Doctrine\DBAL\Types\Type; |
| 27 | - |
|
| 28 | 25 | use Doctrine\Common\Collections\Criteria; |
| 29 | 26 | use Doctrine\ORM\Utility\PersisterHelper; |
| 30 | 27 | |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 | foreach ($data as $columnName => $value) { |
| 211 | - if (!is_array($id) || !isset($id[$columnName])) { |
|
| 211 | + if ( ! is_array($id) || ! isset($id[$columnName])) { |
|
| 212 | 212 | $stmt->bindValue($paramIndex++, $value, $this->columnTypes[$columnName]); |
| 213 | 213 | } |
| 214 | 214 | } |
@@ -323,7 +323,7 @@ discard block |
||
| 323 | 323 | // If the current class in the root entity, add the filters |
| 324 | 324 | if ($filterSql = $this->generateFilterConditionSQL($this->em->getClassMetadata($this->class->rootEntityName), $this->getSQLTableAlias($this->class->rootEntityName))) { |
| 325 | 325 | $conditionSql .= $conditionSql |
| 326 | - ? ' AND ' . $filterSql |
|
| 326 | + ? ' AND '.$filterSql |
|
| 327 | 327 | : $filterSql; |
| 328 | 328 | } |
| 329 | 329 | |
@@ -342,29 +342,29 @@ discard block |
||
| 342 | 342 | switch ($lockMode) { |
| 343 | 343 | case LockMode::PESSIMISTIC_READ: |
| 344 | 344 | |
| 345 | - $lockSql = ' ' . $this->platform->getReadLockSql(); |
|
| 345 | + $lockSql = ' '.$this->platform->getReadLockSql(); |
|
| 346 | 346 | |
| 347 | 347 | break; |
| 348 | 348 | |
| 349 | 349 | case LockMode::PESSIMISTIC_WRITE: |
| 350 | 350 | |
| 351 | - $lockSql = ' ' . $this->platform->getWriteLockSql(); |
|
| 351 | + $lockSql = ' '.$this->platform->getWriteLockSql(); |
|
| 352 | 352 | |
| 353 | 353 | break; |
| 354 | 354 | } |
| 355 | 355 | |
| 356 | 356 | $tableName = $this->quoteStrategy->getTableName($this->class, $this->platform); |
| 357 | - $from = ' FROM ' . $tableName . ' ' . $baseTableAlias; |
|
| 358 | - $where = $conditionSql != '' ? ' WHERE ' . $conditionSql : ''; |
|
| 357 | + $from = ' FROM '.$tableName.' '.$baseTableAlias; |
|
| 358 | + $where = $conditionSql != '' ? ' WHERE '.$conditionSql : ''; |
|
| 359 | 359 | $lock = $this->platform->appendLockHint($from, $lockMode); |
| 360 | 360 | $columnList = $this->getSelectColumnsSQL(); |
| 361 | - $query = 'SELECT ' . $columnList |
|
| 361 | + $query = 'SELECT '.$columnList |
|
| 362 | 362 | . $lock |
| 363 | 363 | . $joinSql |
| 364 | 364 | . $where |
| 365 | 365 | . $orderBySql; |
| 366 | 366 | |
| 367 | - return $this->platform->modifyLimitQuery($query, $limit, $offset) . $lockSql; |
|
| 367 | + return $this->platform->modifyLimitQuery($query, $limit, $offset).$lockSql; |
|
| 368 | 368 | } |
| 369 | 369 | |
| 370 | 370 | /** |
@@ -384,14 +384,14 @@ discard block |
||
| 384 | 384 | |
| 385 | 385 | if ('' !== $filterSql) { |
| 386 | 386 | $conditionSql = $conditionSql |
| 387 | - ? $conditionSql . ' AND ' . $filterSql |
|
| 387 | + ? $conditionSql.' AND '.$filterSql |
|
| 388 | 388 | : $filterSql; |
| 389 | 389 | } |
| 390 | 390 | |
| 391 | 391 | $sql = 'SELECT COUNT(*) ' |
| 392 | - . 'FROM ' . $tableName . ' ' . $baseTableAlias |
|
| 392 | + . 'FROM '.$tableName.' '.$baseTableAlias |
|
| 393 | 393 | . $joinSql |
| 394 | - . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql); |
|
| 394 | + . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql); |
|
| 395 | 395 | |
| 396 | 396 | return $sql; |
| 397 | 397 | } |
@@ -410,16 +410,16 @@ discard block |
||
| 410 | 410 | $conditions = array(); |
| 411 | 411 | $tableAlias = $this->getSQLTableAlias($parentClassName); |
| 412 | 412 | $parentClass = $this->em->getClassMetadata($parentClassName); |
| 413 | - $joinSql .= ' INNER JOIN ' . $this->quoteStrategy->getTableName($parentClass, $this->platform) . ' ' . $tableAlias . ' ON '; |
|
| 413 | + $joinSql .= ' INNER JOIN '.$this->quoteStrategy->getTableName($parentClass, $this->platform).' '.$tableAlias.' ON '; |
|
| 414 | 414 | |
| 415 | 415 | foreach ($identifierColumns as $idColumn) { |
| 416 | - $conditions[] = $baseTableAlias . '.' . $idColumn . ' = ' . $tableAlias . '.' . $idColumn; |
|
| 416 | + $conditions[] = $baseTableAlias.'.'.$idColumn.' = '.$tableAlias.'.'.$idColumn; |
|
| 417 | 417 | } |
| 418 | 418 | |
| 419 | 419 | $joinSql .= implode(' AND ', $conditions); |
| 420 | 420 | } |
| 421 | 421 | |
| 422 | - return parent::getLockTablesSql($lockMode) . $joinSql; |
|
| 422 | + return parent::getLockTablesSql($lockMode).$joinSql; |
|
| 423 | 423 | } |
| 424 | 424 | |
| 425 | 425 | /** |
@@ -488,7 +488,7 @@ discard block |
||
| 488 | 488 | ? $baseTableAlias |
| 489 | 489 | : $this->getSQLTableAlias($this->class->rootEntityName); |
| 490 | 490 | |
| 491 | - $columnList[] = $tableAlias . '.' . $discrColumn; |
|
| 491 | + $columnList[] = $tableAlias.'.'.$discrColumn; |
|
| 492 | 492 | |
| 493 | 493 | // sub tables |
| 494 | 494 | foreach ($this->class->subClasses as $subClassName) { |
@@ -603,11 +603,11 @@ discard block |
||
| 603 | 603 | $conditions = array(); |
| 604 | 604 | $parentClass = $this->em->getClassMetadata($parentClassName); |
| 605 | 605 | $tableAlias = $this->getSQLTableAlias($parentClassName); |
| 606 | - $joinSql .= ' INNER JOIN ' . $this->quoteStrategy->getTableName($parentClass, $this->platform) . ' ' . $tableAlias . ' ON '; |
|
| 606 | + $joinSql .= ' INNER JOIN '.$this->quoteStrategy->getTableName($parentClass, $this->platform).' '.$tableAlias.' ON '; |
|
| 607 | 607 | |
| 608 | 608 | |
| 609 | 609 | foreach ($identifierColumn as $idColumn) { |
| 610 | - $conditions[] = $baseTableAlias . '.' . $idColumn . ' = ' . $tableAlias . '.' . $idColumn; |
|
| 610 | + $conditions[] = $baseTableAlias.'.'.$idColumn.' = '.$tableAlias.'.'.$idColumn; |
|
| 611 | 611 | } |
| 612 | 612 | |
| 613 | 613 | $joinSql .= implode(' AND ', $conditions); |
@@ -618,10 +618,10 @@ discard block |
||
| 618 | 618 | $conditions = array(); |
| 619 | 619 | $subClass = $this->em->getClassMetadata($subClassName); |
| 620 | 620 | $tableAlias = $this->getSQLTableAlias($subClassName); |
| 621 | - $joinSql .= ' LEFT JOIN ' . $this->quoteStrategy->getTableName($subClass, $this->platform) . ' ' . $tableAlias . ' ON '; |
|
| 621 | + $joinSql .= ' LEFT JOIN '.$this->quoteStrategy->getTableName($subClass, $this->platform).' '.$tableAlias.' ON '; |
|
| 622 | 622 | |
| 623 | 623 | foreach ($identifierColumn as $idColumn) { |
| 624 | - $conditions[] = $baseTableAlias . '.' . $idColumn . ' = ' . $tableAlias . '.' . $idColumn; |
|
| 624 | + $conditions[] = $baseTableAlias.'.'.$idColumn.' = '.$tableAlias.'.'.$idColumn; |
|
| 625 | 625 | } |
| 626 | 626 | |
| 627 | 627 | $joinSql .= implode(' AND ', $conditions); |
@@ -69,7 +69,7 @@ |
||
| 69 | 69 | * @param EntityManagerInterface $em The EntityManager the new factory works for. |
| 70 | 70 | * @param string $proxyDir The directory to use for the proxy classes. It must exist. |
| 71 | 71 | * @param string $proxyNs The namespace to use for the proxy classes. |
| 72 | - * @param boolean|int $autoGenerate The strategy for automatically generating proxy classes. Possible |
|
| 72 | + * @param integer $autoGenerate The strategy for automatically generating proxy classes. Possible |
|
| 73 | 73 | * values are constants of Doctrine\Common\Proxy\AbstractProxyFactory. |
| 74 | 74 | */ |
| 75 | 75 | public function __construct(EntityManagerInterface $em, $proxyDir, $proxyNs, $autoGenerate = AbstractProxyFactory::AUTOGENERATE_NEVER) |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | { |
| 126 | 126 | $wakeupProxy = $classMetadata->getReflectionClass()->hasMethod('__wakeup'); |
| 127 | 127 | |
| 128 | - return function (BaseProxy $proxy) use ($entityPersister, $classMetadata, $wakeupProxy) { |
|
| 128 | + return function(BaseProxy $proxy) use ($entityPersister, $classMetadata, $wakeupProxy) { |
|
| 129 | 129 | $initializer = $proxy->__getInitializer(); |
| 130 | 130 | $cloner = $proxy->__getCloner(); |
| 131 | 131 | |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | */ |
| 178 | 178 | private function createCloner(ClassMetadata $classMetadata, EntityPersister $entityPersister) |
| 179 | 179 | { |
| 180 | - return function (BaseProxy $proxy) use ($entityPersister, $classMetadata) { |
|
| 180 | + return function(BaseProxy $proxy) use ($entityPersister, $classMetadata) { |
|
| 181 | 181 | if ($proxy->__isInitialized()) { |
| 182 | 182 | return; |
| 183 | 183 | } |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | |
| 45 | 45 | /** |
| 46 | 46 | * @param PathExpression $pathExpression |
| 47 | - * @param InputParameter|ArithmeticExpression|null $newValue |
|
| 47 | + * @param ArithmeticExpression|null $newValue |
|
| 48 | 48 | */ |
| 49 | 49 | public function __construct($pathExpression, $newValue) |
| 50 | 50 | { |
@@ -106,8 +106,8 @@ discard block |
||
| 106 | 106 | * // u.id = ?1 |
| 107 | 107 | * $expr->eq('u.id', '?1'); |
| 108 | 108 | * |
| 109 | - * @param mixed $x Left expression. |
|
| 110 | - * @param mixed $y Right expression. |
|
| 109 | + * @param string $x Left expression. |
|
| 110 | + * @param string $y Right expression. |
|
| 111 | 111 | * |
| 112 | 112 | * @return Expr\Comparison |
| 113 | 113 | */ |
@@ -125,8 +125,8 @@ discard block |
||
| 125 | 125 | * // u.id <> ?1 |
| 126 | 126 | * $q->where($q->expr()->neq('u.id', '?1')); |
| 127 | 127 | * |
| 128 | - * @param mixed $x Left expression. |
|
| 129 | - * @param mixed $y Right expression. |
|
| 128 | + * @param string $x Left expression. |
|
| 129 | + * @param string $y Right expression. |
|
| 130 | 130 | * |
| 131 | 131 | * @return Expr\Comparison |
| 132 | 132 | */ |
@@ -436,7 +436,7 @@ discard block |
||
| 436 | 436 | * Creates an IN() expression with the given arguments. |
| 437 | 437 | * |
| 438 | 438 | * @param string $x Field in string format to be restricted by IN() function. |
| 439 | - * @param mixed $y Argument to be used in IN() function. |
|
| 439 | + * @param string $y Argument to be used in IN() function. |
|
| 440 | 440 | * |
| 441 | 441 | * @return Expr\Func |
| 442 | 442 | */ |
@@ -457,7 +457,7 @@ discard block |
||
| 457 | 457 | * Creates a NOT IN() expression with the given arguments. |
| 458 | 458 | * |
| 459 | 459 | * @param string $x Field in string format to be restricted by NOT IN() function. |
| 460 | - * @param mixed $y Argument to be used in NOT IN() function. |
|
| 460 | + * @param string $y Argument to be used in NOT IN() function. |
|
| 461 | 461 | * |
| 462 | 462 | * @return Expr\Func |
| 463 | 463 | */ |
@@ -502,7 +502,7 @@ discard block |
||
| 502 | 502 | * Creates a LIKE() comparison expression with the given arguments. |
| 503 | 503 | * |
| 504 | 504 | * @param string $x Field in string format to be inspected by LIKE() comparison. |
| 505 | - * @param mixed $y Argument to be used in LIKE() comparison. |
|
| 505 | + * @param string $y Argument to be used in LIKE() comparison. |
|
| 506 | 506 | * |
| 507 | 507 | * @return Expr\Comparison |
| 508 | 508 | */ |
@@ -528,7 +528,6 @@ discard block |
||
| 528 | 528 | * Creates a CONCAT() function expression with the given arguments. |
| 529 | 529 | * |
| 530 | 530 | * @param mixed $x First argument to be used in CONCAT() function. |
| 531 | - * @param mixed $y,... Other arguments to be used in CONCAT() function. |
|
| 532 | 531 | * |
| 533 | 532 | * @return Expr\Func |
| 534 | 533 | */ |
@@ -629,7 +628,7 @@ discard block |
||
| 629 | 628 | * @param integer $x Starting range value to be used in BETWEEN() function. |
| 630 | 629 | * @param integer $y End point value to be used in BETWEEN() function. |
| 631 | 630 | * |
| 632 | - * @return Expr\Func A BETWEEN expression. |
|
| 631 | + * @return string A BETWEEN expression. |
|
| 633 | 632 | */ |
| 634 | 633 | public function between($val, $x, $y) |
| 635 | 634 | { |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | */ |
| 269 | 269 | public function countDistinct($x) |
| 270 | 270 | { |
| 271 | - return 'COUNT(DISTINCT ' . implode(', ', func_get_args()) . ')'; |
|
| 271 | + return 'COUNT(DISTINCT '.implode(', ', func_get_args()).')'; |
|
| 272 | 272 | } |
| 273 | 273 | |
| 274 | 274 | /** |
@@ -450,7 +450,7 @@ discard block |
||
| 450 | 450 | } |
| 451 | 451 | } |
| 452 | 452 | |
| 453 | - return new Expr\Func($x . ' IN', (array) $y); |
|
| 453 | + return new Expr\Func($x.' IN', (array) $y); |
|
| 454 | 454 | } |
| 455 | 455 | |
| 456 | 456 | /** |
@@ -471,7 +471,7 @@ discard block |
||
| 471 | 471 | } |
| 472 | 472 | } |
| 473 | 473 | |
| 474 | - return new Expr\Func($x . ' NOT IN', (array) $y); |
|
| 474 | + return new Expr\Func($x.' NOT IN', (array) $y); |
|
| 475 | 475 | } |
| 476 | 476 | |
| 477 | 477 | /** |
@@ -483,7 +483,7 @@ discard block |
||
| 483 | 483 | */ |
| 484 | 484 | public function isNull($x) |
| 485 | 485 | { |
| 486 | - return $x . ' IS NULL'; |
|
| 486 | + return $x.' IS NULL'; |
|
| 487 | 487 | } |
| 488 | 488 | |
| 489 | 489 | /** |
@@ -495,7 +495,7 @@ discard block |
||
| 495 | 495 | */ |
| 496 | 496 | public function isNotNull($x) |
| 497 | 497 | { |
| 498 | - return $x . ' IS NOT NULL'; |
|
| 498 | + return $x.' IS NOT NULL'; |
|
| 499 | 499 | } |
| 500 | 500 | |
| 501 | 501 | /** |
@@ -613,12 +613,12 @@ discard block |
||
| 613 | 613 | */ |
| 614 | 614 | private function _quoteLiteral($literal) |
| 615 | 615 | { |
| 616 | - if (is_numeric($literal) && !is_string($literal)) { |
|
| 616 | + if (is_numeric($literal) && ! is_string($literal)) { |
|
| 617 | 617 | return (string) $literal; |
| 618 | 618 | } else if (is_bool($literal)) { |
| 619 | 619 | return $literal ? "true" : "false"; |
| 620 | 620 | } else { |
| 621 | - return "'" . str_replace("'", "''", $literal) . "'"; |
|
| 621 | + return "'".str_replace("'", "''", $literal)."'"; |
|
| 622 | 622 | } |
| 623 | 623 | } |
| 624 | 624 | |
@@ -633,7 +633,7 @@ discard block |
||
| 633 | 633 | */ |
| 634 | 634 | public function between($val, $x, $y) |
| 635 | 635 | { |
| 636 | - return $val . ' BETWEEN ' . $x . ' AND ' . $y; |
|
| 636 | + return $val.' BETWEEN '.$x.' AND '.$y; |
|
| 637 | 637 | } |
| 638 | 638 | |
| 639 | 639 | /** |
@@ -412,7 +412,7 @@ discard block |
||
| 412 | 412 | * declarations (from ... x join ... y join ... z ...) appear in the query |
| 413 | 413 | * as the hydration process relies on that order for proper operation. |
| 414 | 414 | * |
| 415 | - * @param AST\SelectStatement|AST\DeleteStatement|AST\UpdateStatement $AST |
|
| 415 | + * @param AST\SelectStatement $AST |
|
| 416 | 416 | * |
| 417 | 417 | * @return void |
| 418 | 418 | */ |
@@ -748,7 +748,7 @@ discard block |
||
| 748 | 748 | * SingleValuedAssociationPathExpression ::= IdentificationVariable "." SingleValuedAssociationField |
| 749 | 749 | * CollectionValuedPathExpression ::= IdentificationVariable "." CollectionValuedAssociationField |
| 750 | 750 | * |
| 751 | - * @param mixed $AST |
|
| 751 | + * @param AST\SelectStatement $AST |
|
| 752 | 752 | * |
| 753 | 753 | * @return void |
| 754 | 754 | */ |
@@ -1622,7 +1622,7 @@ discard block |
||
| 1622 | 1622 | * accessible is "FROM", prohibiting an easy implementation without larger |
| 1623 | 1623 | * changes.} |
| 1624 | 1624 | * |
| 1625 | - * @return \Doctrine\ORM\Query\AST\SubselectIdentificationVariableDeclaration | |
|
| 1625 | + * @return AST\IdentificationVariableDeclaration | |
|
| 1626 | 1626 | * \Doctrine\ORM\Query\AST\IdentificationVariableDeclaration |
| 1627 | 1627 | */ |
| 1628 | 1628 | public function SubselectIdentificationVariableDeclaration() |
@@ -1760,7 +1760,7 @@ discard block |
||
| 1760 | 1760 | /** |
| 1761 | 1761 | * JoinAssociationDeclaration ::= JoinAssociationPathExpression ["AS"] AliasIdentificationVariable [IndexBy] |
| 1762 | 1762 | * |
| 1763 | - * @return \Doctrine\ORM\Query\AST\JoinAssociationPathExpression |
|
| 1763 | + * @return AST\JoinAssociationDeclaration |
|
| 1764 | 1764 | */ |
| 1765 | 1765 | public function JoinAssociationDeclaration() |
| 1766 | 1766 | { |
@@ -1798,7 +1798,7 @@ discard block |
||
| 1798 | 1798 | * PartialObjectExpression ::= "PARTIAL" IdentificationVariable "." PartialFieldSet |
| 1799 | 1799 | * PartialFieldSet ::= "{" SimpleStateField {"," SimpleStateField}* "}" |
| 1800 | 1800 | * |
| 1801 | - * @return array |
|
| 1801 | + * @return AST\PartialObjectExpression |
|
| 1802 | 1802 | */ |
| 1803 | 1803 | public function PartialObjectExpression() |
| 1804 | 1804 | { |
@@ -2877,7 +2877,7 @@ discard block |
||
| 2877 | 2877 | /** |
| 2878 | 2878 | * StringExpression ::= StringPrimary | ResultVariable | "(" Subselect ")" |
| 2879 | 2879 | * |
| 2880 | - * @return \Doctrine\ORM\Query\AST\StringPrimary | |
|
| 2880 | + * @return null|AST\Node | |
|
| 2881 | 2881 | * \Doctrine\ORM\Query\AST\Subselect | |
| 2882 | 2882 | * string |
| 2883 | 2883 | */ |
@@ -396,7 +396,7 @@ discard block |
||
| 396 | 396 | $this->queryComponents = $treeWalkerChain->getQueryComponents(); |
| 397 | 397 | } |
| 398 | 398 | |
| 399 | - $outputWalkerClass = $this->customOutputWalker ?: __NAMESPACE__ . '\SqlWalker'; |
|
| 399 | + $outputWalkerClass = $this->customOutputWalker ?: __NAMESPACE__.'\SqlWalker'; |
|
| 400 | 400 | $outputWalker = new $outputWalkerClass($this->query, $this->parserResult, $this->queryComponents); |
| 401 | 401 | |
| 402 | 402 | // Assign an SQL executor to the parser result |
@@ -491,7 +491,7 @@ discard block |
||
| 491 | 491 | $tokenStr = substr($dql, $token['position'], $length); |
| 492 | 492 | |
| 493 | 493 | // Building informative message |
| 494 | - $message = 'line 0, col ' . $tokenPos . " near '" . $tokenStr . "': Error: " . $message; |
|
| 494 | + $message = 'line 0, col '.$tokenPos." near '".$tokenStr."': Error: ".$message; |
|
| 495 | 495 | |
| 496 | 496 | throw QueryException::semanticalError($message, QueryException::dqlError($this->query->getDQL())); |
| 497 | 497 | } |
@@ -638,7 +638,7 @@ discard block |
||
| 638 | 638 | // If the namespace is not given then assumes the first FROM entity namespace |
| 639 | 639 | if (strpos($className, '\\') === false && ! class_exists($className) && strpos($fromClassName, '\\') !== false) { |
| 640 | 640 | $namespace = substr($fromClassName, 0, strrpos($fromClassName, '\\')); |
| 641 | - $fqcn = $namespace . '\\' . $className; |
|
| 641 | + $fqcn = $namespace.'\\'.$className; |
|
| 642 | 642 | |
| 643 | 643 | if (class_exists($fqcn)) { |
| 644 | 644 | $expression->className = $fqcn; |
@@ -690,13 +690,13 @@ discard block |
||
| 690 | 690 | } |
| 691 | 691 | |
| 692 | 692 | $this->semanticalError( |
| 693 | - "There is no mapped field named '$field' on class " . $class->name . ".", $deferredItem['token'] |
|
| 693 | + "There is no mapped field named '$field' on class ".$class->name.".", $deferredItem['token'] |
|
| 694 | 694 | ); |
| 695 | 695 | } |
| 696 | 696 | |
| 697 | 697 | if (array_intersect($class->identifier, $expr->partialFieldSet) != $class->identifier) { |
| 698 | 698 | $this->semanticalError( |
| 699 | - "The partial field selection of class " . $class->name . " must contain the identifier.", |
|
| 699 | + "The partial field selection of class ".$class->name." must contain the identifier.", |
|
| 700 | 700 | $deferredItem['token'] |
| 701 | 701 | ); |
| 702 | 702 | } |
@@ -767,7 +767,7 @@ discard block |
||
| 767 | 767 | // Check if field or association exists |
| 768 | 768 | if ( ! isset($class->associationMappings[$field]) && ! isset($class->fieldMappings[$field])) { |
| 769 | 769 | $this->semanticalError( |
| 770 | - 'Class ' . $class->name . ' has no field or association named ' . $field, |
|
| 770 | + 'Class '.$class->name.' has no field or association named '.$field, |
|
| 771 | 771 | $deferredItem['token'] |
| 772 | 772 | ); |
| 773 | 773 | } |
@@ -807,8 +807,8 @@ discard block |
||
| 807 | 807 | // Build the error message |
| 808 | 808 | $semanticalError = 'Invalid PathExpression. '; |
| 809 | 809 | $semanticalError .= (count($expectedStringTypes) == 1) |
| 810 | - ? 'Must be a ' . $expectedStringTypes[0] . '.' |
|
| 811 | - : implode(' or ', $expectedStringTypes) . ' expected.'; |
|
| 810 | + ? 'Must be a '.$expectedStringTypes[0].'.' |
|
| 811 | + : implode(' or ', $expectedStringTypes).' expected.'; |
|
| 812 | 812 | |
| 813 | 813 | $this->semanticalError($semanticalError, $deferredItem['token']); |
| 814 | 814 | } |
@@ -981,7 +981,7 @@ discard block |
||
| 981 | 981 | |
| 982 | 982 | list($namespaceAlias, $simpleClassName) = explode(':', $this->lexer->token['value']); |
| 983 | 983 | |
| 984 | - $schemaName = $this->em->getConfiguration()->getEntityNamespace($namespaceAlias) . '\\' . $simpleClassName; |
|
| 984 | + $schemaName = $this->em->getConfiguration()->getEntityNamespace($namespaceAlias).'\\'.$simpleClassName; |
|
| 985 | 985 | } |
| 986 | 986 | |
| 987 | 987 | return $schemaName; |
@@ -996,7 +996,7 @@ discard block |
||
| 996 | 996 | */ |
| 997 | 997 | private function validateAbstractSchemaName($schemaName) |
| 998 | 998 | { |
| 999 | - if (! (class_exists($schemaName, true) || interface_exists($schemaName, true))) { |
|
| 999 | + if ( ! (class_exists($schemaName, true) || interface_exists($schemaName, true))) { |
|
| 1000 | 1000 | $this->semanticalError("Class '$schemaName' is not defined.", $this->lexer->token); |
| 1001 | 1001 | } |
| 1002 | 1002 | } |
@@ -1052,7 +1052,7 @@ discard block |
||
| 1052 | 1052 | |
| 1053 | 1053 | if ( ! isset($this->queryComponents[$identVariable])) { |
| 1054 | 1054 | $this->semanticalError( |
| 1055 | - 'Identification Variable ' . $identVariable .' used in join path expression but was not defined before.' |
|
| 1055 | + 'Identification Variable '.$identVariable.' used in join path expression but was not defined before.' |
|
| 1056 | 1056 | ); |
| 1057 | 1057 | } |
| 1058 | 1058 | |
@@ -1066,7 +1066,7 @@ discard block |
||
| 1066 | 1066 | $class = $qComp['metadata']; |
| 1067 | 1067 | |
| 1068 | 1068 | if ( ! $class->hasAssociation($field)) { |
| 1069 | - $this->semanticalError('Class ' . $class->name . ' has no association named ' . $field); |
|
| 1069 | + $this->semanticalError('Class '.$class->name.' has no association named '.$field); |
|
| 1070 | 1070 | } |
| 1071 | 1071 | |
| 1072 | 1072 | return new AST\JoinAssociationPathExpression($identVariable, $field); |
@@ -2488,7 +2488,7 @@ discard block |
||
| 2488 | 2488 | // Peek beyond the matching closing parenthesis ')' |
| 2489 | 2489 | $peek = $this->peekBeyondClosingParenthesis(); |
| 2490 | 2490 | |
| 2491 | - if (in_array($peek['value'], array("=", "<", "<=", "<>", ">", ">=", "!=")) || |
|
| 2491 | + if (in_array($peek['value'], array("=", "<", "<=", "<>", ">", ">=", "!=")) || |
|
| 2492 | 2492 | in_array($peek['type'], array(Lexer::T_NOT, Lexer::T_BETWEEN, Lexer::T_LIKE, Lexer::T_IN, Lexer::T_IS, Lexer::T_EXISTS)) || |
| 2493 | 2493 | $this->isMathOperator($peek)) { |
| 2494 | 2494 | $condPrimary->simpleConditionalExpression = $this->SimpleConditionalExpression(); |
@@ -2593,7 +2593,7 @@ discard block |
||
| 2593 | 2593 | return $this->NullComparisonExpression(); |
| 2594 | 2594 | } |
| 2595 | 2595 | |
| 2596 | - if ($token['type'] === Lexer::T_IS && $lookahead['type'] === Lexer::T_EMPTY) { |
|
| 2596 | + if ($token['type'] === Lexer::T_IS && $lookahead['type'] === Lexer::T_EMPTY) { |
|
| 2597 | 2597 | return $this->EmptyCollectionComparisonExpression(); |
| 2598 | 2598 | } |
| 2599 | 2599 | |
@@ -20,7 +20,6 @@ |
||
| 20 | 20 | namespace Doctrine\ORM\Query; |
| 21 | 21 | |
| 22 | 22 | use Doctrine\Common\Collections\ArrayCollection; |
| 23 | - |
|
| 24 | 23 | use Doctrine\Common\Collections\Expr\ExpressionVisitor; |
| 25 | 24 | use Doctrine\Common\Collections\Expr\Comparison; |
| 26 | 25 | use Doctrine\Common\Collections\Expr\CompositeExpression; |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | $expressionList[] = $this->dispatch($child); |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | - switch($expr->getType()) { |
|
| 117 | + switch ($expr->getType()) { |
|
| 118 | 118 | case CompositeExpression::TYPE_AND: |
| 119 | 119 | return new Expr\Andx($expressionList); |
| 120 | 120 | |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | return new Expr\Orx($expressionList); |
| 123 | 123 | |
| 124 | 124 | default: |
| 125 | - throw new \RuntimeException("Unknown composite " . $expr->getType()); |
|
| 125 | + throw new \RuntimeException("Unknown composite ".$expr->getType()); |
|
| 126 | 126 | } |
| 127 | 127 | } |
| 128 | 128 | |
@@ -136,10 +136,10 @@ discard block |
||
| 136 | 136 | throw new QueryException('No aliases are set before invoking walkComparison().'); |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | - $field = $this->queryAliases[0] . '.' . $comparison->getField(); |
|
| 139 | + $field = $this->queryAliases[0].'.'.$comparison->getField(); |
|
| 140 | 140 | |
| 141 | - foreach($this->queryAliases as $alias) { |
|
| 142 | - if(strpos($comparison->getField() . '.', $alias . '.') === 0) { |
|
| 141 | + foreach ($this->queryAliases as $alias) { |
|
| 142 | + if (strpos($comparison->getField().'.', $alias.'.') === 0) { |
|
| 143 | 143 | $field = $comparison->getField(); |
| 144 | 144 | break; |
| 145 | 145 | } |
@@ -149,13 +149,13 @@ discard block |
||
| 149 | 149 | |
| 150 | 150 | foreach ($this->parameters as $parameter) { |
| 151 | 151 | if ($parameter->getName() === $parameterName) { |
| 152 | - $parameterName .= '_' . count($this->parameters); |
|
| 152 | + $parameterName .= '_'.count($this->parameters); |
|
| 153 | 153 | break; |
| 154 | 154 | } |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | $parameter = new Parameter($parameterName, $this->walkValue($comparison->getValue())); |
| 158 | - $placeholder = ':' . $parameterName; |
|
| 158 | + $placeholder = ':'.$parameterName; |
|
| 159 | 159 | |
| 160 | 160 | switch ($comparison->getOperator()) { |
| 161 | 161 | case Comparison::IN: |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | |
| 183 | 183 | return $this->expr->neq($field, $placeholder); |
| 184 | 184 | case Comparison::CONTAINS: |
| 185 | - $parameter->setValue('%' . $parameter->getValue() . '%', $parameter->getType()); |
|
| 185 | + $parameter->setValue('%'.$parameter->getValue().'%', $parameter->getType()); |
|
| 186 | 186 | $this->parameters[] = $parameter; |
| 187 | 187 | |
| 188 | 188 | return $this->expr->like($field, $placeholder); |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | ); |
| 199 | 199 | } |
| 200 | 200 | |
| 201 | - throw new \RuntimeException("Unknown comparison operator: " . $comparison->getOperator()); |
|
| 201 | + throw new \RuntimeException("Unknown comparison operator: ".$comparison->getOperator()); |
|
| 202 | 202 | } |
| 203 | 203 | } |
| 204 | 204 | |
@@ -389,7 +389,7 @@ |
||
| 389 | 389 | /** |
| 390 | 390 | * Adds a metadata parameter mappings. |
| 391 | 391 | * |
| 392 | - * @param mixed $parameter The parameter name in the SQL result set. |
|
| 392 | + * @param string $parameter The parameter name in the SQL result set. |
|
| 393 | 393 | * @param string $attribute The metadata attribute. |
| 394 | 394 | */ |
| 395 | 395 | public function addMetadataParameterMapping($parameter, $attribute) |
@@ -227,7 +227,9 @@ |
||
| 227 | 227 | $found = false; |
| 228 | 228 | |
| 229 | 229 | foreach (array_merge($this->metaMappings, $this->fieldMappings) as $columnName => $columnFieldName) { |
| 230 | - if ( ! ($columnFieldName === $fieldName && $this->columnOwnerMap[$columnName] === $alias)) continue; |
|
| 230 | + if ( ! ($columnFieldName === $fieldName && $this->columnOwnerMap[$columnName] === $alias)) { |
|
| 231 | + continue; |
|
| 232 | + } |
|
| 231 | 233 | |
| 232 | 234 | $this->addIndexByColumn($alias, $columnName); |
| 233 | 235 | $found = true; |