| Conditions | 3 |
| Paths | 3 |
| Total Lines | 11 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 4 |
| CRAP Score | 3.3332 |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | 16 | public static function resolveEntityClass(string $class, $property, string $bot_username = ''): Entity |
|
| 10 | { |
||
| 11 | 16 | if (is_a($property, $class)) { |
|
| 12 | 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 |