Skip to content

Commit 7f26bc4

Browse files
committed
Small codestyle changes
1 parent 1a48d7d commit 7f26bc4

File tree

3 files changed

+30
-11
lines changed

3 files changed

+30
-11
lines changed

composer.lock

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Web/Documentation/ChapterController.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@
1818

1919
final readonly class ChapterController
2020
{
21+
#[Get('/docs/{path:.*}')]
22+
public function docsRedirect(string $path): Redirect
23+
{
24+
return new Redirect('/main/' . $path);
25+
}
26+
2127
#[Get('/docs')]
2228
#[Get('/documentation')]
2329
public function index(): Redirect
@@ -39,7 +45,7 @@ public function index(): Redirect
3945
public function __invoke(string $version, string $category, string $slug, ChapterRepository $chapterRepository): View|Response
4046
{
4147
if (is_null($version = Version::tryFrom($version))) {
42-
throw new NotFoundException();
48+
return new NotFound();
4349
}
4450

4551
$currentChapter = $chapterRepository->find($version, $category, $slug);

src/Web/Homepage/HomeController.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use League\CommonMark\MarkdownConverter;
66
use Tempest\Router\Get;
7+
use Tempest\Router\Responses\Redirect;
78
use Tempest\Router\StaticPage;
89
use Tempest\View\View;
910

@@ -29,4 +30,16 @@ public function __invoke(): View
2930

3031
return view('./home.view.php', codeBlocks: $codeBlocks);
3132
}
33+
34+
#[Get('/view')]
35+
public function viewRedirect(): Redirect
36+
{
37+
return new Redirect('/main/framework/views');
38+
}
39+
40+
#[Get('/console')]
41+
public function consoleRedirect(): Redirect
42+
{
43+
return new Redirect('/main/console/getting-started');
44+
}
3245
}

0 commit comments

Comments
 (0)