Skip to content

Commit 373bf54

Browse files
committed
Container::getControls() does not use deprecated parameters
1 parent 28d3228 commit 373bf54

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/Forms/Container.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,9 +282,15 @@ public function addComponent(
282282
/**
283283
* Iterates over all form controls.
284284
*/
285-
public function getControls(): \Iterator
285+
public function getControls(): iterable
286286
{
287-
return $this->getComponents(true, Control::class);
287+
return Nette\Utils\Iterables::repeatable(function () {
288+
foreach ($this->getComponentTree() as $component) {
289+
if ($component instanceof Control) {
290+
yield $component->getName() => $component;
291+
}
292+
}
293+
});
288294
}
289295

290296

0 commit comments

Comments
 (0)