Completed
Push — master ( 8d6a23...e237a8 )
by Michał
02:07
created

Twitter   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 23
c 0
b 0
f 0
wmc 2
lcom 0
cbo 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getIdentifyUrl() 0 4 2
1
<?php namespace nyx\auth\id\protocols\oauth1\providers;
2
3
// Internal dependencies
4
use nyx\auth\id\protocols\oauth1;
5
use nyx\auth;
6
7
/**
8
 * Twitter Identity Provider (OAuth 1.0a)
9
 *
10
 * @package     Nyx\Auth
11
 * @version     0.1.0
12
 * @author      Michal Chojnacki <[email protected]>
13
 * @copyright   2012-2017 Nyx Dev Team
14
 * @link        https://github.com/unyx/nyx
15
 */
16
class Twitter extends oauth1\Provider
17
{
18
    /**
19
     * {@inheritDoc}
20
     */
21
    const URL_REQUEST   = 'https://api.twitter.com/oauth/request_token';
22
    const URL_AUTHORIZE = 'https://api.twitter.com/oauth/authenticate';
23
    const URL_EXCHANGE  = 'https://api.twitter.com/oauth/access_token';
24
    const URL_IDENTIFY  = 'https://api.twitter.com/1.1/account/verify_credentials.json';
25
26
    /**
27
     * {@inheritDoc}
28
     */
29
    const IDENTITY = auth\id\identities\Twitter::class;
30
31
    /**
32
     * {@inheritDoc}
33
     */
34
    public function getIdentifyUrl() : string
35
    {
36
        return static::URL_IDENTIFY . $this->shouldProvideEmailAddress() ? '?include_email=true' : '';
37
    }
38
}
39