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

AfterFormCreation   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 77.78%

Importance

Changes 0
Metric Value
dl 0
loc 39
ccs 7
cts 9
cp 0.7778
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 1

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getForm() 0 3 1
A filterFields() 0 4 1
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