Passed
Push — master ( 3039c7...cdcb0a )
by Peter
02:28
created

Index::asset()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
nc 1
nop 0
dl 0
loc 8
c 1
b 0
f 0
cc 1
rs 10
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
11
class Index extends ControllerAbstract
12
{
13
14
    /**
15
     * 404 page
16
     *
17
     * @return Response The response
18
     */
19
    public function asset(): Response
20
    {
21
        $this->view = $this->viewFactory->createView('contents/frontend/404');
22
23
        $response = $this->createResponse('404 Page not Found');
24
        $response->setStatusCode(ResponseHeaders::HTTP_NOT_FOUND);
25
26
        return $response;
27
    }
28
29
    /**
30
     * 404 page
31
     *
32
     * @return Response The response
33
     */
34
    public function notFound(): Response
35
    {
36
        $this->view = $this->viewFactory->createView('contents/frontend/404');
37
38
        $response = $this->createResponse('404 Page not Found');
39
        $response->setStatusCode(ResponseHeaders::HTTP_NOT_FOUND);
40
41
        return $response;
42
    }
43
}
44