Completed
Pull Request — master (#53)
by Romain
03:15
created

PriceList::jsonSerialize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
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
    public function __construct(string $label, string $amount)
25
    {
26
        $this->label = $label;
27
        $this->amount = $amount;
28
    }
29
30
    /**
31
     * @return array
32
     */
33
    public function jsonSerialize(): array
34
    {
35
        return [
36
            'label' => $this->label,
37
            'amount' => $this->amount,
38
        ];
39
    }
40
}
41