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 — master (#1)
by Pascal
02:17
created

HeaderResourceBuilder   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 20
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A build() 0 11 3
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