Skip to content

Commit 990189c

Browse files
committed
Revert "UI\PresenterComponent: removed references created by loadState() for persistent parameters. [Closes nette/nette#703][Closes nette/nette#703][Closes #69]" (possible BC break)
This reverts commit cda17f4. See https://forum.nette.org/cs/35528-stejne-pojmenovany-parametr-akce-presenteru-a-persistentni-odlisne-chovani-v-nette-2-0-oproti-aktualnimu#p221742 BC break: Property must be nullable, ie: #[Persistent] public ?int $foo
1 parent e22102a commit 990189c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Application/UI/Component.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,9 @@ public function loadState(array $params): void
162162
));
163163
}
164164

165-
$this->$name = $params[$name];
165+
$this->$name = &$params[$name];
166166
} else {
167-
$params[$name] = $this->$name ?? null;
167+
$params[$name] = &$this->$name;
168168
}
169169
}
170170

@@ -237,7 +237,7 @@ final public function getParameter(string $name): mixed
237237
*/
238238
final public function getParameters(): array
239239
{
240-
return $this->params;
240+
return array_map(fn($item) => $item, $this->params);
241241
}
242242

243243

0 commit comments

Comments
 (0)