SetReverseProxyHeaders::__invoke()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 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