OAuthConsumer::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 3
1
<?php
2
3
namespace Omnipay\Pesapal\OAuth;
4
5
class OAuthConsumer
6
{
7
    /**
8
     * @var string
9
     */
10
    public $key;
11
12
    /**
13
     * @var string
14
     */
15
    public $secret;
16
17
    /**
18
     * @param $key
19
     * @param $secret
20
     * @param null $callback_url
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $callback_url is correct as it would always require null to be passed?
Loading history...
21
     */
22
    public function __construct(
23
        $key,
24
        $secret,
25
        $callback_url = null
26
    ) {
27
        $this->key = $key;
28
        $this->secret = $secret;
29
        $this->callback_url = $callback_url;
0 ignored issues
show
Bug Best Practice introduced by
The property callback_url does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
30
    }
31
32
    /**
33
     * @return string
34
     */
35
    public function __toString(): string
36
    {
37
        return "OAuthConsumer[key=$this->key,secret=$this->secret]";
38
    }
39
}
40