| Conditions | 3 |
| Paths | 4 |
| Total Lines | 12 |
| Lines | 12 |
| Ratio | 100 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 50 | View Code Duplication | public static function fromProductClass($errorMessage, ProductClass $ProductClass) |
|
| 51 | { |
||
| 52 | $productName = $ProductClass->getProduct()->getName(); |
||
| 53 | if ($ProductClass->hasClassCategory1()) { |
||
| 54 | $productName .= ' - '.$ProductClass->getClassCategory1()->getName(); |
||
| 55 | } |
||
| 56 | if ($ProductClass->hasClassCategory2()) { |
||
| 57 | $productName .= ' - '.$ProductClass->getClassCategory2()->getName(); |
||
| 58 | } |
||
| 59 | |||
| 60 | return new self($errorMessage, ['%product%' => $productName]); |
||
| 61 | } |
||
| 62 | } |
||
| 63 |