[Form] FormView->isRendered() remove dead code and simplify the flow
This commit is contained in:
parent
bb51ed0d20
commit
40af42cb60
@ -65,13 +65,10 @@ class FormView implements \ArrayAccess, \IteratorAggregate, \Countable
|
|||||||
*/
|
*/
|
||||||
public function isRendered()
|
public function isRendered()
|
||||||
{
|
{
|
||||||
$hasChildren = 0 < count($this->children);
|
if (true === $this->rendered || 0 === count($this->children)) {
|
||||||
|
|
||||||
if (true === $this->rendered || !$hasChildren) {
|
|
||||||
return $this->rendered;
|
return $this->rendered;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($hasChildren) {
|
|
||||||
foreach ($this->children as $child) {
|
foreach ($this->children as $child) {
|
||||||
if (!$child->isRendered()) {
|
if (!$child->isRendered()) {
|
||||||
return false;
|
return false;
|
||||||
@ -81,9 +78,6 @@ class FormView implements \ArrayAccess, \IteratorAggregate, \Countable
|
|||||||
return $this->rendered = true;
|
return $this->rendered = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Marks the view as rendered.
|
* Marks the view as rendered.
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user