Skip to content

Commit d822a1d

Browse files
committed
Rename Routes::getOrFail to Routes::get
1 parent ac8362b commit d822a1d

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

packages/framework/src/Foundation/Facades/Routes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public static function find(string $routeKey): ?Route
3535
}
3636

3737
/** @throws \Hyde\Framework\Exceptions\RouteNotFoundException */
38-
public static function getOrFail(string $routeKey): Route
38+
public static function get(string $routeKey): Route
3939
{
4040
return static::getFacadeRoot()->getRoute($routeKey);
4141
}

packages/framework/tests/Unit/Facades/RouteFacadeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function testGetOrFailThrowsExceptionIfRouteIsNotFound()
2929
{
3030
$this->expectException(RouteNotFoundException::class);
3131

32-
Routes::getOrFail('not-found');
32+
Routes::get('not-found');
3333
}
3434

3535
public function testGetReturnsRouteFromRouterIndex()

packages/realtime-compiler/src/Http/DashboardController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ protected function openInExplorer(): void
296296
protected function openPageInEditor(): void
297297
{
298298
$routeKey = $this->request->data['routeKey'] ?? $this->abort(400, 'Must provide routeKey');
299-
$page = Routes::getOrFail($routeKey)->getPage();
299+
$page = Routes::get($routeKey)->getPage();
300300

301301
$binary = $this->findGeneralOpenBinary();
302302
$path = Hyde::path($page->getSourcePath());

packages/realtime-compiler/src/Routing/PageRouter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public static function handle(Request $request): Response
8282
protected function getPageFromRoute(): HydePage
8383
{
8484
try {
85-
return Routes::getOrFail($this->normalizePath($this->request->path))->getPage();
85+
return Routes::get($this->normalizePath($this->request->path))->getPage();
8686
} catch (RouteNotFoundException $exception) {
8787
$index = Routes::find($this->normalizePath($this->request->path).'/index');
8888

0 commit comments

Comments
 (0)