Skip to content

Commit 2f13b44

Browse files
committed
Container::getControls() does not use deprecated parameters
1 parent 1191ac2 commit 2f13b44

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"php": "8.1 - 8.5",
1919
"nette/component-model": "^3.1",
2020
"nette/http": "^3.3",
21-
"nette/utils": "^4.0.4"
21+
"nette/utils": "^4.0.10"
2222
},
2323
"require-dev": {
2424
"nette/application": "^3.0",

src/Forms/Container.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,9 +299,15 @@ public function addComponent(
299299
* Iterates over all form controls.
300300
* @return iterable<Control>
301301
*/
302-
public function getControls(): \Iterator
302+
public function getControls(): iterable
303303
{
304-
return $this->getComponents(true, Control::class);
304+
return Nette\Utils\Iterables::repeatable(function () {
305+
foreach ($this->getComponentTree() as $component) {
306+
if ($component instanceof Control) {
307+
yield $component->getName() => $component;
308+
}
309+
}
310+
});
305311
}
306312

307313

0 commit comments

Comments
 (0)