| Conditions | 4 |
| Paths | 10 |
| Total Lines | 15 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 52 | public static function create($ocode) |
||
| 53 | { |
||
| 54 | $name=$ocode; |
||
| 55 | $judgerProvider="Judger"; |
||
| 56 | try { |
||
| 57 | $BabelConfig=json_decode(file_get_contents(babel_path("Extension/$ocode/babel.json")), true); |
||
| 58 | $judgerProvider=$BabelConfig["provider"]["judger"]; |
||
| 59 | } catch (ErrorException $e) { |
||
| 60 | } catch (Exception $e) { |
||
| 61 | } |
||
| 62 | $className="App\\Babel\\Extension\\$name\\$judgerProvider"; |
||
| 63 | if (class_exists($className)) { |
||
| 64 | return new $className(); |
||
| 65 | } else { |
||
| 66 | return null; |
||
| 67 | } |
||
| 70 |