HmacAuthenticationEntryPoint::start()   A
last analyzed

Complexity

Conditions 2
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 3
nc 1
nop 2
dl 0
loc 6
ccs 4
cts 4
cp 1
crap 2
rs 10
c 1
b 0
f 0
1
<?php
2
3
namespace Acquia\Hmac\Symfony;
4
5
use Symfony\Component\HttpFoundation\Request;
6
use Symfony\Component\HttpFoundation\Response;
7
use Symfony\Component\Security\Core\Exception\AuthenticationException;
8
use Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface;
9
10
/**
11
 * Response handling for a client making an unauthenticated request.
12
 */
13
class HmacAuthenticationEntryPoint implements AuthenticationEntryPointInterface
14
{
15
    /**
16
     * {@inheritDoc}
17
     */
18 1
    public function start(Request $request, AuthenticationException $authException = null)
19
    {
20 1
        $response = new Response();
21 1
        $response->setStatusCode(401, $authException ? $authException->getMessage() : null);
22
23 1
        return $response;
24
    }
25
}
26