Code Duplication    Length = 3-4 lines in 7 locations

src/Form.php 2 locations

@@ 60-62 (lines=3) @@
57
58
    protected function setAction()
59
    {
60
        if (isset($this->params['url']) && ! empty($this->params['url'])) {
61
            $this->action = $this->params['url'];
62
        }
63
    }
64
65
    protected function setMethod()
@@ 71-73 (lines=3) @@
68
        $this->method = 'post';
69
70
        // Check method in params
71
        if (isset($this->params['method']) && ! empty($this->params['method'])) {
72
            $this->method = $this->params['method'];
73
        }
74
75
        if (in_array(strtoupper($this->method), ['GET', 'POST', 'PUT', 'DELETE'])) {
76
            $this->method = strtoupper($this->method);

src/FormElement.php 2 locations

@@ 105-107 (lines=3) @@
102
103
    protected function setName()
104
    {
105
        if (isset($this->params['name']) && ! empty($this->params['name'])) {
106
            $this->name = $this->id = $this->params['name'];
107
        }
108
    }
109
110
    protected function setLabel()
@@ 113-116 (lines=4) @@
110
    protected function setLabel()
111
    {
112
        // First, check if we receive an explicit label
113
        if (isset($this->params['label']) && ! empty($this->params['label'])) {
114
            $this->label = $this->params['label'];
115
116
            return;
117
        }
118
119
        // Check if we receive a label that is false, so we don't display it

src/FormElements/Input.php 1 location

@@ 27-29 (lines=3) @@
24
25
    protected function setPlaceholder()
26
    {
27
        if (isset($this->params['placeholder']) && ! empty($this->params['placeholder'])) {
28
            $this->placeholder = $this->params['placeholder'];
29
        }
30
    }
31
}
32

src/FormElements/Textarea.php 2 locations

@@ 28-30 (lines=3) @@
25
26
    protected function setPlaceholder()
27
    {
28
        if (isset($this->params['placeholder']) && ! empty($this->params['placeholder'])) {
29
            $this->placeholder = $this->params['placeholder'];
30
        }
31
    }
32
33
    protected function setRows()
@@ 35-37 (lines=3) @@
32
33
    protected function setRows()
34
    {
35
        if (isset($this->params['rows']) && ! empty($this->params['rows'])) {
36
            $this->rows = $this->params['rows'];
37
        }
38
    }
39
}
40