Passed
Push — master ( 6b549f...1ce121 )
by Pol
09:48 queued 07:32
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
/**
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\CasBundle\Controller;
13
14
use EcPhp\CasLib\CasInterface;
15
use Symfony\Bridge\PsrHttpMessage\HttpFoundationFactoryInterface;
16
use Symfony\Component\HttpFoundation\Response;
17
18
final class ProxyCallback
19
{
20 1
    public function __invoke(
21
        CasInterface $casProtocol,
22
        HttpFoundationFactoryInterface $httpFoundationFactory
23
    ): Response {
24 1
        if (null !== $response = $casProtocol->handleProxyCallback()) {
25 1
            return $httpFoundationFactory->createResponse($response);
26
        }
27
28
        return new Response('', Response::HTTP_INTERNAL_SERVER_ERROR);
29
    }
30
}
31