Conditions | 2 |
Paths | 2 |
Total Lines | 9 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
20 | 61 | public static function create(string $name = Templates::BASE): TemplateInterface |
|
21 | { |
||
22 | 61 | $class = __NAMESPACE__ . '\\Templates\\' . ucwords($name) . 'Template'; |
|
23 | |||
24 | 61 | if (class_exists($class)) { |
|
25 | 60 | return new $class(); |
|
26 | } |
||
27 | |||
28 | 1 | throw new FlashTemplateNotFoundException("Template \"{$name}\" not found!"); |
|
29 | } |
||
31 |