Completed
Pull Request — master (#478)
by
unknown
02:35
created

FitBit   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 41
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 13 2
A getRequestTokenEndpoint() 0 4 1
A getAuthorizationEndpoint() 0 4 1
A getAccessTokenEndpoint() 0 4 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 FitBit 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://api.fitbit.com/1/');
25
        }
26
    }
27
28
    /**
29
     * {@inheritdoc}
30
     */
31
    public function getRequestTokenEndpoint()
32
    {
33
        return new Uri('https://api.fitbit.com/oauth/request_token');
34
    }
35
36
    /**
37
     * {@inheritdoc}
38
     */
39
    public function getAuthorizationEndpoint()
40
    {
41
        return new Uri('https://www.fitbit.com/oauth/authorize');
42
    }
43
44
    /**
45
     * {@inheritdoc}
46
     */
47
    public function getAccessTokenEndpoint()
48
    {
49
        return new Uri('https://api.fitbit.com/oauth/access_token');
50
    }
51
    
52
}
53