Package::getInsurance()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace MelhorEnvio\Resources\Shipment;
4
5
class Package extends Volume
6
{
7
    /**
8
     * @var int|float
9
     */
10
    protected $insurance;
11
12
    /**
13
     * Package constructor
14
     *
15
     * @param $height
16
     * @param $width
17
     * @param $length
18
     * @param $weight
19
     * @param $insurance
20
     */
21
    public function __construct($height, $width, $length, $weight, $insurance)
22
    {
23
        $this->setHeight($height);
24
        $this->setWidth($width);
25
        $this->setLength($length);
26
        $this->setWeight($weight);
27
        $this->setInsurance($insurance);
28
    }
29
30
    /**
31
     * @return int|float
32
     */
33
    public function getInsurance()
34
    {
35
        return $this->insurance;
36
    }
37
38
    /**
39
     * @param int|float $insurance
40
     */
41
    public function setInsurance($insurance)
42
    {
43
        $this->insurance = $insurance;
44
    }
45
46
    /**
47
     * @return array
48
     */
49
    public function toArray()
50
    {
51
        return [
52
            'height' => $this->getHeight(),
53
            'width' => $this->getWidth(),
54
            'length' => $this->getLength(),
55
            'weight' => $this->getWeight(),
56
            'insurance' => $this->getInsurance(),
57
        ];
58
    }
59
}
60