1 | <?php |
||
2 | |||
3 | namespace Jidaikobo\Kontiki\Controllers; |
||
4 | |||
5 | use Slim\App; |
||
6 | use Psr\Http\Message\ResponseInterface as Response; |
||
7 | use Psr\Http\Message\ServerRequestInterface as Request; |
||
8 | |||
9 | class HelpController extends BaseController |
||
10 | { |
||
11 | public static function registerRoutes(App $app, string $basePath = ''): void |
||
12 | { |
||
13 | $app->get('/help', HelpController::class . ':showHelp'); |
||
14 | $app->get('/help/markdown', HelpController::class . ':showHelpMarkdown'); |
||
15 | } |
||
16 | |||
17 | /** |
||
18 | * help |
||
19 | * |
||
20 | * @return Response |
||
21 | */ |
||
22 | public function showHelp(Request $request, Response $response): Response |
||
23 | { |
||
24 | ob_start(); |
||
25 | require(__DIR__ . '/../locale/' . env('APPLANG') . '/file/help.php'); |
||
26 | $content = ob_get_clean(); |
||
27 | |||
28 | return $this->renderResponse( |
||
29 | $response, |
||
30 | __('help'), |
||
31 | $content, |
||
32 | 'layout-help.php' |
||
33 | ); |
||
34 | } |
||
35 | |||
36 | /** |
||
37 | * show help of Markdown |
||
38 | * |
||
39 | * @return Response |
||
40 | */ |
||
41 | public function showHelpMarkdown(Request $request, Response $response): Response |
||
0 ignored issues
–
show
|
|||
42 | { |
||
43 | $helpText = __DIR__ . '/../locale/' . env('APPLANG') . '/file/markdown-help.php'; |
||
44 | $content = file_get_contents($helpText); |
||
45 | |||
46 | return $this->renderResponse( |
||
47 | $response, |
||
48 | __("markdown_help", 'Markdown Help'), |
||
49 | $content, |
||
50 | 'layout-help.php' |
||
51 | ); |
||
52 | } |
||
53 | } |
||
54 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.