Parcel::box_type()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
namespace OceanApplications\Postmen\Models;
4
5
class Parcel extends Model
6
{
7
    public $box_type;
8
    public $dimension;
9
    public $items = [];
10
    public $description;
11
    public $weight;
12
13
    /**
14
     * @param string $value
15
     *
16
     * @return $this
17
     */
18
    public function box_type($value)
19
    {
20
        $this->box_type = strval($value);
21
22
        return $this;
23
    }
24
25
    /**
26
     * @param Dimension $dimension
27
     *
28
     * @return $this
29
     */
30
    public function dimension(Dimension $dimension)
31
    {
32
        $this->dimension = $dimension;
33
34
        return $this;
35
    }
36
37
    /**
38
     * @param Item $item
39
     *
40
     * @return $this
41
     */
42
    public function items(Item $item)
43
    {
44
        array_push($this->items, $item);
45
46
        return $this;
47
    }
48
49
    /**
50
     * @param $value
51
     *
52
     * @return $this
53
     */
54
    public function description($value)
55
    {
56
        $this->description = strval($value);
57
58
        return $this;
59
    }
60
61
    /**
62
     * @param Weight $weight
63
     *
64
     * @return $this
65
     */
66
    public function weight(Weight $weight)
67
    {
68
        $this->weight = $weight;
69
70
        return $this;
71
    }
72
}
73