Passed
Pull Request — master (#6)
by Tharanga
09:58
created

ZoomConnectionFactory::get()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 6
c 1
b 0
f 0
nc 1
nop 3
dl 0
loc 9
rs 10
1
<?php
2
/**
3
 * @author Tharanga Kothalawala <[email protected]>
4
 * @date   28-10-2020
5
 */
6
7
namespace TSK\SSO\ThirdParty\Zoom;
8
9
use TSK\SSO\ThirdParty\VendorConnection;
10
use TSK\SSO\ThirdParty\VendorConnectionFactory;
11
use TSK\SSO\Http\CurlRequest;
12
13
/**
14
 * @package TSK\SSO\ThirdParty\Zoom
15
 */
16
class ZoomConnectionFactory implements VendorConnectionFactory
17
{
18
    /**
19
     * @param string $clientId     the client id which can be generated at the third party portal
20
     * @param string $clientSecret this can be found similar to the clientId
21
     * @param string $callbackUrl  the url to callback after a third party auth attempt
22
     *
23
     * @return VendorConnection
24
     */
25
    public function get($clientId, $clientSecret, $callbackUrl)
26
    {
27
        return new ZoomConnection(
28
            new ZoomApiConfiguration(
29
                $clientId,
30
                $clientSecret,
31
                $callbackUrl
32
            ),
33
            new CurlRequest()
34
        );
35
    }
36
}
37