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

TwitterConnectionFactory::get()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 3
dl 0
loc 7
ccs 5
cts 5
cp 1
crap 1
rs 10
c 0
b 0
f 0
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