Consumer   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 71
Duplicated Lines 0 %

Test Coverage

Coverage 86.67%

Importance

Changes 0
Metric Value
eloc 13
dl 0
loc 71
rs 10
c 0
b 0
f 0
ccs 13
cts 15
cp 0.8667
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A setPublic() 0 3 1
A getKey() 0 3 1
A __toString() 0 3 1
A getSecret() 0 3 1
A __construct() 0 5 1
A getPublic() 0 3 1
1
<?php
2
/**
3
 * SocialConnect project
4
 * @author: Patsura Dmitry https://github.com/ovr <[email protected]>
5
 */
6
declare(strict_types=1);
7
8
namespace SocialConnect\Provider;
9
10
class Consumer
11
{
12
    /**
13
     * @var string
14
     */
15
    protected $key;
16
17
    /**
18
     * @var string
19
     */
20
    protected $secret;
21
22
    /**
23
     * Some API's need another key then secret for API requests
24
     *
25
     * @var string
26
     */
27
    protected $public;
28
29
    /**
30
     * @var string|null
31
     */
32
    public $callback_url;
33
34
    /**
35
     * @param string $key
36
     * @param string $secret
37
     * @param string|null $callback_url
38
     */
39 453
    public function __construct($key, $secret, $callback_url = null)
40
    {
41 453
        $this->key = $key;
42 453
        $this->secret = $secret;
43 453
        $this->callback_url = $callback_url;
44 453
    }
45
46
    public function __toString()
47
    {
48
        return "OAuthConsumer[key=$this->key,secret=$this->secret]";
49
    }
50
51
    /**
52
     * @return string
53
     */
54 57
    public function getKey()
55
    {
56 57
        return $this->key;
57
    }
58
59
    /**
60
     * @return string
61
     */
62 43
    public function getSecret()
63
    {
64 43
        return $this->secret;
65
    }
66
67
    /**
68
     * @return string
69
     */
70 3
    public function getPublic()
71
    {
72 3
        return $this->public;
73
    }
74
75
    /**
76
     * @param string $public
77
     */
78 15
    public function setPublic($public)
79
    {
80 15
        $this->public = $public;
81 15
    }
82
}
83