Test Failed
Push — master ( 222832...e0456b )
by Evgenii
02:52
created

Item::isReturned()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
ccs 0
cts 0
cp 0
crap 2
1
<?php
2
3
4
namespace floor12\DalliApi\Models;
5
6
7
class Item extends BaseXmlObject
8
{
9
    /** @var string */
10
    public $title;
11
    /** @var int */
12
    public $_quantity = 1;
13
    /** @var float */
14
    public $_weight;
15
    /** @var int */
16
    public $_retprice;
17
    /** @var int */
18
    public $_barcode;
19
    /** @var string */
20
    public $_article;
21
    /** @var bool|null */
22
    public $_return;
23
24
25
    /**
26
     * @param int $quantity
27 2
     * @return Item
28
     */
29 2
    public function setQuantity(int $quantity)
30 2
    {
31
        $this->_quantity = $quantity;
32
        return $this;
33
    }
34
35
    /**
36
     * @param float $_weight
37
     * @return Item
38 2
     * @return Item
39
     */
40 2
    public function setWeight(float $_weight)
41 2
    {
42
        $this->_weight = $_weight;
43
        return $this;
44
    }
45
46
    /**
47
     * @param int $retprice
48
     * @return Item
49 2
     * @return Item
50
     */
51 2
    public function setRetprice(int $retprice)
52 2
    {
53
        $this->_retprice = $retprice;
54
        return $this;
55
    }
56
57
    /**
58
     * @param int $_barcode
59
     * @return Item
60 3
     * @return Item
61
     */
62 3
    public function setBarcode(int $_barcode)
63 3
    {
64
        $this->_barcode = $_barcode;
65
        return $this;
66
    }
67
68
    /**
69
     * @param string $_article
70
     * @return Item
71 1
     * @return Item
72
     */
73 1
    public function setArticle(string $_article)
74 1
    {
75
        $this->_article = $_article;
76
        return $this;
77
    }
78
79
    /**
80
     * @param string $title
81 1
     * @return self
82
     */
83 1
    public function setTitle(string $title): self
84 1
    {
85
        $this->title = $title;
86
        return $this;
87
    }
88
89
    /**
90
     * @param bool $return
91
     * @return self;
92
     */
93
    public function setReturn(bool $return): self
94
    {
95
        $this->_return = $return;
96
        return $this;
97
    }
98
99
    public function isReturned(): bool
100
    {
101
        return $this->_return;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->_return could return the type null which is incompatible with the type-hinted return boolean. Consider adding an additional type-check to rule them out.
Loading history...
102
    }
103
}
104