From c9acf2e60c8b108b3f0a950fcceb025c6c40bf1d Mon Sep 17 00:00:00 2001 From: Eriksen Costa Date: Thu, 9 Jun 2011 12:33:42 -0300 Subject: [PATCH] [Form] minor code simplification --- src/Symfony/Component/Form/FormView.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/Form/FormView.php b/src/Symfony/Component/Form/FormView.php index 3fdf42dec4..24487fdf49 100644 --- a/src/Symfony/Component/Form/FormView.php +++ b/src/Symfony/Component/Form/FormView.php @@ -110,11 +110,13 @@ class FormView implements \ArrayAccess, \IteratorAggregate, \Countable */ public function isRendered() { - if (true === $this->rendered || 0 == count($this->children)) { + $hasChildren = 0 < count($this->children); + + if (true === $this->rendered || !$hasChildren) { return $this->rendered; } - if (count($this->children) > 0) { + if ($hasChildren) { foreach ($this->children as $child) { if (!$child->isRendered()) { return false; @@ -122,9 +124,9 @@ class FormView implements \ArrayAccess, \IteratorAggregate, \Countable } return $this->rendered = true; - } else { - return false; } + + return false; } /**