| Conditions | 3 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | 546 | static public function fromMap(array $exceptionMap, $error, $path) { |
|
| 27 | 546 | if (isset($exceptionMap[$error])) { |
|
| 28 | 74 | $exceptionClass = $exceptionMap[$error]; |
|
| 29 | 74 | if (is_numeric($error)) { |
|
| 30 | 36 | return new $exceptionClass($path, $error); |
|
| 31 | } else { |
||
| 32 | 38 | return new $exceptionClass($path); |
|
| 33 | } |
||
| 34 | } else { |
||
| 35 | 510 | return Exception::unknown($path, $error); |
|
| 36 | } |
||
| 37 | } |
||
| 38 | } |
||
| 39 |