Index::asset()   A
last analyzed

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
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