From 015ec444c50abc7fb3999aa815cc298243da01f6 Mon Sep 17 00:00:00 2001 From: ReenExe Date: Fri, 1 Jul 2016 01:17:25 +0300 Subject: [PATCH 1/2] use PHP common functions --- lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php b/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php index 8e45117ab..70d47655d 100644 --- a/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php +++ b/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php @@ -583,10 +583,7 @@ class ObjectHydrator extends AbstractHydrator parent::onClear($eventArgs); $aliases = array_keys($this->identifierMap); - $this->identifierMap = array(); - foreach ($aliases as $alias) { - $this->identifierMap[$alias] = array(); - } + $this->identifierMap = array_fill_keys($aliases, []); } } From 8eef0beacb5250d3776566b08f91471d04113553 Mon Sep 17 00:00:00 2001 From: ReenExe Date: Fri, 1 Jul 2016 01:20:52 +0300 Subject: [PATCH 2/2] clear code --- lib/Doctrine/ORM/Query/Parser.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/Doctrine/ORM/Query/Parser.php b/lib/Doctrine/ORM/Query/Parser.php index 7619359ce..6f8eda514 100644 --- a/lib/Doctrine/ORM/Query/Parser.php +++ b/lib/Doctrine/ORM/Query/Parser.php @@ -827,17 +827,13 @@ class Parser return; } - $foundRootEntity = false; - foreach ($this->identVariableExpressions as $dqlAlias => $expr) { if (isset($this->queryComponents[$dqlAlias]) && $this->queryComponents[$dqlAlias]['parent'] === null) { - $foundRootEntity = true; + return; } } - if ( ! $foundRootEntity) { - $this->semanticalError('Cannot select entity through identification variables without choosing at least one root entity alias.'); - } + $this->semanticalError('Cannot select entity through identification variables without choosing at least one root entity alias.'); } /**