Completed
Push — master ( c1ed37...714f13 )
by Korotkov
02:06
created

HttpErrors::error404()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 8
Ratio 100 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 8
loc 8
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
3
namespace App\Http\Supports;
4
5
trait HttpErrors
6
{
7
8 View Code Duplication
    public function error404()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
9
    {
10
        $this->redirect()->responseCode('404');
11
12
        return $this->twig('errors/404.html.twig', [
13
            'title'  => '404 Page Not Found :: ' . $this->data('title'),
14
        ]);
15
    }
16
17 View Code Duplication
    public function error503()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
18
    {
19
        $this->redirect()->responseCode('503');
20
21
        return $this->twig('errors/503.html.twig', [
22
            'title'  => '503 Service Unavailable :: ' . $this->data('title'),
23
        ]);
24
    }
25
26 View Code Duplication
    public function error500()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
27
    {
28
        $this->redirect()->responseCode('503');
29
30
        return $this->twig('errors/503.html.twig', [
31
            'title'  => '503 Service Unavailable :: ' . $this->data('title'),
32
        ]);
33
    }
34
35
    /**
36
     * @param null $target
37
     *
38
     * @return mixed
39
     */
40
    public abstract function redirect($target = null);
41
42
    /**
43
     * @param string $template
44
     * @param array  $params
45
     */
46
    public abstract function twig(string $template, array $params = []): void;
47
48
    /**
49
     * @param string $key
50
     *
51
     * @return string|array
52
     */
53
    public abstract function data(string $key = null);
54
}