Skip to content

Commit 40af42c

Browse files
committed
[Form] FormView->isRendered() remove dead code and simplify the flow
1 parent bb51ed0 commit 40af42c

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

src/Symfony/Component/Form/FormView.php

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -65,23 +65,17 @@ public function __construct(FormView $parent = null)
6565
*/
6666
public function isRendered()
6767
{
68-
$hasChildren = 0 < count($this->children);
69-
70-
if (true === $this->rendered || !$hasChildren) {
68+
if (true === $this->rendered || 0 === count($this->children)) {
7169
return $this->rendered;
7270
}
7371

74-
if ($hasChildren) {
75-
foreach ($this->children as $child) {
76-
if (!$child->isRendered()) {
77-
return false;
78-
}
72+
foreach ($this->children as $child) {
73+
if (!$child->isRendered()) {
74+
return false;
7975
}
80-
81-
return $this->rendered = true;
8276
}
8377

84-
return false;
78+
return $this->rendered = true;
8579
}
8680

8781
/**

0 commit comments

Comments
 (0)