LinkedInApiConfiguration   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 76
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 14
c 1
b 0
f 0
dl 0
loc 76
rs 10
ccs 16
cts 16
cp 1
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A appPermissions() 0 3 1
A ourSecretState() 0 3 1
A appSecret() 0 3 1
A appId() 0 3 1
A __construct() 0 6 1
A redirectUrl() 0 3 1
1
<?php
2
/**
3
 * @author Tharanga Kothalawala <[email protected]>
4
 * @date 31-12-2018
5
 */
6
7
namespace TSK\SSO\ThirdParty\LinkedIn;
8
9
/**
10
 * @package TSK\SSO\ThirdParty\LinkedIn
11
 * @see https://developer.linkedin.com/docs/oauth2
12
 */
13
class LinkedInApiConfiguration
14
{
15
    /**
16
     * @var string
17
     */
18
    private $appId;
19
20
    /**
21
     * @var string
22
     */
23
    private $appSecret;
24
25
    /**
26
     * @var string
27
     */
28
    private $appPermissions;
29
30
    /**
31
     * @var string
32
     */
33
    private $redirectUrl;
34
35
    /**
36
     * @param string $appId
37
     * @param string $appSecret
38
     * @param string $appPermissions
39
     * @param string $redirectUrl
40
     */
41 2
    public function __construct($appId, $appSecret, $appPermissions, $redirectUrl)
42
    {
43 2
        $this->appId = $appId;
44 2
        $this->appSecret = $appSecret;
45 2
        $this->appPermissions = $appPermissions;
46 2
        $this->redirectUrl = $redirectUrl;
47 2
    }
48
49
    /**
50
     * @return string
51
     */
52 1
    public function appId()
53
    {
54 1
        return $this->appId;
55
    }
56
57
    /**
58
     * @return string
59
     */
60 1
    public function appSecret()
61
    {
62 1
        return $this->appSecret;
63
    }
64
65
    /**
66
     * @return string
67
     */
68 1
    public function appPermissions()
69
    {
70 1
        return $this->appPermissions;
71
    }
72
73
    /**
74
     * @return string
75
     */
76 1
    public function redirectUrl()
77
    {
78 1
        return $this->redirectUrl;
79
    }
80
81
    /**
82
     * This is just to identify that, we initiated the login sequence (not someone else) and to prevent CSRF.
83
     *
84
     * @return string
85
     */
86 1
    public function ourSecretState()
87
    {
88 1
        return 'dfeb6ef625880832f61c6f4bd737e11b';
89
    }
90
}
91