Code Duplication    Length = 10-11 lines in 2 locations

src/Grant/CodeGrant.php 1 location

@@ 67-76 (lines=10) @@
64
     * @param  Scope       $scope
65
     * @return \Psr\Http\Message\ResponseInterface
66
     */
67
    public function auth(Client $http, AuthFactory $factory, Scope $scope = null)
68
    {
69
        return $http->request('POST', static::getPathToOAuthToken($factory->client), [
70
            'form_params' => [
71
                'grant_type' => 'authorization_code',
72
                'code'  => $this->code,
73
                'redirect_uri' => $this->redirect_uri,
74
            ] + static::getFormParamsWithSecret($factory),
75
        ]);
76
    }
77
}
78

src/Grant/PasswordCredential.php 1 location

@@ 39-49 (lines=11) @@
36
     * @param  Scope       $scope
37
     * @return \Psr\Http\Message\ResponseInterface
38
     */
39
    public function auth(Client $http, AuthFactory $factory, Scope $scope)
40
    {
41
        return $http->request('POST', static::getPathToOAuthToken($factory->client), [
42
            'form_params' => [
43
                'grant_type' => 'password',
44
                'username' => $this->username,
45
                'password' => $this->password,
46
                'scope' => (string)$scope,
47
            ] + static::getFormParamsWithSecret($factory),
48
        ]);
49
    }
50
}
51