LinkedInApiConfiguration::appPermissions()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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