Completed
Push — master ( 74924c...2c1307 )
by Márk
30s queued 11s
created

Header   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 6
dl 0
loc 24
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
    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