Skip to content

Commit 03300a8

Browse files
authored
Merge pull request #858 from hydephp/handle-deprecations
Remove deprecated support for setting page rendering data via the view facade
2 parents a3da55b + 07fd77c commit 03300a8

File tree

1 file changed

+3
-18
lines changed

1 file changed

+3
-18
lines changed

packages/framework/src/Support/Models/Render.php

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,17 @@ public function setPage(HydePage $page): void
3434

3535
public function getPage(): ?HydePage
3636
{
37-
return $this->page ?? self::handleFallback('page');
37+
return $this->page ?? null;
3838
}
3939

4040
public function getCurrentRoute(): ?Route
4141
{
42-
return $this->currentRoute ?? self::handleFallback('currentRoute');
42+
return $this->currentRoute ?? null;
4343
}
4444

4545
public function getCurrentPage(): ?string
4646
{
47-
return $this->currentPage ?? self::handleFallback('currentPage');
47+
return $this->currentPage ?? null;
4848
}
4949

5050
public function shareToView(): void
@@ -80,19 +80,4 @@ public function toArray(): array
8080
'currentPage' => $this->getCurrentPage(),
8181
];
8282
}
83-
84-
/**
85-
* @deprecated Setting page rendering data via the view facade is deprecated. Use {@see Render::share()} instead.
86-
* @codeCoverageIgnore
87-
*/
88-
protected static function handleFallback(string $property): mixed
89-
{
90-
$shared = View::shared($property);
91-
92-
if ($shared !== null) {
93-
trigger_error("Setting page rendering data via the view facade is deprecated. Use `Render::share('$property', \$value)` instead", E_USER_DEPRECATED);
94-
}
95-
96-
return $shared;
97-
}
9883
}

0 commit comments

Comments
 (0)