Index   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 9
c 2
b 0
f 0
dl 0
loc 32
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A asset() 0 8 1
A notFound() 0 8 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AbterPhp\Framework\Http\Controllers\Website;
6
7
use AbterPhp\Framework\Http\Controllers\ControllerAbstract;
8
use Opulence\Http\Responses\Response;
9
use Opulence\Http\Responses\ResponseHeaders;
10
use Throwable;
11
12
class Index extends ControllerAbstract
13
{
14
    /**
15
     * 404 page
16
     *
17
     * @return Response The response
18
     * @throws Throwable
19
     */
20
    public function asset(): Response
21
    {
22
        $this->view = $this->viewFactory->createView('contents/frontend/404');
23
24
        $response = $this->createResponse('404 Page not Found');
25
        $response->setStatusCode(ResponseHeaders::HTTP_NOT_FOUND);
26
27
        return $response;
28
    }
29
30
    /**
31
     * 404 page
32
     *
33
     * @return Response The response
34
     * @throws Throwable
35
     */
36
    public function notFound(): Response
37
    {
38
        $this->view = $this->viewFactory->createView('contents/frontend/404');
39
40
        $response = $this->createResponse('404 Page not Found');
41
        $response->setStatusCode(ResponseHeaders::HTTP_NOT_FOUND);
42
43
        return $response;
44
    }
45
}
46