Completed
Push — master ( 799419...2ea7db )
by Mikael
04:18 queued 02:23
created

config/router/900_internal.php (3 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
/**
3
 * Internal routes for error handling to show response when internal
4
 * exceptions are thrown.
5
 */
6
return [
7
    // Path where to mount the routes, is added to each route path.
8 11
    "mount" => null,
9
10
    // All routes in order
11
    "routes" => [
12
        [
13 11
            "info" => "403 Forbidden.",
14
            "internal" => true,
15 11
            "path" => "403",
16 View Code Duplication
            "handler" => function ($message = null) {
0 ignored issues
show
This code seems to be duplicated across 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...
17 2
                $html = "Anax 403: Forbidden";
18 2
                if ($message && !defined("ANAX_PRODUCTION")) {
19 1
                    $html .= "<br>$message";
20
                }
21 2
                return [$html, 403];
22 11
            },
23
        ],
24
        [
25 11
            "info" => "404 Page not found.",
26
            "internal" => true,
27 11
            "path" => "404",
28 View Code Duplication
            "handler" => function ($message = null) {
0 ignored issues
show
This code seems to be duplicated across 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...
29 2
                $html = "Anax 404: Not Found";
30 2
                if ($message && !defined("ANAX_PRODUCTION")) {
31 1
                    $html .= "<br>$message";
32
                }
33 2
                return [$html, 404];
34 11
            },
35
        ],
36
        [
37 11
            "info" => "500 Internal Server Error.",
38
            "internal" => true,
39 11
            "path" => "500",
40 View Code Duplication
            "handler" => function ($message = null) {
0 ignored issues
show
This code seems to be duplicated across 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...
41
                // echo "<pre>";
42
                // debug_print_backtrace();
43 4
                $html = "Anax 500: Internal Server Error";
44 4
                if ($message && !defined("ANAX_PRODUCTION")) {
45 1
                    $html .= "<br>$message";
46
                }
47 4
                return [$html, 500];
48 11
            },
49
        ],
50
    ]
51
];
52