Skip to content

Commit

Permalink
Revert "UI\PresenterComponent: removed references created by loadStat…
Browse files Browse the repository at this point in the history
…e() 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
  • Loading branch information
dg committed Apr 27, 2024
1 parent 5543e78 commit 0d1711b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Application/UI/Component.php
Expand Up @@ -161,9 +161,9 @@ public function loadState(array $params): void
));
}

$this->$name = $params[$name];
$this->$name = &$params[$name];
} else {
$params[$name] = $this->$name ?? null;
$params[$name] = &$this->$name;
}
}

Expand Down Expand Up @@ -236,7 +236,7 @@ final public function getParameter(string $name): mixed
*/
final public function getParameters(): array
{
return $this->params;
return array_map(fn($item) => $item, $this->params);
}


Expand Down

0 comments on commit 0d1711b

Please sign in to comment.