Skip to content

Commit 2ceca5b

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 302bc6b commit 2ceca5b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Application/UI/Component.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,9 @@ public function loadState(array $params): void
161161
));
162162
}
163163

164-
$this->$name = $params[$name];
164+
$this->$name = &$params[$name];
165165
} else {
166-
$params[$name] = $this->$name ?? null;
166+
$params[$name] = &$this->$name;
167167
}
168168
}
169169

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

242242

0 commit comments

Comments
 (0)