Skip to content

Commit 59b5bbe

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 df44d0a commit 59b5bbe

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
@@ -160,9 +160,9 @@ public function loadState(array $params): void
160160
));
161161
}
162162

163-
$this->$name = $params[$name];
163+
$this->$name = &$params[$name];
164164
} else {
165-
$params[$name] = $this->$name ?? null;
165+
$params[$name] = &$this->$name;
166166
}
167167
}
168168

@@ -196,7 +196,7 @@ final public function getParameter(string $name): mixed
196196
*/
197197
final public function getParameters(): array
198198
{
199-
return $this->params;
199+
return array_map(fn($item) => $item, $this->params);
200200
}
201201

202202

0 commit comments

Comments
 (0)