Code Duplication    Length = 7-7 lines in 2 locations

EventListener/AttachRefreshTokenOnSuccessListener.php 1 location

@@ 44-50 (lines=7) @@
41
        }
42
43
        $refreshTokenString = null;
44
        if ($request->headers->get('content_type') == 'application/json') {
45
            $content = $request->getContent();
46
            $params = !empty($content) ? json_decode($content, true) : array();
47
            $refreshTokenString = trim($params['refresh_token']);
48
        } else {
49
            $refreshTokenString = $request->request->get('refresh_token');
50
        }
51
52
        if ($refreshTokenString) {
53
            $data['refresh_token'] = $refreshTokenString;

Security/Authenticator/RefreshTokenAuthenticator.php 1 location

@@ 31-37 (lines=7) @@
28
{
29
    public function createToken(Request $request, $providerKey)
30
    {
31
        if ($request->headers->get('content_type') == 'application/json') {
32
            $content = $request->getContent();
33
            $params = !empty($content) ? json_decode($content, true) : array();
34
            $refreshToken = trim($params['refresh_token']);
35
        } else {
36
            $refreshToken = $request->request->get('refresh_token');
37
        }
38
39
        return new PreAuthenticatedToken(
40
            '',