Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 3f736db

Browse files
committedMar 6, 2024
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 4b4da41 commit 3f736db

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
@@ -165,9 +165,9 @@ public function loadState(array $params): void
165165
));
166166
}
167167

168-
$this->$name = $params[$name];
168+
$this->$name = &$params[$name];
169169
} else {
170-
$params[$name] = $this->$name ?? null;
170+
$params[$name] = &$this->$name;
171171
}
172172
}
173173

@@ -201,7 +201,7 @@ final public function getParameter(string $name): mixed
201201
*/
202202
final public function getParameters(): array
203203
{
204-
return $this->params;
204+
return array_map(fn($item) => $item, $this->params);
205205
}
206206

207207

0 commit comments

Comments
 (0)