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.
Passed
Pull Request — master (#1)
by Pascal
02:42
created

HeaderResourceBuilder::build()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 3

Importance

Changes 0
Metric Value
cc 3
eloc 5
nc 3
nop 1
dl 0
loc 11
ccs 6
cts 6
cp 1
crap 3
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Saikootau\ApiBundle\Resource\Builder;
6
7
use Saikootau\ApiBundle\Resource\Header;
8
use Symfony\Component\HttpFoundation\Request;
9
10
class HeaderResourceBuilder
11
{
12
    /**
13
     * Build a collection of header resources from a given request.
14
     *
15
     * @param Request $request
16
     *
17
     * @return Header[]
18
     */
19 13
    public function build(Request $request): array
20
    {
21 13
        $headers = [];
22
23 13
        foreach ($request->headers as $name => $values) {
24 11
            foreach ($values as $value) {
25 11
                $headers[] = new Header((string) $name, (string) $value);
26
            }
27
        }
28
29 13
        return $headers;
30
    }
31
}
32