SetReverseProxyHeaders   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 4
dl 0
loc 15
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 3 1
A __construct() 0 3 1
1
<?php
2
3
/**
4
 * For the full copyright and license information, please view
5
 * the LICENSE file that was distributed with this source code.
6
 *
7
 * @see https://github.com/ecphp
8
 */
9
10
declare(strict_types=1);
11
12
namespace EcPhp\ReverseProxyHelperBundle\EventListener;
13
14
use EcPhp\ReverseProxyHelperBundle\Service\RequestAlterInterface;
15
use Symfony\Component\HttpKernel\Event\RequestEvent;
16
17
final class SetReverseProxyHeaders
18
{
19
    /**
20
     * @var RequestAlterInterface
21
     */
22
    private $requestAlter;
23
24 2
    public function __construct(RequestAlterInterface $requestAlter)
25
    {
26 2
        $this->requestAlter = $requestAlter;
27
    }
28
29 1
    public function __invoke(RequestEvent $event): void
30
    {
31 1
        ($this->requestAlter)->alter($event->getRequest());
32
    }
33
}
34