Passed
Pull Request — master (#122)
by Márk
01:37
created

Header::authenticate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 1
b 0
f 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
    public function __construct(string $name, $value)
21
    {
22
        $this->name = $name;
23
        $this->value = $value;
24
    }
25
26
    /**
27
     * {@inheritdoc}
28
     */
29
    public function authenticate(RequestInterface $request)
30
    {
31
        return $request->withHeader($this->name, $this->value);
32
    }
33
}
34