CommonOrder   A
last analyzed

Complexity

Total Complexity 11

Size/Duplication

Total Lines 79
Duplicated Lines 0 %

Test Coverage

Coverage 81.82%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 11
eloc 24
c 1
b 0
f 0
dl 0
loc 79
ccs 27
cts 33
cp 0.8182
rs 10

11 Methods

Rating   Name   Duplication   Size   Complexity  
A withSimpleNotice() 0 5 1
A withElectronicNotice() 0 5 1
A dimensions() 0 5 1
A withSmsNotice() 0 5 1
A fragile() 0 5 1
A withRegisteredNotice() 0 5 1
A transport() 0 5 1
A withCompletenessChecking() 0 5 1
A withInventory() 0 5 1
A viaCourier() 0 5 1
A withVsd() 0 5 1
1
<?php
2
3
/**
4
 * This file is part of RussianPost SDK package.
5
 *
6
 * © Appwilio (http://appwilio.com), greabock (https://github.com/greabock), JhaoDa (https://github.com/jhaoda)
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace Appwilio\RussianPostSDK\Dispatching\Entities;
15
16
use Appwilio\RussianPostSDK\Dispatching\DataAware;
17
18
trait CommonOrder
19
{
20
    use DataAware;
21
22 1
    public function dimensions(int $height, int $width, int $length)
23
    {
24 1
        $this->data['dimension'] = \compact('height', 'width', 'length');
25
26 1
        return $this;
27
    }
28
29 1
    public function fragile(bool $value = true)
30
    {
31 1
        $this->data['fragile'] = $value;
32
33 1
        return $this;
34
    }
35
36
    public function transport(string $value)
37
    {
38
        $this->data['transport-type'] = $value;
39
40
        return $this;
41
    }
42
43 1
    public function withCompletenessChecking(bool $value = true)
44
    {
45 1
        $this->data['completeness-checking'] = $value;
46
47 1
        return $this;
48
    }
49
50 1
    public function withElectronicNotice(bool $value = true)
51
    {
52 1
        $this->data['with-electronic-notice'] = $value;
53
54 1
        return $this;
55
    }
56
57 1
    public function withInventory(bool $value = true)
58
    {
59 1
        $this->data['inventory'] = $value;
60
61 1
        return $this;
62
    }
63
64 1
    public function withRegisteredNotice(bool $value = true)
65
    {
66 1
        $this->data['with-order-of-notice'] = $value;
67
68 1
        return $this;
69
    }
70
71 1
    public function withSimpleNotice(bool $value = true)
72
    {
73 1
        $this->data['with-simple-notice'] = $value;
74
75 1
        return $this;
76
    }
77
78 1
    public function withSmsNotice(bool $value = true)
79
    {
80 1
        $this->data['sms-notice-recipient'] = $value;
81
82 1
        return $this;
83
    }
84
85
    public function withVsd(bool $value = true)
86
    {
87
        $this->data['vsd'] = $value;
88
89
        return $this;
90
    }
91
92 1
    public function viaCourier(bool $value = true)
93
    {
94 1
        $this->data['courier'] = $value;
95
96 1
        return $this;
97
    }
98
}
99