Completed
Push — master ( e4df22...3ec143 )
by David
04:03
created

ContextInvalidationSessionLogoutHandler   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 100%

Importance

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

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 1
    public function logout(Request $request, Response $response, TokenInterface $token)
30
    {
31 1
        $this->invalidator->invalidateContext($request->getSession()->getId());
32 1
        parent::logout($request, $response, $token);
33 1
    }
34
}
35