Passed
Pull Request — master (#13)
by Darío
08:03 queued 05:26
created

NeedsParseHeaders::parseHeaders()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 4
c 1
b 0
f 1
dl 0
loc 9
ccs 5
cts 5
cp 1
rs 10
cc 2
nc 2
nop 1
crap 2
1
<?php
2
3
namespace EasyHttp\SymfonyLayer\Concerns;
4
5
trait NeedsParseHeaders
6
{
7 5
    protected function parseHeaders(array $headers): array
8
    {
9 5
        $_headers = [];
10
11 5
        foreach ($headers as $key => $value) {
12 5
            $_headers[$key] = array_shift($value);
13
        }
14
15 5
        return $_headers;
16
    }
17
}
18