Completed
Pull Request — master (#376)
by
unknown
08:23
created

AfterFormCreation::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 4
ccs 4
cts 4
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Kris\LaravelFormBuilder\Events;
4
5
use Kris\LaravelFormBuilder\Form;
6
7
class AfterFormCreation
8
{
9
    /**
10
     * The form instance.
11
     *
12
     * @var Form
13
     */
14
    protected $form;
15
16
    /**
17
     * Create a new after form creation instance.
18
     *
19
     * @param  Form $form
20
     * @return void
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.

Please refer to the PHP core documentation on constructors.

Loading history...
21
     */
22 110
    public function __construct(Form $form) {
23 110
        $this->form = $form;
24 110
        $this->filterFields();
25 110
    }
26
27
    /**
28
     * Return the event's form.
29
     *
30
     * @return Form
31
     */
32
    public function getForm() {
33
        return $this->form;
34
    }
35
36
    /**
37
     * Init filter field process on Form creation.
38
     *
39
     * @return void
40
     */
41 110
    public function filterFields()
42
    {
43 110
        $this->form->filterFields();
44 110
    }
45
}
46