Form::acceptsFiles()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
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