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