DeliveryOption   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 86
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 1 Features 0
Metric Value
wmc 5
c 3
b 1
f 0
lcom 0
cbo 0
dl 0
loc 86
ccs 14
cts 14
cp 1
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A service() 0 4 1
A type() 0 4 1
A tariff() 0 4 1
A estimatedDays() 0 4 1
1
<?php
2
3
namespace Jne;
4
5
use Jne\Contracts\Foundation\DeliveryOptionInterface;
6
7
class DeliveryOption implements DeliveryOptionInterface
8
{
9
    /**
10
     * Delivery's service type.
11
     *
12
     * @var string
13
     */
14
    protected $service;
15
16
    /**
17
     * Delivery's type.
18
     *
19
     * @var string
20
     */
21
    protected $type;
22
23
    /**
24
     * Delivery's tariff.
25
     *
26
     * @var int|float
27
     */
28
    protected $tariff;
29
30
    /**
31
     * Delivery's estimated days.
32
     *
33
     * @var string|null
34
     */
35
    protected $estimatedDays;
36
37
    /**
38
     * Create a new instance of delivery.
39
     *
40
     * @param string      $service
41
     * @param string      $type
42
     * @param int|float   $tariff
43
     * @param string|null $estimatedDays
44
     */
45 6
    public function __construct($service, $type, $tariff, $estimatedDays = null)
46
    {
47 6
        $this->service = $service;
48 6
        $this->type = $type;
49 6
        $this->tariff = $tariff;
50 6
        $this->estimatedDays = $estimatedDays;
51 6
    }
52
53
    /**
54
     * Get delivery's service.
55
     *
56
     * @return string
57
     */
58 2
    public function service()
59
    {
60 2
        return $this->service;
61
    }
62
63
    /**
64
     * Get delivery's type.
65
     *
66
     * @return string
67
     */
68 2
    public function type()
69
    {
70 2
        return $this->type;
71
    }
72
73
    /**
74
     * Get delivery's tariff.
75
     *
76
     * @return int|float
77
     */
78 2
    public function tariff()
79
    {
80 2
        return $this->tariff;
81
    }
82
83
    /**
84
     * Get delivery's estimated days.
85
     *
86
     * @return string|null
87
     */
88 2
    public function estimatedDays()
89
    {
90 2
        return $this->estimatedDays;
91
    }
92
}
93