Conditions | 2 |
Paths | 2 |
Total Lines | 7 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
21 | public static function create(Connector $connector, string $model, array $data = []): Model |
||
22 | { |
||
23 | $model = strtolower($model); |
||
24 | if (!array_key_exists($model, ClassMap::MODELS)) return new LifeboatModel($connector, $data); |
||
25 | |||
26 | $cls = ClassMap::MODELS[$model]; |
||
27 | return new $cls($connector, $data); |
||
28 | } |
||
42 |