Conditions | 2 |
Paths | 2 |
Total Lines | 8 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
16 | 5 | public function make($className) |
|
17 | { |
||
18 | 5 | if (! (new \ReflectionClass($className))->implementsInterface(ActiveRecordInterface::class)) { |
|
19 | 1 | throw new \InvalidArgumentException("Cannot initiate a class ({$className}) which doesn't implement \\yii\\db\\ActiveRecordInterface"); |
|
20 | } |
||
21 | |||
22 | 4 | return new $className(); |
|
23 | } |
||
24 | } |
||
25 |