Code Duplication    Length = 9-10 lines in 2 locations

src/AppBundle/Security/ApiKeyAuthenticator.php 2 locations

@@ 88-97 (lines=10) @@
85
    /**
86
     * {@inheritdoc}
87
     */
88
    public function onAuthenticationFailure(Request $request, AuthenticationException $exception)
89
    {
90
        $this->saveSwindler($request);
91
        $data = [
92
            'code' => '403',
93
            'message' => 'Forbidden. You don\'t have necessary permissions for the resource',
94
        ];
95
96
        return new JsonResponse($data, Response::HTTP_FORBIDDEN);
97
    }
98
99
    /**
100
     * {@inheritdoc}
@@ 102-110 (lines=9) @@
99
    /**
100
     * {@inheritdoc}
101
     */
102
    public function start(Request $request, AuthenticationException $authException = null)
103
    {
104
        $data = [
105
            'code' => '401',
106
            'message' => 'Authentication required',
107
        ];
108
109
        return new JsonResponse($data, Response::HTTP_UNAUTHORIZED);
110
    }
111
112
    /**
113
     * {@inheritdoc}