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

ProxyCallback   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 75%

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 11
ccs 3
cts 4
cp 0.75
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 9 2
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