Skip to content

Commit 212707f

Browse files
committed
Container::getControls() does not use deprecated parameters
1 parent d5968dd commit 212707f

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
@@ -287,9 +287,15 @@ public function addComponent(
287287
/**
288288
* Iterates over all form controls.
289289
*/
290-
public function getControls(): \Iterator
290+
public function getControls(): iterable
291291
{
292-
return $this->getComponents(true, Control::class);
292+
return Nette\Utils\Iterables::repeatable(function () {
293+
foreach ($this->getComponentTree() as $component) {
294+
if ($component instanceof Control) {
295+
yield $component->getName() => $component;
296+
}
297+
}
298+
});
293299
}
294300

295301

0 commit comments

Comments
 (0)