From 40af42cb60d1863e834ee3bb563751462ddd1819 Mon Sep 17 00:00:00 2001 From: Sergio Santoro Date: Wed, 21 Sep 2016 21:25:41 +0200 Subject: [PATCH] [Form] FormView->isRendered() remove dead code and simplify the flow --- src/Symfony/Component/Form/FormView.php | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/Symfony/Component/Form/FormView.php b/src/Symfony/Component/Form/FormView.php index 4992833e4b..401288cf83 100644 --- a/src/Symfony/Component/Form/FormView.php +++ b/src/Symfony/Component/Form/FormView.php @@ -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; } /**