Passed
Push — master ( a6aaea...9fd3bc )
by Pol
04:37
created

ProxyCallback::__invoke()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2.0625

Importance

Changes 0
Metric Value
cc 2
eloc 3
nc 2
nop 2
dl 0
loc 9
ccs 3
cts 4
cp 0.75
crap 2.0625
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace EcPhp\CasBundle\Controller;
6
7
use EcPhp\CasLib\CasInterface;
8
use Symfony\Bridge\PsrHttpMessage\HttpFoundationFactoryInterface;
9
use Symfony\Component\HttpFoundation\Response;
10
11
final class ProxyCallback
12
{
13 1
    public function __invoke(
14
        CasInterface $casProtocol,
15
        HttpFoundationFactoryInterface $httpFoundationFactory
16
    ): Response {
17 1
        if (null !== $response = $casProtocol->handleProxyCallback()) {
18 1
            return $httpFoundationFactory->createResponse($response);
19
        }
20
21
        return new Response('', Response::HTTP_INTERNAL_SERVER_ERROR);
22
    }
23
}
24