Completed
Pull Request — master (#123)
by David
01:53
created

Header   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 6
dl 0
loc 24
ccs 6
cts 6
cp 1
rs 10
c 1
b 0
f 1
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A authenticate() 0 3 1
1
<?php
2
3
namespace Http\Message\Authentication;
4
5
use Http\Message\Authentication;
6
use Psr\Http\Message\RequestInterface;
7
8
class Header implements Authentication
9
{
10
    /**
11
     * @var string
12
     */
13
    private $name;
14
15
    /**
16
     * @var string|array
17
     */
18
    private $value;
19
20 3
    public function __construct(string $name, $value)
21
    {
22 3
        $this->name = $name;
23 3
        $this->value = $value;
24 3
    }
25
26
    /**
27
     * {@inheritdoc}
28
     */
29 1
    public function authenticate(RequestInterface $request)
30
    {
31 1
        return $request->withHeader($this->name, $this->value);
32
    }
33
}
34