Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code cleanups: early return/internal function usage #5910

Merged
merged 2 commits into from
Jun 30, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -583,10 +583,7 @@ public function onClear($eventArgs)
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, []);
}
}
8 changes: 2 additions & 6 deletions lib/Doctrine/ORM/Query/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -827,17 +827,13 @@ private function processRootEntityAliasSelected()
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.');
}

/**
Expand Down