Completed
Push — master ( 87f821...fcdf89 )
by Alexander
03:21
created

views/errorHandler/error.php (1 issue)

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