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

Environment::getMerchantData()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
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