Completed
Pull Request — 4.0 (#4082)
by akira
07:49
created

AdminLogoutHandler::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Eccube\Security\Http\Logout;
4
5
use Symfony\Component\Security\Http\Logout\LogoutHandlerInterface;
6
use Symfony\Component\HttpFoundation\Request;
7
use Symfony\Component\HttpFoundation\Response;
8
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
9
use Symfony\Component\HttpFoundation\Session\SessionInterface;
10
11
class AdminLogoutHandler implements LogoutHandlerInterface {
12
13
    private $session;
14
15
    public function __construct(SessionInterface $session)
16
    {
17
        $this->session = $session;
18
    }
19
20
    public function logout(Request $request, Response $response, TokenInterface $token)
21
    {
22
        if ($this->session->has("_security_admin")) {
23
            $this->session->remove("_security_admin");
24
        }
25
    }
26
27
}
28