Completed
Pull Request — master (#472)
by
unknown
02:39
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\Common\Http\Uri\Uri;
7
use OAuth\Common\Consumer\CredentialsInterface;
8
use OAuth\Common\Http\Uri\UriInterface;
9
use OAuth\Common\Storage\TokenStorageInterface;
10
use OAuth\Common\Http\Client\ClientInterface;
11
12
class BitBucket extends AbstractService
13
{
14
    public function __construct(
15
        CredentialsInterface $credentials,
16
        ClientInterface $httpClient,
17
        TokenStorageInterface $storage,
18
        SignatureInterface $signature,
19
        UriInterface $baseApiUri = null
20
    ) {
21
        parent::__construct($credentials, $httpClient, $storage, $signature, $baseApiUri);
22
23
        if (null === $baseApiUri) {
24
            $this->baseApiUri = new Uri('https://bitbucket.org/api/1.0/');
25
        }
26
    }
27
28
    /**
29
     * {@inheritDoc}
30
     */
31
    public function getRequestTokenEndpoint()
32
    {
33
        return new Uri('https://bitbucket.org/!api/1.0/oauth/request_token');
34
    }
35
36
    /**
37
     * {@inheritdoc}
38
     */
39
    public function getAuthorizationEndpoint()
40
    {
41
        return new Uri('https://bitbucket.org/!api/1.0/oauth/authenticate');
42
    }
43
44
    /**
45
     * {@inheritdoc}
46
     */
47
    public function getAccessTokenEndpoint()
48
    {
49
        return new Uri('https://bitbucket.org/!api/1.0/oauth/access_token');
50
    }
51
    
52
}
53