Failed Conditions
Push — master ( a26426...65249a )
by Arnold
14:53 queued 04:44
created

Headers   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 3
c 1
b 0
f 0
dl 0
loc 11
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getValue() 0 3 1
1
<?php
2
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
namespace Jasny\Controller\Parameter;
4
5
use Psr\Http\Message\ServerRequestInterface;
6
7
#[\Attribute]
8
class Headers implements Parameter
0 ignored issues
show
Coding Style introduced by
Missing doc comment for class Headers
Loading history...
9
{
10
    /**
0 ignored issues
show
Coding Style introduced by
Parameter $request should have a doc-comment as per coding-style.
Loading history...
Coding Style introduced by
Parameter $name should have a doc-comment as per coding-style.
Loading history...
Coding Style introduced by
Parameter $type should have a doc-comment as per coding-style.
Loading history...
Coding Style introduced by
Parameter $required should have a doc-comment as per coding-style.
Loading history...
11
     * Get all request headers.
12
     *
13
     * @return array<string,string>
14
     */
15
    public function getValue(ServerRequestInterface $request, string $name, ?string $type, bool $required = false): array
16
    {
17
        return array_map(static fn ($h) => implode(', ', $h), $request->getHeaders());
18
    }
19
}
20