Completed
Push — master ( 9be2e3...3a8fde )
by Gaël
14:21
created

CartItemResource::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 3
nc 1
nop 2
dl 0
loc 5
rs 10
c 1
b 0
f 1
1
<?php
2
3
4
namespace DansMaCulotte\Monetico\Resources;
5
6
use DansMaCulotte\Monetico\Exceptions\Exception;
7
8
class CartItemResource extends Ressource
9
{
10
    protected $keys = [
11
        'name',
12
        'description',
13
        'productCode',
14
        'imageURL',
15
        'unitPrice',
16
        'quantity',
17
        'productSKU',
18
        'productRisk',
19
    ];
20
21
    /**
22
     * CartItemResource constructor.
23
     * @param int $unitPrice
24
     * @param int $quantity
25
     * @throws Exception
26
     */
27
    public function __construct(int $unitPrice, int $quantity)
28
    {
29
        parent::__construct([
30
            'unitPrice' => $unitPrice,
31
            'quantity' => $quantity,
32
        ]);
33
    }
34
}
35