PageController::habboPage()   A
last analyzed

Complexity

Conditions 2
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 2
eloc 2
nc 1
nop 2
1
<?php
2
3
namespace App\Http\Controllers;
4
5
use Illuminate\Http\Response;
6
use Laravel\Lumen\Routing\Controller as BaseController;
7
8
/**
9
 * Class PageController.
10
 */
11
class PageController extends BaseController
12
{
13
    /**
14
     * Render a HabboWEB Page.
15
     *
16
     * @param string $pageCategory
17
     * @param string $pageFile
18
     *
19
     * @return Response
20
     */
21
    public function show(string $pageCategory, string $pageFile): Response
22
    {
23
        $pageArray = explode('.', $pageFile);
24
25
        return response(view("habbo-web-pages.{$pageCategory}.{$pageArray[0]}"));
26
    }
27
28
    /**
29
     * Render a HabboPage.
30
     *
31
     * @WARNING: Categories can still be pages
32
     *
33
     * @param string $category
34
     * @param string $page
35
     *
36
     * @return Response
37
     */
38
    public function habboPage(string $category, string $page = '')
39
    {
40
        return response(view(empty($page) ? "habbo-pages.{$category}" : "habbo-pages.{$category}.{$page}"));
0 ignored issues
show
Bug Compatibility introduced by
The expression response(view(empty($pag...{$category}.{$page}")); of type Laravel\Lumen\Http\Respo...lluminate\Http\Response adds the type Laravel\Lumen\Http\ResponseFactory to the return on line 40 which is incompatible with the return type documented by App\Http\Controllers\PageController::habboPage of type Illuminate\Http\Response.
Loading history...
41
    }
42
}
43