From c98f9117c28567c4c83ad0d34b07a58fa77e99d5 Mon Sep 17 00:00:00 2001 From: Olivier Dolbeau Date: Tue, 5 Jun 2012 15:39:52 +0200 Subject: [PATCH 1/3] Remove unused use --- lib/Doctrine/ORM/Id/AssignedGenerator.php | 1 - lib/Doctrine/ORM/Internal/Hydration/ScalarHydrator.php | 2 -- lib/Doctrine/ORM/Query/AST/Functions/DateSubFunction.php | 2 -- lib/Doctrine/ORM/Tools/Console/Command/InfoCommand.php | 1 - 4 files changed, 6 deletions(-) diff --git a/lib/Doctrine/ORM/Id/AssignedGenerator.php b/lib/Doctrine/ORM/Id/AssignedGenerator.php index 1f5f21a2c..0597c3bc6 100644 --- a/lib/Doctrine/ORM/Id/AssignedGenerator.php +++ b/lib/Doctrine/ORM/Id/AssignedGenerator.php @@ -20,7 +20,6 @@ namespace Doctrine\ORM\Id; use Doctrine\ORM\EntityManager; -use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\ORMException; /** diff --git a/lib/Doctrine/ORM/Internal/Hydration/ScalarHydrator.php b/lib/Doctrine/ORM/Internal/Hydration/ScalarHydrator.php index eadde7296..23b0abe2c 100644 --- a/lib/Doctrine/ORM/Internal/Hydration/ScalarHydrator.php +++ b/lib/Doctrine/ORM/Internal/Hydration/ScalarHydrator.php @@ -19,8 +19,6 @@ namespace Doctrine\ORM\Internal\Hydration; -use Doctrine\DBAL\Connection; - /** * Hydrator that produces flat, rectangular results of scalar data. * The created result is almost the same as a regular SQL result set, except diff --git a/lib/Doctrine/ORM/Query/AST/Functions/DateSubFunction.php b/lib/Doctrine/ORM/Query/AST/Functions/DateSubFunction.php index d640cd0a7..0cc073096 100644 --- a/lib/Doctrine/ORM/Query/AST/Functions/DateSubFunction.php +++ b/lib/Doctrine/ORM/Query/AST/Functions/DateSubFunction.php @@ -19,9 +19,7 @@ namespace Doctrine\ORM\Query\AST\Functions; -use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\SqlWalker; -use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\QueryException; /** diff --git a/lib/Doctrine/ORM/Tools/Console/Command/InfoCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/InfoCommand.php index 61dc571c9..5494d71f3 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/InfoCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/InfoCommand.php @@ -20,7 +20,6 @@ namespace Doctrine\ORM\Tools\Console\Command; use Doctrine\ORM\Mapping\MappingException; -use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Command\Command; From 7ca0ac289e95fbbffab8ef3ec93bcabd1fe603f0 Mon Sep 17 00:00:00 2001 From: Olivier Dolbeau Date: Tue, 5 Jun 2012 15:40:44 +0200 Subject: [PATCH 2/3] Remove tabs & trailing spaces --- lib/Doctrine/ORM/Event/PreUpdateEventArgs.php | 4 ++-- lib/Doctrine/ORM/Internal/Hydration/ArrayHydrator.php | 2 +- lib/Doctrine/ORM/Query.php | 4 ++-- lib/Doctrine/ORM/Query/SqlWalker.php | 6 +++--- lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryWalker.php | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/Doctrine/ORM/Event/PreUpdateEventArgs.php b/lib/Doctrine/ORM/Event/PreUpdateEventArgs.php index 566087fc0..657b8b180 100644 --- a/lib/Doctrine/ORM/Event/PreUpdateEventArgs.php +++ b/lib/Doctrine/ORM/Event/PreUpdateEventArgs.php @@ -81,7 +81,7 @@ class PreUpdateEventArgs extends LifecycleEventArgs */ public function getOldValue($field) { - $this->assertValidField($field); + $this->assertValidField($field); return $this->entityChangeSet[$field][0]; } @@ -119,7 +119,7 @@ class PreUpdateEventArgs extends LifecycleEventArgs */ private function assertValidField($field) { - if ( ! isset($this->entityChangeSet[$field])) { + if ( ! isset($this->entityChangeSet[$field])) { throw new \InvalidArgumentException(sprintf( 'Field "%s" is not a valid field of the entity "%s" in PreUpdateEventArgs.', $field, diff --git a/lib/Doctrine/ORM/Internal/Hydration/ArrayHydrator.php b/lib/Doctrine/ORM/Internal/Hydration/ArrayHydrator.php index 2a37f9df5..df4682f1a 100644 --- a/lib/Doctrine/ORM/Internal/Hydration/ArrayHydrator.php +++ b/lib/Doctrine/ORM/Internal/Hydration/ArrayHydrator.php @@ -111,7 +111,7 @@ class ArrayHydrator extends AbstractHydrator // Get a reference to the right element in the result tree. // This element will get the associated element attached. if ($this->_rsm->isMixed && isset($this->_rootAliases[$parent])) { - $first = reset($this->_resultPointers); + $first = reset($this->_resultPointers); // TODO: Exception if $key === null ? $baseElement =& $this->_resultPointers[$parent][key($first)]; } else if (isset($this->_resultPointers[$parent])) { diff --git a/lib/Doctrine/ORM/Query.php b/lib/Doctrine/ORM/Query.php index 0255fc06b..aaf9c55fb 100644 --- a/lib/Doctrine/ORM/Query.php +++ b/lib/Doctrine/ORM/Query.php @@ -347,8 +347,8 @@ final class Query extends AbstractQuery /** * Returns the cache driver used for query caching. * - * @return CacheDriver The cache driver used for query caching or NULL, if this - * Query does not use query caching. + * @return CacheDriver The cache driver used for query caching or NULL, if + * this Query does not use query caching. */ public function getQueryCacheDriver() { diff --git a/lib/Doctrine/ORM/Query/SqlWalker.php b/lib/Doctrine/ORM/Query/SqlWalker.php index 2bef079ae..422f703a6 100644 --- a/lib/Doctrine/ORM/Query/SqlWalker.php +++ b/lib/Doctrine/ORM/Query/SqlWalker.php @@ -1852,7 +1852,7 @@ class SqlWalker implements TreeWalker $dqlAlias = $instanceOfExpr->identificationVariable; $discrClass = $class = $this->_queryComponents[$dqlAlias]['metadata']; - + if ($class->discriminatorColumn) { $discrClass = $this->_em->getClassMetadata($class->rootEntityName); } @@ -2046,8 +2046,8 @@ class SqlWalker implements TreeWalker public function walkArithmeticExpression($arithmeticExpr) { return ($arithmeticExpr->isSimpleArithmeticExpression()) - ? $this->walkSimpleArithmeticExpression($arithmeticExpr->simpleArithmeticExpression) - : '(' . $this->walkSubselect($arithmeticExpr->subselect) . ')'; + ? $this->walkSimpleArithmeticExpression($arithmeticExpr->simpleArithmeticExpression) + : '(' . $this->walkSubselect($arithmeticExpr->subselect) . ')'; } /** diff --git a/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryWalker.php b/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryWalker.php index 86ee5dd97..1ae74f437 100644 --- a/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryWalker.php +++ b/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryWalker.php @@ -104,7 +104,7 @@ class LimitSubqueryWalker extends TreeWalkerAdapter $pathExpression->type = PathExpression::TYPE_STATE_FIELD; $AST->selectClause->selectExpressions[] = new SelectExpression( $pathExpression, - '_dctrn_ord' . $this->_aliasCounter++ + '_dctrn_ord' . $this->_aliasCounter++ ); } } From 79a9ce5000e1b05fd62a4c664c96f9cc9a932025 Mon Sep 17 00:00:00 2001 From: Olivier Dolbeau Date: Tue, 5 Jun 2012 21:32:53 +0200 Subject: [PATCH 3/3] Add some corrections --- lib/Doctrine/ORM/Internal/Hydration/ArrayHydrator.php | 2 +- lib/Doctrine/ORM/Query.php | 2 +- lib/Doctrine/ORM/Query/SqlWalker.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Doctrine/ORM/Internal/Hydration/ArrayHydrator.php b/lib/Doctrine/ORM/Internal/Hydration/ArrayHydrator.php index df4682f1a..8f7178e99 100644 --- a/lib/Doctrine/ORM/Internal/Hydration/ArrayHydrator.php +++ b/lib/Doctrine/ORM/Internal/Hydration/ArrayHydrator.php @@ -111,7 +111,7 @@ class ArrayHydrator extends AbstractHydrator // Get a reference to the right element in the result tree. // This element will get the associated element attached. if ($this->_rsm->isMixed && isset($this->_rootAliases[$parent])) { - $first = reset($this->_resultPointers); + $first = reset($this->_resultPointers); // TODO: Exception if $key === null ? $baseElement =& $this->_resultPointers[$parent][key($first)]; } else if (isset($this->_resultPointers[$parent])) { diff --git a/lib/Doctrine/ORM/Query.php b/lib/Doctrine/ORM/Query.php index aaf9c55fb..2e1b8178b 100644 --- a/lib/Doctrine/ORM/Query.php +++ b/lib/Doctrine/ORM/Query.php @@ -348,7 +348,7 @@ final class Query extends AbstractQuery * Returns the cache driver used for query caching. * * @return CacheDriver The cache driver used for query caching or NULL, if - * this Query does not use query caching. + * this Query does not use query caching. */ public function getQueryCacheDriver() { diff --git a/lib/Doctrine/ORM/Query/SqlWalker.php b/lib/Doctrine/ORM/Query/SqlWalker.php index 422f703a6..8412025fa 100644 --- a/lib/Doctrine/ORM/Query/SqlWalker.php +++ b/lib/Doctrine/ORM/Query/SqlWalker.php @@ -2046,8 +2046,8 @@ class SqlWalker implements TreeWalker public function walkArithmeticExpression($arithmeticExpr) { return ($arithmeticExpr->isSimpleArithmeticExpression()) - ? $this->walkSimpleArithmeticExpression($arithmeticExpr->simpleArithmeticExpression) - : '(' . $this->walkSubselect($arithmeticExpr->subselect) . ')'; + ? $this->walkSimpleArithmeticExpression($arithmeticExpr->simpleArithmeticExpression) + : '(' . $this->walkSubselect($arithmeticExpr->subselect) . ')'; } /**