Completed
Push — master ( fbf118...df950e )
by Kristijan
05:18 queued 01:57
created

AfterCollectingFieldRules::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 2
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\Fields\FormField;
6
use Kris\LaravelFormBuilder\Form;
7
use Kris\LaravelFormBuilder\Rules;
8
9
class AfterCollectingFieldRules
10
{
11
    /**
12
     * The field instance.
13
     *
14
     * @var FormField
15
     */
16
    protected $field;
17
18
    /**
19
     * The field's rules.
20
     *
21
     * @var Rules
22
     */
23
    protected $rules;
24
25
    /**
26
     * Create a new after field creation instance.
27
     *
28
     * @param Form $form
0 ignored issues
show
Bug introduced by
There is no parameter named $form. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
29
     * @param FormField $field
30
     * @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...
31
     */
32 9
    public function __construct(FormField $field, Rules $rules) {
33 9
        $this->field = $field;
34 9
        $this->rules = $rules;
35 9
    }
36
37
    /**
38
     * Return the event's field.
39
     *
40
     * @return FormField
41
     */
42
    public function getField() {
43
        return $this->field;
44
    }
45
46
    /**
47
     * Return the event's field's rules.
48
     *
49
     * @return Rules
50
     */
51
    public function getRules() {
52
        return $this->rules;
53
    }
54
}
55