Completed
Pull Request — master (#471)
by
unknown
02:46
created

BitBucket::parseAccessTokenResponse()   B

Complexity

Conditions 4
Paths 3

Size

Total Lines 23
Code Lines 15

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 23
rs 8.7972
cc 4
eloc 15
nc 3
nop 1
1
<?php
2
3
namespace OAuth\OAuth1\Service;
4
5
use OAuth\OAuth1\Signature\SignatureInterface;
6
use OAuth\OAuth1\Token\StdOAuth1Token;
7
use OAuth\Common\Http\Exception\TokenResponseException;
8
use OAuth\Common\Http\Uri\Uri;
9
use OAuth\Common\Consumer\CredentialsInterface;
10
use OAuth\Common\Http\Uri\UriInterface;
11
use OAuth\Common\Storage\TokenStorageInterface;
12
use OAuth\Common\Http\Client\ClientInterface;
13
14
class BitBucket extends AbstractService
15
{
16
    public function __construct(
17
        CredentialsInterface $credentials,
18
        ClientInterface $httpClient,
19
        TokenStorageInterface $storage,
20
        SignatureInterface $signature,
21
        UriInterface $baseApiUri = null
22
    ) {
23
        parent::__construct($credentials, $httpClient, $storage, $signature, $baseApiUri);
24
25
        if (null === $baseApiUri) {
26
            $this->baseApiUri = new Uri('https://bitbucket.org/api/1.0/');
27
        }
28
    }
29
30
    /**
31
     * {@inheritDoc}
32
     */
33
    public function getRequestTokenEndpoint()
34
    {
35
        return new Uri('https://bitbucket.org/!api/1.0/oauth/request_token');
36
    }
37
38
    /**
39
     * {@inheritdoc}
40
     */
41
    public function getAuthorizationEndpoint()
42
    {
43
        return new Uri('https://bitbucket.org/!api/1.0/oauth/authenticate');
44
    }
45
46
    /**
47
     * {@inheritdoc}
48
     */
49
    public function getAccessTokenEndpoint()
50
    {
51
        return new Uri('https://bitbucket.org/!api/1.0/oauth/access_token');
52
    }
53
    
54
}
55