CreateWalletRequest   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getBody() 0 5 2
A __construct() 0 4 1
A getHeaders() 0 3 1
A getPathParams() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * Package: PHP Bitaps API
7
 *
8
 * (c) Eldar Gazaliev <[email protected]>
9
 *
10
 *  Link: <https://github.com/MyZik>
11
 *
12
 * For the full copyright and license information, please view the LICENSE file
13
 * that was distributed with this source code.
14
 */
15
16
namespace Bitaps\WalletAPI\Request;
17
18
class CreateWalletRequest implements RequestInterface
19
{
20
    /**
21
     * Link to the payment notification handler
22
     *
23
     * @var string|null
24
     */
25
    private ?string $callbackLink;
26
27
    /**
28
     * Password
29
     *
30
     * @var string|null
31
     */
32
    private ?string $password;
33
34
    /**
35
     * @param string|null $callbackLink
36
     * @param string|null $password
37
     */
38
    public function __construct(string $callbackLink = null, string $password = null)
39
    {
40
        $this->callbackLink = $callbackLink;
41
        $this->password     = $password;
42
    }
43
44
    /**
45
     * @return string
46
     */
47
    public function getPathParams(): string
48
    {
49
        return '/create/wallet';
50
    }
51
52
    /**
53
     * @return array
54
     */
55
    public function getHeaders(): array
56
    {
57
        return [];
58
    }
59
60
    /**
61
     * @return array
62
     */
63
    public function getBody(): array
64
    {
65
        return [
66
            $this->callbackLink === null ?: 'callback_link' => $this->callbackLink,
67
            'password' => $this->password
68
        ];
69
    }
70
}
71