@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | $sql = $type->convertToPHPValueSQL($sql, $this->platform); |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | - return $sql . ' AS ' . $columnAlias; |
|
| 79 | + return $sql.' AS '.$columnAlias; |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | /** |
@@ -93,6 +93,6 @@ discard block |
||
| 93 | 93 | |
| 94 | 94 | $this->currentPersisterContext->rsm->addMetaResult('r', $columnAlias, $joinColumnName, false, $type); |
| 95 | 95 | |
| 96 | - return $tableAlias . '.' . $joinColumnName . ' AS ' . $columnAlias; |
|
| 96 | + return $tableAlias.'.'.$joinColumnName.' AS '.$columnAlias; |
|
| 97 | 97 | } |
| 98 | 98 | } |
@@ -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); |
@@ -3,12 +3,10 @@ |
||
| 3 | 3 | namespace Doctrine\Tests\ORM\Cache\Persister\Entity; |
| 4 | 4 | |
| 5 | 5 | use Doctrine\Tests\OrmTestCase; |
| 6 | - |
|
| 7 | 6 | use Doctrine\ORM\Cache\Region; |
| 8 | 7 | use Doctrine\ORM\EntityManager; |
| 9 | 8 | use Doctrine\ORM\Mapping\ClassMetadata; |
| 10 | 9 | use Doctrine\ORM\Persisters\Entity\EntityPersister; |
| 11 | - |
|
| 12 | 10 | use Doctrine\Tests\Models\Cache\Country; |
| 13 | 11 | use Doctrine\Common\Collections\Criteria; |
| 14 | 12 | use Doctrine\Common\Collections\ArrayCollection; |
@@ -151,7 +151,7 @@ |
||
| 151 | 151 | */ |
| 152 | 152 | public function newDefaultAnnotationDriver($paths = array(), $useSimpleAnnotationReader = true) |
| 153 | 153 | { |
| 154 | - AnnotationRegistry::registerFile(__DIR__ . '/Mapping/Driver/DoctrineAnnotations.php'); |
|
| 154 | + AnnotationRegistry::registerFile(__DIR__.'/Mapping/Driver/DoctrineAnnotations.php'); |
|
| 155 | 155 | |
| 156 | 156 | if ($useSimpleAnnotationReader) { |
| 157 | 157 | // Register the ORM Annotations in the AnnotationRegistry |
@@ -918,7 +918,7 @@ |
||
| 918 | 918 | * @since 2.5 |
| 919 | 919 | * |
| 920 | 920 | * @param string $name The name of the hint. |
| 921 | - * @param mixed $value The value of the hint. |
|
| 921 | + * @param string $value The value of the hint. |
|
| 922 | 922 | */ |
| 923 | 923 | public function setDefaultQueryHint($name, $value) |
| 924 | 924 | { |
@@ -231,7 +231,7 @@ |
||
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | if (empty($arguments)) { |
| 234 | - throw ORMException::findByRequiresParameter($method . $by); |
|
| 234 | + throw ORMException::findByRequiresParameter($method.$by); |
|
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | $fieldName = lcfirst(\Doctrine\Common\Util\Inflector::classify($by)); |
@@ -33,6 +33,6 @@ |
||
| 33 | 33 | */ |
| 34 | 34 | public static function noDispatchForNode($node) |
| 35 | 35 | { |
| 36 | - return new self("Double-dispatch for node " . get_class($node) . " is not supported."); |
|
| 36 | + return new self("Double-dispatch for node ".get_class($node)." is not supported."); |
|
| 37 | 37 | } |
| 38 | 38 | } |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | foreach ($props as $name => $prop) { |
| 75 | 75 | $ident += 4; |
| 76 | 76 | $str .= str_repeat(' ', $ident) . '"' . $name . '": ' |
| 77 | - . $this->dump($prop) . ',' . PHP_EOL; |
|
| 77 | + . $this->dump($prop) . ',' . PHP_EOL; |
|
| 78 | 78 | $ident -= 4; |
| 79 | 79 | } |
| 80 | 80 | |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | |
| 87 | 87 | foreach ($obj as $k => $v) { |
| 88 | 88 | $str .= PHP_EOL . str_repeat(' ', $ident) . '"' |
| 89 | - . $k . '" => ' . $this->dump($v) . ','; |
|
| 89 | + . $k . '" => ' . $this->dump($v) . ','; |
|
| 90 | 90 | $some = true; |
| 91 | 91 | } |
| 92 | 92 | |
@@ -68,32 +68,32 @@ |
||
| 68 | 68 | $str = ''; |
| 69 | 69 | |
| 70 | 70 | if ($obj instanceof Node) { |
| 71 | - $str .= get_class($obj) . '(' . PHP_EOL; |
|
| 71 | + $str .= get_class($obj).'('.PHP_EOL; |
|
| 72 | 72 | $props = get_object_vars($obj); |
| 73 | 73 | |
| 74 | 74 | foreach ($props as $name => $prop) { |
| 75 | 75 | $ident += 4; |
| 76 | - $str .= str_repeat(' ', $ident) . '"' . $name . '": ' |
|
| 77 | - . $this->dump($prop) . ',' . PHP_EOL; |
|
| 76 | + $str .= str_repeat(' ', $ident).'"'.$name.'": ' |
|
| 77 | + . $this->dump($prop).','.PHP_EOL; |
|
| 78 | 78 | $ident -= 4; |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | - $str .= str_repeat(' ', $ident) . ')'; |
|
| 81 | + $str .= str_repeat(' ', $ident).')'; |
|
| 82 | 82 | } else if (is_array($obj)) { |
| 83 | 83 | $ident += 4; |
| 84 | 84 | $str .= 'array('; |
| 85 | 85 | $some = false; |
| 86 | 86 | |
| 87 | 87 | foreach ($obj as $k => $v) { |
| 88 | - $str .= PHP_EOL . str_repeat(' ', $ident) . '"' |
|
| 89 | - . $k . '" => ' . $this->dump($v) . ','; |
|
| 88 | + $str .= PHP_EOL.str_repeat(' ', $ident).'"' |
|
| 89 | + . $k.'" => '.$this->dump($v).','; |
|
| 90 | 90 | $some = true; |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | $ident -= 4; |
| 94 | - $str .= ($some ? PHP_EOL . str_repeat(' ', $ident) : '') . ')'; |
|
| 94 | + $str .= ($some ? PHP_EOL.str_repeat(' ', $ident) : '').')'; |
|
| 95 | 95 | } else if (is_object($obj)) { |
| 96 | - $str .= 'instanceof(' . get_class($obj) . ')'; |
|
| 96 | + $str .= 'instanceof('.get_class($obj).')'; |
|
| 97 | 97 | } else { |
| 98 | 98 | $str .= var_export($obj, true); |
| 99 | 99 | } |
@@ -86,9 +86,9 @@ |
||
| 86 | 86 | $tableName = $sqlWalker->getEntityManager()->getClassMetadata($assoc['sourceEntity'])->getTableName(); |
| 87 | 87 | |
| 88 | 88 | $tableAlias = $sqlWalker->getSQLTableAlias($tableName, $dqlAlias); |
| 89 | - $columnName = $quoteStrategy->getJoinColumnName($joinColumn, $targetEntity, $platform); |
|
| 89 | + $columnName = $quoteStrategy->getJoinColumnName($joinColumn, $targetEntity, $platform); |
|
| 90 | 90 | |
| 91 | - return $tableAlias . '.' . $columnName; |
|
| 91 | + return $tableAlias.'.'.$columnName; |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | /** |
@@ -70,8 +70,8 @@ discard block |
||
| 70 | 70 | if ($first) $first = false; else $sql .= ' AND '; |
| 71 | 71 | |
| 72 | 72 | $sql .= $targetTableAlias . '.' . $sourceColumn |
| 73 | - . ' = ' |
|
| 74 | - . $sourceTableAlias . '.' . $quoteStrategy->getColumnName($class->fieldNames[$targetColumn], $class, $platform); |
|
| 73 | + . ' = ' |
|
| 74 | + . $sourceTableAlias . '.' . $quoteStrategy->getColumnName($class->fieldNames[$targetColumn], $class, $platform); |
|
| 75 | 75 | } |
| 76 | 76 | } else { // many-to-many |
| 77 | 77 | $targetClass = $sqlWalker->getEntityManager()->getClassMetadata($assoc['targetEntity']); |
@@ -100,8 +100,8 @@ discard block |
||
| 100 | 100 | ); |
| 101 | 101 | |
| 102 | 102 | $sql .= $joinTableAlias . '.' . $joinColumn['name'] |
| 103 | - . ' = ' |
|
| 104 | - . $sourceTableAlias . '.' . $sourceColumnName; |
|
| 103 | + . ' = ' |
|
| 104 | + . $sourceTableAlias . '.' . $sourceColumnName; |
|
| 105 | 105 | } |
| 106 | 106 | } |
| 107 | 107 | |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | $targetTableAlias = $sqlWalker->getSQLTableAlias($targetClass->getTableName()); |
| 61 | 61 | $sourceTableAlias = $sqlWalker->getSQLTableAlias($class->getTableName(), $dqlAlias); |
| 62 | 62 | |
| 63 | - $sql .= $quoteStrategy->getTableName($targetClass, $platform) . ' ' . $targetTableAlias . ' WHERE '; |
|
| 63 | + $sql .= $quoteStrategy->getTableName($targetClass, $platform).' '.$targetTableAlias.' WHERE '; |
|
| 64 | 64 | |
| 65 | 65 | $owningAssoc = $targetClass->associationMappings[$assoc['mappedBy']]; |
| 66 | 66 | |
@@ -69,9 +69,9 @@ discard block |
||
| 69 | 69 | foreach ($owningAssoc['targetToSourceKeyColumns'] as $targetColumn => $sourceColumn) { |
| 70 | 70 | if ($first) $first = false; else $sql .= ' AND '; |
| 71 | 71 | |
| 72 | - $sql .= $targetTableAlias . '.' . $sourceColumn |
|
| 72 | + $sql .= $targetTableAlias.'.'.$sourceColumn |
|
| 73 | 73 | . ' = ' |
| 74 | - . $sourceTableAlias . '.' . $quoteStrategy->getColumnName($class->fieldNames[$targetColumn], $class, $platform); |
|
| 74 | + . $sourceTableAlias.'.'.$quoteStrategy->getColumnName($class->fieldNames[$targetColumn], $class, $platform); |
|
| 75 | 75 | } |
| 76 | 76 | } else { // many-to-many |
| 77 | 77 | $targetClass = $sqlWalker->getEntityManager()->getClassMetadata($assoc['targetEntity']); |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | $sourceTableAlias = $sqlWalker->getSQLTableAlias($class->getTableName(), $dqlAlias); |
| 85 | 85 | |
| 86 | 86 | // join to target table |
| 87 | - $sql .= $quoteStrategy->getJoinTableName($owningAssoc, $targetClass, $platform) . ' ' . $joinTableAlias . ' WHERE '; |
|
| 87 | + $sql .= $quoteStrategy->getJoinTableName($owningAssoc, $targetClass, $platform).' '.$joinTableAlias.' WHERE '; |
|
| 88 | 88 | |
| 89 | 89 | $joinColumns = $assoc['isOwningSide'] |
| 90 | 90 | ? $joinTable['joinColumns'] |
@@ -99,13 +99,13 @@ discard block |
||
| 99 | 99 | $class->fieldNames[$joinColumn['referencedColumnName']], $class, $platform |
| 100 | 100 | ); |
| 101 | 101 | |
| 102 | - $sql .= $joinTableAlias . '.' . $joinColumn['name'] |
|
| 102 | + $sql .= $joinTableAlias.'.'.$joinColumn['name'] |
|
| 103 | 103 | . ' = ' |
| 104 | - . $sourceTableAlias . '.' . $sourceColumnName; |
|
| 104 | + . $sourceTableAlias.'.'.$sourceColumnName; |
|
| 105 | 105 | } |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | - return '(' . $sql . ')'; |
|
| 108 | + return '('.$sql.')'; |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | /** |
@@ -67,7 +67,11 @@ discard block |
||
| 67 | 67 | $first = true; |
| 68 | 68 | |
| 69 | 69 | foreach ($owningAssoc['targetToSourceKeyColumns'] as $targetColumn => $sourceColumn) { |
| 70 | - if ($first) $first = false; else $sql .= ' AND '; |
|
| 70 | + if ($first) { |
|
| 71 | + $first = false; |
|
| 72 | + } else { |
|
| 73 | + $sql .= ' AND '; |
|
| 74 | + } |
|
| 71 | 75 | |
| 72 | 76 | $sql .= $targetTableAlias . '.' . $sourceColumn |
| 73 | 77 | . ' = ' |
@@ -93,7 +97,11 @@ discard block |
||
| 93 | 97 | $first = true; |
| 94 | 98 | |
| 95 | 99 | foreach ($joinColumns as $joinColumn) { |
| 96 | - if ($first) $first = false; else $sql .= ' AND '; |
|
| 100 | + if ($first) { |
|
| 101 | + $first = false; |
|
| 102 | + } else { |
|
| 103 | + $sql .= ' AND '; |
|
| 104 | + } |
|
| 97 | 105 | |
| 98 | 106 | $sourceColumnName = $quoteStrategy->getColumnName( |
| 99 | 107 | $class->fieldNames[$joinColumn['referencedColumnName']], $class, $platform |
@@ -44,9 +44,9 @@ |
||
| 44 | 44 | */ |
| 45 | 45 | public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) |
| 46 | 46 | { |
| 47 | - return 'ABS(' . $sqlWalker->walkSimpleArithmeticExpression( |
|
| 47 | + return 'ABS('.$sqlWalker->walkSimpleArithmeticExpression( |
|
| 48 | 48 | $this->simpleArithmeticExpression |
| 49 | - ) . ')'; |
|
| 49 | + ).')'; |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | /** |