Completed
Push — master ( 2c9601...116879 )
by Дмитрий
04:44
created

Consumer   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 73
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 56.25%

Importance

Changes 0
Metric Value
wmc 6
lcom 0
cbo 0
dl 0
loc 73
ccs 9
cts 16
cp 0.5625
rs 10
c 0
b 0
f 0

6 Methods

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