These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace Gbowo\Adapter\Paystack\Traits; |
||
4 | |||
5 | use function GuzzleHttp\json_encode; |
||
6 | use Psr\Http\Message\ResponseInterface; |
||
7 | |||
8 | /** |
||
9 | * @author Lanre Adelowo <[email protected]> |
||
10 | * Class Payable |
||
11 | * @package Gbowo\Adapter\Paystack\Traits |
||
12 | */ |
||
13 | trait Payable |
||
14 | { |
||
15 | |||
16 | /** |
||
17 | * @param string $relative |
||
18 | * @param array $data |
||
19 | * @return \Psr\Http\Message\ResponseInterface |
||
20 | */ |
||
21 | 3 | protected function authorizeTransaction(string $relative, array $data = []) |
|
22 | { |
||
23 | 3 | return $this->httpClient->post( |
|
0 ignored issues
–
show
|
|||
24 | 3 | $this->baseUrl . $relative, [ |
|
0 ignored issues
–
show
The property
baseUrl does not exist. Did you maybe forget to declare it?
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code: class MyClass { }
$x = new MyClass();
$x->foo = true;
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: class MyClass {
public $foo;
}
$x = new MyClass();
$x->foo = true;
Loading history...
|
|||
25 | 3 | 'body' => json_encode($data) |
|
26 | ] |
||
27 | ); |
||
28 | } |
||
29 | } |
||
30 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: