Passed
Push — master ( 6b549f...1ce121 )
by Pol
09:48 queued 07:32
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
/**
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