GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Pull Request — 3.x (#2549)
by
unknown
02:15
created

renderHtmlNotAllowedMessage()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 30

Duplication

Lines 30
Ratio 100 %

Importance

Changes 0
Metric Value
dl 30
loc 30
rs 9.44
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
namespace Slim\Handlers\Renderables;
3
4
use Slim\Interfaces\RenderableInterface;
5
6 View Code Duplication
class HtmlNotAllowedMessage implements RenderableInterface
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in 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...
7
{
8
9
    public function render($args)
10
    {
11
        return $this->renderHtmlNotAllowedMessage($args[0]);
12
    }
13
14
15
    /**
16
     * Render HTML not allowed message
17
     *
18
     * @param  array                  $methods
19
     * @return string
20
     */
21
    protected function renderHtmlNotAllowedMessage($methods)
22
    {
23
        $allow = implode(', ', $methods);
24
        $output = <<<END
25
<html>
26
    <head>
27
        <title>Method not allowed</title>
28
        <style>
29
            body{
30
                margin:0;
31
                padding:30px;
32
                font:12px/1.5 Helvetica,Arial,Verdana,sans-serif;
33
            }
34
            h1{
35
                margin:0;
36
                font-size:48px;
37
                font-weight:normal;
38
                line-height:48px;
39
            }
40
        </style>
41
    </head>
42
    <body>
43
        <h1>Method not allowed</h1>
44
        <p>Method not allowed. Must be one of: <strong>$allow</strong></p>
45
    </body>
46
</html>
47
END;
48
49
        return $output;
50
    }
51
}