[Form] FormView->isRendered() remove dead code and simplify the flow

This commit is contained in:
Sergio Santoro 2016-09-21 21:25:41 +02:00
parent bb51ed0d20
commit 40af42cb60
1 changed files with 5 additions and 11 deletions

View File

@ -65,23 +65,17 @@ class FormView implements \ArrayAccess, \IteratorAggregate, \Countable
*/
public function isRendered()
{
$hasChildren = 0 < count($this->children);
if (true === $this->rendered || !$hasChildren) {
if (true === $this->rendered || 0 === count($this->children)) {
return $this->rendered;
}
if ($hasChildren) {
foreach ($this->children as $child) {
if (!$child->isRendered()) {
return false;
}
foreach ($this->children as $child) {
if (!$child->isRendered()) {
return false;
}
return $this->rendered = true;
}
return false;
return $this->rendered = true;
}
/**