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

Redmine   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 5
c 2
b 0
f 0
lcom 1
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 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