Code Duplication    Length = 6-6 lines in 2 locations

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

@@ 1050-1055 (lines=6) @@
1047
    {
1048
        $session = $request->getSession();
1049
1050
        if ($session === null || !$session->isStarted() || $session->getId() != $sessionId || !$this->hasStoredCsrfToken()) {
1051
            $response = $this->container->get('ezpublish_rest.session_authenticator')->logout($request);
1052
            $response->setStatusCode(404);
1053
1054
            return $response;
1055
        }
1056
1057
        $this->checkCsrfToken($request);
1058
@@ 1081-1086 (lines=6) @@
1078
    {
1079
        $session = $request->getSession();
1080
1081
        if (!$session->isStarted() || $session->getId() != $sessionId || $this->hasStoredCsrfToken()) {
1082
            $response = $this->container->get('ezpublish_rest.session_authenticator')->logout($request);
1083
            $response->setStatusCode(404);
1084
1085
            return $response;
1086
        }
1087
1088
        $this->checkCsrfToken($request);
1089