Conditions | 3 |
Paths | 4 |
Total Lines | 10 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
60 | 2 | public function addBarcode(string $barcode): BaseActRequest |
|
61 | { |
||
62 | 2 | if ($this->barcodes === null) { |
|
63 | 2 | $this->barcodes = []; |
|
64 | } |
||
65 | 2 | if (in_array($barcode, $this->barcodes)) { |
|
|
|||
66 | 1 | throw new \InvalidArgumentException("Barcode: $barcode already exists."); |
|
67 | } |
||
68 | 2 | $this->barcodes[] = $barcode; |
|
69 | 2 | return $this; |
|
70 | } |
||
72 |