WalletStateRequest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 60
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 12
c 1
b 0
f 0
dl 0
loc 60
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getBody() 0 3 1
A __construct() 0 5 1
A getPathParams() 0 3 1
A getHeaders() 0 5 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 WalletStateRequest implements RequestInterface
19
{
20
    /**
21
     * Wallet ID
22
     *
23
     * @var string
24
     */
25
    public string $walletId;
26
27
    /**
28
     * Nonce used for HMAC signature
29
     *
30
     * @var float|null
31
     */
32
    public ?float $nonce;
33
34
    /**
35
     * HMAC signature
36
     *
37
     * @var string|null
38
     */
39
    public ?string $signature;
40
41
    /**
42
     * @param string      $walletId
43
     * @param float|null  $nonce
44
     * @param string|null $signature
45
     */
46
    public function __construct(string $walletId, float $nonce = null, string $signature = null)
47
    {
48
        $this->walletId  = $walletId;
49
        $this->nonce     = $nonce;
50
        $this->signature = $signature;
51
    }
52
53
    /**
54
     * @return array
55
     */
56
    public function getHeaders(): array
57
    {
58
        return [
59
            'Access-Nonce' => $this->nonce,
60
            'Access-Signature' => $this->signature
61
        ];
62
    }
63
64
    /**
65
     * @return string
66
     */
67
    public function getPathParams(): string
68
    {
69
        return sprintf('/wallet/state/%s', $this->walletId);
70
    }
71
72
    /**
73
     * @return array
74
     */
75
    public function getBody(): array
76
    {
77
        return [];
78
    }
79
}
80