InvoiceExtraTransfer   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
c 0
b 0
f 0
dl 0
loc 17
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A fromArray() 0 7 1
A __construct() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace PhpLightning\Shared\Transfer;
6
7
final class InvoiceExtraTransfer
8
{
9
    public function __construct(
10
        public string $walletFiatCurrency,
11
        public float $walletFiatAmount,
12
        public float $walletFiatRate,
13
        public float $walletBtcRate,
14
    ) {
15
    }
16
17
    public static function fromArray(array $array): self
18
    {
19
        return new self(
20
            walletFiatCurrency: (string) $array['wallet_fiat_currency'],
21
            walletFiatAmount: (float) $array['wallet_fiat_amount'],
22
            walletFiatRate: (float) $array['wallet_fiat_rate'],
23
            walletBtcRate: (float) $array['wallet_btc_rate'],
24
        );
25
    }
26
}
27