Passed
Pull Request — master (#37)
by Bruno
07:17
created

VueCodeAbstractRenderer   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 3
c 1
b 0
f 0
dl 0
loc 38
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
1
<?php declare(strict_types=1);
2
3
namespace Formularium\Frontend\Vue;
4
5
use Formularium\HTMLNode;
6
use Formularium\Model;
7
8
abstract class VueCodeAbstractRenderer
9
{
10
    /**
11
     * @var VueCode
12
     */
13
    protected $vueCode;
14
15
    public function __construct(VueCode $vueCode)
16
    {
17
        $this->vueCode = $vueCode;
18
    }
19
20
    /**
21
     * Generates the javascript code.
22
     *
23
     * @param Model $m
24
     * @param HTMLNode[] $elements
25
     * @return string
26
     */
27
    abstract public function toScript(Model $m, array $elements);
28
29
    /**
30
     * Generates the javascript code.
31
     *
32
     * @param Model $m
33
     * @param HTMLNode[] $elements
34
     * @return string
35
     */
36
    abstract public function toVariable(Model $m, array $elements);
37
38
    /**
39
     * Generates template data for rendering
40
     *
41
     * @param Model $m
42
     * @param HTMLNode[] $elements $elements
43
     * @return array
44
     */
45
    abstract public function getTemplateData(Model $m, array $elements): array;
46
}
47