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
Push — master ( dbe9e8...3eb9e5 )
by Benjamin
03:26
created

DefaultController::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Lib\Controller;
6
7
use GuzzleHttp\Psr7\Response;
8
use Lib\Templating\Templater;
9
use Psr\Http\Message\ResponseInterface;
10
11
class DefaultController
12
{
13
    /**
14
     * @var Templater
15
     */
16
    private $templater;
17
18 4
    public function __construct()
19
    {
20 4
        $this->templater = new Templater();
21 4
    }
22
23 3
    public function notFoundAction()
24
    {
25 3
        return $this->returnResponse('Not Found', 404);
26
    }
27
28 1
    public function render($template, array $params): ResponseInterface
29
    {
30 1
        $view = $this->templater->render($template, $params);
31
32 1
        return $this->returnResponse($view);
33
    }
34
35 4
    public function returnResponse($body = '', $statusCode = 200): ResponseInterface
36
    {
37
        $headers = [
38 4
            'Content-Type' => ['text/html; charset=UTF-8'],
39
            'Cache-Control' => ['max-age=172800', 'public'],
40
        ];
41
42 4
        return new Response($statusCode, $headers, $body);
43
    }
44
}
45