Completed
Push — master ( fcdf89...4a0ecc )
by Alexander
14:58
created

views/errorHandler/error.php (1 issue)

Labels
Severity
1
<?php
2
/* @var $exception \Yiisoft\Web\HttpException|\Exception */
3
/* @var $this \Yiisoft\Yii\Web\ErrorHandler\HtmlRenderer */
4
5
$code = $exception->getCode();
6
7
$name = $handler->getExceptionName($exception);
8
if ($name === null) {
9
    $name = 'Error';
10
}
11
if ($code) {
12
    $name .= " (#$code)";
13
}
14
15
if ($exception instanceof \yii\base\UserException) {
0 ignored issues
show
The type yii\base\UserException was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
16
    $message = $exception->getMessage();
17
} else {
18
    $message = 'An internal server error occurred.';
19
}
20
21
if (method_exists($this, 'beginPage')) {
22
    $this->beginPage();
23
}
24
?>
25
<!DOCTYPE html>
26
<html>
27
<head>
28
    <meta charset="utf-8" />
29
    <title><?= $handler->htmlEncode($name) ?></title>
30
31
    <style>
32
        body {
33
            font: normal 9pt "Verdana";
34
            color: #000;
35
            background: #fff;
36
        }
37
38
        h1 {
39
            font: normal 18pt "Verdana";
40
            color: #f00;
41
            margin-bottom: .5em;
42
        }
43
44
        h2 {
45
            font: normal 14pt "Verdana";
46
            color: #800000;
47
            margin-bottom: .5em;
48
        }
49
50
        h3 {
51
            font: bold 11pt "Verdana";
52
        }
53
54
        p {
55
            font: normal 9pt "Verdana";
56
            color: #000;
57
        }
58
59
        .version {
60
            color: gray;
61
            font-size: 8pt;
62
            border-top: 1px solid #aaa;
63
            padding-top: 1em;
64
            margin-bottom: 1em;
65
        }
66
    </style>
67
</head>
68
69
<body>
70
    <h1><?= $handler->htmlEncode($name) ?></h1>
71
    <h2><?= nl2br($handler->htmlEncode($message)) ?></h2>
72
    <p>
73
        The above error occurred while the Web server was processing your request.
74
    </p>
75
    <p>
76
        Please contact us if you think this is a server error. Thank you.
77
    </p>
78
    <div class="version">
79
        <?= date('Y-m-d H:i:s') ?>
80
    </div>
81
    <?php if (method_exists($this, 'endBody')): ?>
82
        <?php $this->endBody() // to allow injecting code into body (mostly by Yii Debug Toolbar)?>
83
    <?php endif ?>
84
</body>
85
</html>
86
<?php if (method_exists($this, 'endPage')): ?>
87
    <?php $this->endPage() ?>
88
<?php endif ?>
89