Passed
Push — master ( 2cdaae...14b6d5 )
by Jhao
02:25
created

CommonOrder   A

Complexity

Total Complexity 11

Size/Duplication

Total Lines 77
Duplicated Lines 0 %

Test Coverage

Coverage 81.82%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 11
eloc 23
c 1
b 0
f 0
dl 0
loc 77
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
trait CommonOrder
17
{
18 1
    public function dimensions(int $height, int $width, int $length)
19
    {
20 1
        $this->data['dimension'] = \compact('height', 'width', 'length');
0 ignored issues
show
Bug Best Practice introduced by
The property data does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
21
22 1
        return $this;
23
    }
24
25 1
    public function fragile(bool $value = true)
26
    {
27 1
        $this->data['fragile'] = $value;
0 ignored issues
show
Bug Best Practice introduced by
The property data does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
28
29 1
        return $this;
30
    }
31
32
    public function transport(string $value)
33
    {
34
        $this->data['transport-type'] = $value;
0 ignored issues
show
Bug Best Practice introduced by
The property data does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
35
36
        return $this;
37
    }
38
39 1
    public function withCompletenessChecking(bool $value = true)
40
    {
41 1
        $this->data['completeness-checking'] = $value;
0 ignored issues
show
Bug Best Practice introduced by
The property data does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
42
43 1
        return $this;
44
    }
45
46 1
    public function withElectronicNotice(bool $value = true)
47
    {
48 1
        $this->data['with-electronic-notice'] = $value;
0 ignored issues
show
Bug Best Practice introduced by
The property data does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
49
50 1
        return $this;
51
    }
52
53 1
    public function withInventory(bool $value = true)
54
    {
55 1
        $this->data['inventory'] = $value;
0 ignored issues
show
Bug Best Practice introduced by
The property data does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
56
57 1
        return $this;
58
    }
59
60 1
    public function withRegisteredNotice(bool $value = true)
61
    {
62 1
        $this->data['with-order-of-notice'] = $value;
0 ignored issues
show
Bug Best Practice introduced by
The property data does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
63
64 1
        return $this;
65
    }
66
67 1
    public function withSimpleNotice(bool $value = true)
68
    {
69 1
        $this->data['with-simple-notice'] = $value;
0 ignored issues
show
Bug Best Practice introduced by
The property data does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
70
71 1
        return $this;
72
    }
73
74 1
    public function withSmsNotice(bool $value = true)
75
    {
76 1
        $this->data['sms-notice-recipient'] = $value;
0 ignored issues
show
Bug Best Practice introduced by
The property data does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
77
78 1
        return $this;
79
    }
80
81
    public function withVsd(bool $value = true)
82
    {
83
        $this->data['vsd'] = $value;
0 ignored issues
show
Bug Best Practice introduced by
The property data does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
84
85
        return $this;
86
    }
87
88 1
    public function viaCourier(bool $value = true)
89
    {
90 1
        $this->data['courier'] = $value;
0 ignored issues
show
Bug Best Practice introduced by
The property data does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
91
92 1
        return $this;
93
    }
94
}
95