ContextInvalidationSessionLogoutHandler   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Test Coverage

Coverage 42.86%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 4
dl 0
loc 15
ccs 3
cts 7
cp 0.4286
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A logout() 0 5 1
1
<?php
2
3
/*
4
 * This file is part of the FOSHttpCacheBundle package.
5
 *
6
 * (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace FOS\HttpCacheBundle\Security\Http\Logout;
13
14
use FOS\HttpCacheBundle\UserContextInvalidator;
15
use Symfony\Component\HttpFoundation\Request;
16
use Symfony\Component\HttpFoundation\Response;
17
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
18
use Symfony\Component\Security\Http\Logout\SessionLogoutHandler;
19
20
final class ContextInvalidationSessionLogoutHandler extends SessionLogoutHandler
21
{
22
    private $invalidator;
23
24 1
    public function __construct(UserContextInvalidator $invalidator)
25
    {
26 1
        $this->invalidator = $invalidator;
27 1
    }
28
29
    public function logout(Request $request, Response $response, TokenInterface $token)
30
    {
31
        $this->invalidator->invalidateContext($request->getSession()->getId());
32
        parent::logout($request, $response, $token);
33
    }
34
}
35