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 ( 9dc691...a1e10d )
by Benjamin
02:44
created

ServerCollection::getHeaders()   A

Complexity

Conditions 4
Paths 4

Size

Total Lines 14
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 4.0218

Importance

Changes 0
Metric Value
cc 4
eloc 8
nc 4
nop 0
dl 0
loc 14
rs 9.2
c 0
b 0
f 0
ccs 8
cts 9
cp 0.8889
crap 4.0218
1
<?php
2
3
namespace App\Lib\Http;
4
5
use App\Lib\Http\ParamCollection;
6
7
class ServerCollection extends ParamCollection
8
{
9 4
    public function getHeaders()
10
    {
11 4
        $headers = [];
12 4
        $contentHeaders = ['CONTENT_LENGTH' => true, 'CONTENT_MD5' => true, 'CONTENT_TYPE' => true];
13
14 4
        foreach ($this->parameters as $key => $value) {
15 1
            if (0 === stripos($key, 'HTTP_')) {
16
                $headers[substr($key, 5)] = $value;
17 1
            } elseif (isset($contentHeaders[$key])) {
18 1
                $headers[$key] = $value;
19
            }
20
        }
21
22 4
        return $headers;
23
    }
24
}
25