| Conditions | 3 |
| Paths | 3 |
| Total Lines | 10 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 3.0416 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 34 | 20 | public static function fromArray(array $data, $context = null) |
|
| 35 | { |
||
| 36 | 20 | if (isset($data['code'])) { |
|
| 37 | 20 | $className = sprintf('\Commercetools\Core\Error\%sError', self::pascalcase($data['code'])); |
|
| 38 | 20 | if (class_exists($className)) { |
|
| 39 | 20 | return new $className($data, $context); |
|
| 40 | } |
||
| 41 | } |
||
| 42 | return new static($data, $context); |
||
| 43 | } |
||
| 44 | |||
| 58 |