PageController   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 32
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A show() 0 6 1
A habboPage() 0 4 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