Form   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 44
rs 10
c 0
b 0
f 0
wmc 5
lcom 1
cbo 1

4 Methods

Rating   Name   Duplication   Size   Complexity  
A action() 0 4 1
A method() 0 4 1
A novalidate() 0 6 2
A acceptsFiles() 0 4 1
1
<?php
2
3
namespace Spatie\Html\Elements;
4
5
use Spatie\Html\BaseElement;
6
7
class Form extends BaseElement
8
{
9
    protected $tag = 'form';
10
11
    /**
12
     * @param string|null $action
13
     *
14
     * @return static
15
     */
16
    public function action($action)
17
    {
18
        return $this->attribute('action', $action);
19
    }
20
21
    /**
22
     * @param string|null $method
23
     *
24
     * @return static
25
     */
26
    public function method($method)
27
    {
28
        return $this->attribute('method', $method);
29
    }
30
31
    /**
32
     * @param bool $novalidate
33
     *
34
     * @return static
35
     */
36
    public function novalidate($novalidate = true)
37
    {
38
        return $novalidate
39
            ? $this->attribute('novalidate')
40
            : $this->forgetAttribute('novalidate');
41
    }
42
43
    /**
44
     * @return static
45
     */
46
    public function acceptsFiles()
47
    {
48
        return $this->attribute('enctype', 'multipart/form-data');
49
    }
50
}
51