ErrorController   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 43
ccs 10
cts 10
cp 1
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A afterFilter() 0 2 1
A initialize() 0 3 1
A beforeRender() 0 5 1
A beforeFilter() 0 2 1
1
<?php
0 ignored issues
show
Coding Style introduced by
Filename "ErrorController.php" doesn't match the expected filename "errorcontroller.php"
Loading history...
Coding Style introduced by
The PHP open tag does not have a corresponding PHP close tag
Loading history...
Coding Style introduced by
Header blocks must be separated by a single blank line
Loading history...
Coding Style introduced by
This file is missing a doc comment.
Loading history...
Coding Style introduced by
Class found in ".php" file; use ".inc" extension instead
Loading history...
2
declare(strict_types=1);
3
4
/**
0 ignored issues
show
Coding Style introduced by
The file-level docblock must follow the opening PHP tag in the file header
Loading history...
Coding Style introduced by
Block comments must be started with /*
Loading history...
Coding Style introduced by
Inline doc block comments are not allowed; use "/* Comment */" or "// Comment" instead
Loading history...
5
 * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
6
 * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
0 ignored issues
show
introduced by
Doc comment short description must be on a single line, further text should be a separate paragraph
Loading history...
7
 *
8
 * Licensed under The MIT License
9
 * For full copyright and license information, please see the LICENSE.txt
10
 * Redistributions of files must retain the above copyright notice.
11
 *
12
 * @copyright     Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
0 ignored issues
show
Coding Style introduced by
@copyright tag must contain a year and the name of the copyright holder
Loading history...
introduced by
Tag value indented incorrectly; expected 1 space but found 5
Loading history...
13
 * @link          https://cakephp.org CakePHP(tm) Project
0 ignored issues
show
introduced by
Tag value indented incorrectly; expected 1 space but found 10
Loading history...
Coding Style introduced by
The tag in position 2 should be the @license tag
Loading history...
14
 * @since         3.3.4
0 ignored issues
show
Coding Style introduced by
The tag in position 3 should be the @link tag
Loading history...
introduced by
Tag value indented incorrectly; expected 1 space but found 9
Loading history...
15
 * @license       https://opensource.org/licenses/mit-license.php MIT License
0 ignored issues
show
introduced by
Tag value indented incorrectly; expected 1 space but found 7
Loading history...
Coding Style introduced by
The tag in position 4 should be the @since tag
Loading history...
16
 */
0 ignored issues
show
Coding Style introduced by
Missing @category tag in file comment
Loading history...
Coding Style introduced by
PHP version not specified
Loading history...
Coding Style introduced by
Header blocks must be separated by a single blank line
Loading history...
Coding Style introduced by
Missing @package tag in file comment
Loading history...
Coding Style introduced by
Missing @author tag in file comment
Loading history...
17
namespace App\Controller;
18
19
use Cake\Event\EventInterface;
20
21
/**
22
 * Error Handling Controller
23
 *
24
 * Controller used by ExceptionRenderer to render error responses.
25
 */
0 ignored issues
show
Coding Style introduced by
Missing @link tag in class comment
Loading history...
Coding Style introduced by
Missing @license tag in class comment
Loading history...
Coding Style introduced by
Missing @package tag in class comment
Loading history...
Coding Style introduced by
Missing @author tag in class comment
Loading history...
Coding Style introduced by
Missing @category tag in class comment
Loading history...
26
class ErrorController extends AppController
27
{
0 ignored issues
show
introduced by
Opening brace should be on the same line as the declaration
Loading history...
Coding Style introduced by
Opening brace should be on the same line as the declaration for class ErrorController
Loading history...
28
    /**
29
     * Initialization hook method.
30
     *
31
     * @return void
0 ignored issues
show
introduced by
If there is no return value for a function, there must not be a @return tag.
Loading history...
32
     */
33 4
    public function initialize(): void
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line before function; 0 found
Loading history...
34
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
35 4
        $this->loadComponent('RequestHandler');
36 4
    }
37
38
    /**
39
     * beforeFilter callback.
0 ignored issues
show
Coding Style introduced by
Doc comment short description must start with a capital letter
Loading history...
40
     *
41
     * @param \Cake\Event\EventInterface $event Event.
0 ignored issues
show
introduced by
Parameter comment must be on the next line
Loading history...
42
     * @return \Cake\Http\Response|null|void
0 ignored issues
show
introduced by
@return doc comment specified, but function has no return statement
Loading history...
introduced by
Separate the @param and @return sections by a blank line.
Loading history...
43
     */
44 4
    public function beforeFilter(EventInterface $event)
45
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
46 4
    }
47
48
    /**
49
     * beforeRender callback.
0 ignored issues
show
Coding Style introduced by
Doc comment short description must start with a capital letter
Loading history...
50
     *
51
     * @param \Cake\Event\EventInterface $event Event.
0 ignored issues
show
introduced by
Parameter comment must be on the next line
Loading history...
52
     * @return \Cake\Http\Response|null|void
0 ignored issues
show
introduced by
Separate the @param and @return sections by a blank line.
Loading history...
introduced by
@return doc comment specified, but function has no return statement
Loading history...
53
     */
54 4
    public function beforeRender(EventInterface $event)
55
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
56 4
        parent::beforeRender($event);
57
58 4
        $this->viewBuilder()->setTemplatePath('Error');
59 4
    }
60
61
    /**
62
     * afterFilter callback.
0 ignored issues
show
Coding Style introduced by
Doc comment short description must start with a capital letter
Loading history...
63
     *
64
     * @param \Cake\Event\EventInterface $event Event.
0 ignored issues
show
introduced by
Parameter comment must be on the next line
Loading history...
65
     * @return \Cake\Http\Response|null|void
0 ignored issues
show
introduced by
Separate the @param and @return sections by a blank line.
Loading history...
introduced by
@return doc comment specified, but function has no return statement
Loading history...
66
     */
67 4
    public function afterFilter(EventInterface $event)
68
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
69 4
    }
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line after function; 0 found
Loading history...
70
}
71