Pārlūkot izejas kodu

[Form] tweaked code (closes #855)

Fabien Potencier 14 gadi atpakaļ
vecāks
revīzija
80a5074746
1 mainītis faili ar 2 papildinājumiem un 4 dzēšanām
  1. 2 4
      src/Symfony/Component/Form/FormView.php

+ 2 - 4
src/Symfony/Component/Form/FormView.php

@@ -152,13 +152,11 @@ class FormView implements \ArrayAccess, \IteratorAggregate, \Countable
 
     public function getIterator()
     {
-        if (isset($this->children)) {
+        if (count($this->children)) {
             $this->rendered = true;
-
-            return new \ArrayIterator($this->children);
         }
 
-        return new \ArrayIterator(array());
+        return new \ArrayIterator($this->children);
     }
 
     public function isChoiceGroup($choice)