Passed
Push — master ( 8ed01e...08cfff )
by Romain
02:40
created

PriceList::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
crap 1
1
<?php
2
3
namespace Kerox\Messenger\Model\Common\Button\Payment;
4
5
class PriceList implements \JsonSerializable
6
{
7
8
    /**
9
     * @var string
10
     */
11
    protected $label;
12
13
    /**
14
     * @var string
15
     */
16
    protected $amount;
17
18
    /**
19
     * PriceList constructor.
20
     *
21
     * @param string $label
22
     * @param string $amount
23
     */
24 2
    public function __construct(string $label, string $amount)
25
    {
26 2
        $this->label = $label;
27 2
        $this->amount = $amount;
28 2
    }
29
30
    /**
31
     * @return array
32
     */
33 1
    public function jsonSerialize(): array
34
    {
35
        return [
36 1
            'label' => $this->label,
37 1
            'amount' => $this->amount,
38
        ];
39
    }
40
}
41