Conditions | 3 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 3.0416 |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | 18 | public static function resolveEntityClass(string $class, $property, string $bot_username = ''): Entity |
|
10 | { |
||
11 | 18 | if (is_a($property, $class)) { |
|
12 | 2 | return $property; |
|
13 | } |
||
14 | |||
15 | 16 | if (is_subclass_of($class, Factory::class)) { |
|
16 | return $class::make($property, $bot_username); |
||
17 | } |
||
18 | |||
19 | 16 | return new $class($property, $bot_username); |
|
20 | } |
||
22 |