| Conditions | 7 |
| Paths | 64 |
| Total Lines | 28 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 20 |
| CRAP Score | 7 |
| Changes | 5 | ||
| Bugs | 0 | Features | 3 |
| 1 | <?php |
||
| 11 | 8 | protected function validate($transfer) |
|
| 12 | { |
||
| 13 | 8 | if (empty($transfer->getVentureOrderItemId())) { |
|
| 14 | 2 | $this->errors[] = 'Order item id can\'t be empty'; |
|
| 15 | 2 | } |
|
| 16 | |||
| 17 | 8 | if (empty($transfer->getDeliveryType())) { |
|
| 18 | 2 | $this->errors[] = 'Delivery type can\'t be empty'; |
|
| 19 | 2 | } |
|
| 20 | |||
| 21 | 8 | if (empty($transfer->getShippingProvider())) { |
|
| 22 | 2 | $this->errors[] = 'Shipping provider can\'t be empty'; |
|
| 23 | 2 | } |
|
| 24 | |||
| 25 | 8 | if (empty($transfer->getTrackingUrl())) { |
|
| 26 | 2 | $this->errors[] = 'Tracking number can\'t be empty'; |
|
| 27 | 2 | } |
|
| 28 | |||
| 29 | 8 | if (empty($transfer->getPartnerCode())) { |
|
| 30 | 2 | $this->errors[] = 'Partner code can\'t be empty'; |
|
| 31 | 2 | } |
|
| 32 | |||
| 33 | 8 | if (empty($transfer->getVentureOrderNumber())) { |
|
| 34 | 2 | $this->errors[] = 'Venture order number can\'t be empty'; |
|
| 35 | 2 | } |
|
| 36 | |||
| 37 | 8 | return empty($this->errors); |
|
| 38 | } |
||
| 39 | } |
||
| 40 |