Payvessel   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 18
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A virtualAccounts() 0 3 1
A __construct() 0 6 1
1
<?php
2
3
namespace HopekellDev\Payvessel;
4
5
use HopekellDev\Payvessel\Helpers\VirtualAccount;
6
7
class Payvessel
8
{
9
    protected string $baseUrl;
10
    protected string $apiKey;
11
    protected string $apiSecret;
12
    protected string $businessId;
13
14
    public function __construct()
15
    {
16
        $this->baseUrl = rtrim(config('payvessel.base_url'), '/');
0 ignored issues
show
Bug introduced by
The function config was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

16
        $this->baseUrl = rtrim(/** @scrutinizer ignore-call */ config('payvessel.base_url'), '/');
Loading history...
17
        $this->apiKey = config('payvessel.api_key');
18
        $this->apiSecret = config('payvessel.api_secret');
19
        $this->businessId = config('payvessel.business_id');
20
    }
21
22
    public function virtualAccounts(): VirtualAccount
23
    {
24
        return new VirtualAccount($this->apiKey,$this->apiSecret, $this->baseUrl, $this->businessId);
25
    }
26
}
27