HmacAuthenticationEntryPoint   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
dl 0
loc 11
ccs 4
cts 4
cp 1
rs 10
c 1
b 0
f 0
wmc 2

1 Method

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