ProxyCallback::__invoke()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
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 7
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 Psr\Http\Message\ResponseInterface;
16
use Symfony\Component\HttpFoundation\Request;
17
use Symfony\Component\HttpFoundation\Response;
18
19
final class ProxyCallback
20
{
21
    /**
22
     * @return ResponseInterface|Response
23
     */
24 1
    public function __invoke(
25
        Request $request,
26
        CasInterface $cas
27
    ) {
28 1
        return (null === $response = $cas->handleProxyCallback($request->query->all()))
29
            ? (new Response('', 500))
30 1
            : $response;
31
    }
32
}
33