Test Failed
Push — master ( c284ba...f1f4ff )
by Mehmet
02:24
created

Environment   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 28
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getUrl() 0 4 1
A getMerchantData() 0 8 1
1
<?php declare(strict_types=1);
2
3
namespace MerchantSafeUnipay\SDK;
4
5
class Environment
6
{
7
    protected $merchant;
8
    protected $merchantUser;
9
    protected $merchantPassword;
10
11
    public function __construct(string $apiUrl, string $merchant, string $merchantUser, string $merchantPassword)
12
    {
13
        $this->apiUrl = $apiUrl;
0 ignored issues
show
Bug introduced by
The property apiUrl 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...
14
        $this->merchant = $merchant;
15
        $this->merchantUser = $merchantUser;
16
        $this->merchantPassword = $merchantPassword;
17
    }
18
19
    public function getUrl()
20
    {
21
        return $this->apiUrl;
22
    }
23
24
    public function getMerchantData()
25
    {
26
        return [
27
            'MERCHANT' => $this->merchant,
28
            'MERCHANTUSER' => $this->merchantUser,
29
            'MERCHANTPASSWORD' => $this->merchantPassword
30
        ];
31
    }
32
}
33