| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 32 | public static function readFile(/*# string */ $path) |
||
| 33 | { |
||
| 34 | // check first |
||
| 35 | static::checkPath($path); |
||
| 36 | |||
| 37 | // can not catch syntext error |
||
| 38 | try { |
||
| 39 | $data = include $path; |
||
| 40 | } catch (\Exception $exception) { |
||
| 41 | throw new RuntimeException( |
||
| 42 | $exception->getMessage(), |
||
| 43 | $exception->getCode() |
||
| 44 | ); |
||
| 45 | } |
||
| 46 | return $data; |
||
| 47 | } |
||
| 48 | } |
||
| 49 |