AddServerPoweredByModifier   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 17
ccs 5
cts 5
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A modify() 0 4 1
1
<?php
2
3
namespace Thruster\Component\HttpModifiers;
4
5
use Psr\Http\Message\ResponseInterface;
6
use Thruster\Component\HttpModifier\ResponseModifierInterface;
7
8
/**
9
 * Class AddServerPoweredByModifier
10
 *
11
 * @package Thruster\Component\HttpModifiers
12
 * @author  Aurimas Niekis <[email protected]>
13
 */
14
class AddServerPoweredByModifier implements ResponseModifierInterface
15
{
16
    /**
17
     * @var string
18
     */
19
    private $poweredBy;
20
21 1
    public function __construct(string $poweredBy)
22
    {
23 1
        $this->poweredBy = $poweredBy;
24 1
    }
25
26 1
    public function modify(ResponseInterface $response) : ResponseInterface
27
    {
28 1
        return $response->withHeader('X-Powered-By', $this->poweredBy);
29
    }
30
}
31