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);
|
parent::onClear($eventArgs);
|
||||||
|
|
||||||
$aliases = array_keys($this->identifierMap);
|
$aliases = array_keys($this->identifierMap);
|
||||||
$this->identifierMap = array();
|
|
||||||
|
|
||||||
foreach ($aliases as $alias) {
|
$this->identifierMap = array_fill_keys($aliases, []);
|
||||||
$this->identifierMap[$alias] = array();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -827,18 +827,14 @@ class Parser
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$foundRootEntity = false;
|
|
||||||
|
|
||||||
foreach ($this->identVariableExpressions as $dqlAlias => $expr) {
|
foreach ($this->identVariableExpressions as $dqlAlias => $expr) {
|
||||||
if (isset($this->queryComponents[$dqlAlias]) && $this->queryComponents[$dqlAlias]['parent'] === null) {
|
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.');
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* QueryLanguage ::= SelectStatement | UpdateStatement | DeleteStatement
|
* QueryLanguage ::= SelectStatement | UpdateStatement | DeleteStatement
|
||||||
|
Loading…
x
Reference in New Issue
Block a user