Completed
Pull Request — master (#472)
by
unknown
02:39
created

Redmine::parseAccessTokenResponse()   B

Complexity

Conditions 4
Paths 3

Size

Total Lines 23
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 23
rs 8.7972
c 1
b 0
f 0
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 Redmine extends AbstractService
13
{
14
    public function __construct(
15
        CredentialsInterface $credentials,
16
        ClientInterface $httpClient,
17
        TokenStorageInterface $storage,
18
        SignatureInterface $signature,
19
        UriInterface $baseApiUri
20
    ) {
21
        parent::__construct($credentials, $httpClient, $storage, $signature, $baseApiUri);
22
23
        if (null === $baseApiUri) {
24
            throw new \Exception('baseApiUri is a required argument.');
25
        }
26
    }
27
28
    /**
29
     * {@inheritDoc}
30
     */
31
    public function getRequestTokenEndpoint()
32
    {
33
        return new Uri($this->baseApiUri->getAbsoluteUri() . '/request_token');
34
    }
35
36
    /**
37
     * {@inheritdoc}
38
     */
39
    public function getAuthorizationEndpoint()
40
    {
41
        return new Uri($this->baseApiUri->getAbsoluteUri() . '/authorize');
42
    }
43
44
    /**
45
     * {@inheritdoc}
46
     */
47
    public function getAccessTokenEndpoint()
48
    {
49
        return new Uri($this->baseApiUri->getAbsoluteUri() . '/access_token');
50
    }
51
    
52
}
53