Passed
Pull Request — master (#1237)
by Dante
01:49
created

ErrorController::initialize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
4
 * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
5
 *
6
 * Licensed under The MIT License
7
 * For full copyright and license information, please see the LICENSE.txt
8
 * Redistributions of files must retain the above copyright notice.
9
 *
10
 * @copyright     Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
11
 * @link          https://cakephp.org CakePHP(tm) Project
12
 * @since         3.3.4
13
 * @license       https://opensource.org/licenses/mit-license.php MIT License
14
 */
15
namespace App\Controller;
16
17
use Cake\Event\EventInterface;
18
use Cake\Http\Response;
19
20
/**
21
 * Error Handling Controller
22
 *
23
 * Controller used by ExceptionRenderer to render error responses.
24
 */
25
class ErrorController extends AppController
26
{
27
    /**
28
     * beforeFilter callback.
29
     *
30
     * @param \Cake\Event\EventInterface $event Event.
31
     * @return \Cake\Http\Response|null
32
     * @codeCoverageIgnore
33
     */
34
    public function beforeFilter(EventInterface $event): ?Response
35
    {
36
        return null;
37
    }
38
39
    /**
40
     * beforeRender callback.
41
     *
42
     * @param \Cake\Event\EventInterface $event Event.
43
     * @return \Cake\Http\Response|null
44
     * @codeCoverageIgnore
45
     */
46
    public function beforeRender(EventInterface $event): ?Response
47
    {
48
        $this->viewBuilder()->setClassName('App\View\AppView');
49
        $this->viewBuilder()->setTemplatePath('Error');
50
51
        return null;
52
    }
53
54
    /**
55
     * afterFilter callback.
56
     *
57
     * @param \Cake\Event\EventInterface $event Event.
58
     * @return void
59
     * @codeCoverageIgnore
60
     */
61
    public function afterFilter(EventInterface $event): void
62
    {
63
    }
64
}
65