Code Duplication    Length = 6-6 lines in 2 locations

eZ/Publish/Core/REST/Server/Controller/User.php 2 locations

@@ 1030-1035 (lines=6) @@
1027
    {
1028
        $session = $request->getSession();
1029
1030
        if ($session === null || !$session->isStarted() || $session->getId() != $sessionId || !$this->hasStoredCsrfToken()) {
1031
            $response = $this->container->get('ezpublish_rest.session_authenticator')->logout($request);
1032
            $response->setStatusCode(404);
1033
1034
            return $response;
1035
        }
1036
1037
        $this->checkCsrfToken($request);
1038
@@ 1061-1066 (lines=6) @@
1058
    {
1059
        $session = $request->getSession();
1060
1061
        if (!$session->isStarted() || $session->getId() != $sessionId || !$this->hasStoredCsrfToken()) {
1062
            $response = $this->container->get('ezpublish_rest.session_authenticator')->logout($request);
1063
            $response->setStatusCode(404);
1064
1065
            return $response;
1066
        }
1067
1068
        $this->checkCsrfToken($request);
1069