| Total Complexity | 10 |
| Total Lines | 112 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 3 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 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 float */ |
||
| 16 | public $_retprice; |
||
| 17 | /** @var int */ |
||
| 18 | public $_barcode; |
||
| 19 | /** @var string */ |
||
| 20 | public $_article; |
||
| 21 | /** @var bool|null */ |
||
| 22 | public $_return; |
||
| 23 | /** @var string|null */ |
||
| 24 | public $_governmentCode; |
||
| 25 | |||
| 26 | |||
| 27 | /** |
||
| 28 | * @param int $quantity |
||
| 29 | 2 | * @return Item |
|
| 30 | */ |
||
| 31 | 2 | public function setQuantity(int $quantity) |
|
| 32 | 2 | { |
|
| 33 | $this->_quantity = $quantity; |
||
| 34 | return $this; |
||
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @param float $_weight |
||
| 39 | * @return Item |
||
| 40 | 2 | * @return Item |
|
| 41 | */ |
||
| 42 | 2 | public function setWeight(float $_weight) |
|
| 43 | 2 | { |
|
| 44 | $this->_weight = $_weight; |
||
| 45 | return $this; |
||
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * @param float $retprice |
||
| 50 | * @return Item |
||
| 51 | 2 | * @return Item |
|
| 52 | */ |
||
| 53 | 2 | public function setRetprice(float $retprice) |
|
| 54 | 2 | { |
|
| 55 | $this->_retprice = $retprice; |
||
| 56 | return $this; |
||
| 57 | } |
||
| 58 | |||
| 59 | /** |
||
| 60 | * @param string $_barcode |
||
| 61 | * @return Item |
||
| 62 | 5 | * @return Item |
|
| 63 | */ |
||
| 64 | 5 | public function setBarcode(string $_barcode) |
|
| 68 | } |
||
| 69 | |||
| 70 | /** |
||
| 71 | * @param string $_article |
||
| 72 | * @return Item |
||
| 73 | 1 | * @return Item |
|
| 74 | */ |
||
| 75 | 1 | public function setArticle(string $_article) |
|
| 76 | 1 | { |
|
| 77 | $this->_article = $_article; |
||
| 78 | return $this; |
||
| 79 | } |
||
| 80 | |||
| 81 | /** |
||
| 82 | * @param string $title |
||
| 83 | 1 | * @return self |
|
| 84 | */ |
||
| 85 | 1 | public function setTitle(string $title): self |
|
| 89 | } |
||
| 90 | |||
| 91 | /** |
||
| 92 | * @param bool $return |
||
| 93 | 3 | * @return self; |
|
| 94 | */ |
||
| 95 | 3 | public function setReturn(bool $return): self |
|
| 99 | } |
||
| 100 | |||
| 101 | /** |
||
| 102 | 2 | * @return bool|null |
|
| 103 | */ |
||
| 104 | 2 | public function isReturned(): ?bool |
|
| 107 | } |
||
| 108 | |||
| 109 | /** |
||
| 110 | * @param string $code |
||
| 111 | * @return self; |
||
| 112 | */ |
||
| 113 | public function setGovernmentCode(?string $code): self |
||
| 119 | } |
||
| 120 | } |
||
| 121 |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.