Merge pull request #5910 from ReenExeContributor/clear-code
Code cleanups: early return/internal function usage
This commit is contained in:
commit
ffd1465af2
@ -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, []);
|
||||
}
|
||||
}
|
||||
|
@ -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.');
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user