| Total Complexity | 9 |
| Total Lines | 73 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | abstract class Framework |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var string |
||
| 12 | */ |
||
| 13 | protected $name; |
||
| 14 | |||
| 15 | public function __construct(string $name) |
||
| 16 | { |
||
| 17 | $this->name = $name; |
||
| 18 | } |
||
| 19 | |||
| 20 | public static function factory(string $framework = ''): Framework |
||
| 21 | { |
||
| 22 | $class = "\\Formularium\\Frontend\\$framework\\Framework"; |
||
| 23 | if (!class_exists($class)) { |
||
| 24 | throw new Exception("Invalid framework $framework"); |
||
| 25 | } |
||
| 26 | return new $class(); |
||
| 27 | } |
||
| 28 | |||
| 29 | public function getRenderable(Datatype $datatype): Renderable |
||
| 32 | } |
||
| 33 | |||
| 34 | public function getName(): string |
||
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Returns a string with the <head> HTML to generate standalone files. |
||
| 41 | * This is used by the kitchensink generator. |
||
| 42 | * |
||
| 43 | * @return string |
||
| 44 | */ |
||
| 45 | public function htmlHead(): string |
||
| 48 | } |
||
| 49 | |||
| 50 | /** |
||
| 51 | * Returns a string with things to add to the footer of the page (such as scripts) |
||
| 52 | * This is used by the kitchensink generator. |
||
| 53 | * |
||
| 54 | * @return string |
||
| 55 | */ |
||
| 56 | public function htmlFooter(): string |
||
| 59 | } |
||
| 60 | |||
| 61 | /** |
||
| 62 | * @param Model $m |
||
| 63 | * @param HTMLElement[] $elements |
||
| 64 | * @param string $previousCompose |
||
| 65 | * @return string |
||
| 66 | */ |
||
| 67 | public function editableCompose(Model $m, array $elements, string $previousCompose): string |
||
| 70 | } |
||
| 71 | |||
| 72 | /** |
||
| 73 | * @param Model $m |
||
| 74 | * @param HTMLElement[] $elements |
||
| 75 | * @param string $previousCompose |
||
| 76 | * @return string |
||
| 77 | */ |
||
| 78 | public function viewableCompose(Model $m, array $elements, string $previousCompose): string |
||
| 83 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.