Completed
Push — master ( 0e9e0f...df062e )
by Tharanga
02:28
created

TwitterConnectionFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 18
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A get() 0 7 1
1
<?php
2
/**
3
 * @author Tharanga Kothalawala <[email protected]>
4
 * @date 13-01-2019
5
 */
6
7
namespace TSK\SSO\ThirdParty\Twitter;
8
9
use TSK\SSO\ThirdParty\VendorConnection;
10
use TSK\SSO\ThirdParty\VendorConnectionFactory;
11
12
/**
13
 * @package TSK\SSO\ThirdParty\Twitter
14
 */
15
class TwitterConnectionFactory implements VendorConnectionFactory
16
{
17
    /**
18
     * Returns a Twitter Connection instance using given credentials. Visit the following link for credentials.
19
     * @see https://developer.twitter.com/en/apps
20
     *
21
     * @param string $clientId the client id which can be generated at the third party portal
22
     * @param string $clientSecret this can be found similar to the clientId
23
     * @param string $callbackUrl the url to callback after a third party auth attempt
24
     * @return VendorConnection
25
     */
26 1
    public function get($clientId, $clientSecret, $callbackUrl)
27
    {
28 1
        return new TwitterConnection(
29 1
            new TwitterApiConfiguration(
30 1
                $clientId,
31 1
                $clientSecret,
32
                $callbackUrl
33 1
            )
34 1
        );
35
    }
36
}
37