Completed
Push — master ( 4c74f5...2b33f7 )
by Aurimas
04:08
created

PoweredByModifier::modify()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 2
1
<?php
2
3
namespace Thruster\Component\HttpServer\ResponseModifier;
4
5
use Psr\Http\Message\ResponseInterface;
6
use Thruster\Component\HttpServer\HttpServer;
7
use Thruster\Component\HttpServer\ResponseModifierInterface;
8
9
/**
10
 * Class PoweredByModifier
11
 *
12
 * @package Thruster\Component\HttpServer\ResponseModifier
13
 * @author  Aurimas Niekis <[email protected]>
14
 */
15
class PoweredByModifier implements ResponseModifierInterface
16
{
17
    /**
18
     * @var string
19
     */
20
    private $poweredBy;
21
22
    public function __construct(string $poweredBy)
23
    {
24
        $this->poweredBy = $poweredBy;
25
    }
26
27
    public function modify(ResponseInterface $response) : ResponseInterface
28
    {
29
        return $response->withHeader('X-Powered-By', $this->poweredBy);
30
    }
31
}
32