Completed
Push — master ( 4d4acb...f95c98 )
by Kristijan
12s
created

AfterFormValidation   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 48
rs 10
wmc 4
lcom 0
cbo 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getForm() 0 3 1
A getValidator() 0 3 1
A isValid() 0 3 1
1
<?php namespace Kris\LaravelFormBuilder\Events;
2
3
use Illuminate\Contracts\Validation\Validator;
4
use Kris\LaravelFormBuilder\Form;
5
6
class AfterFormValidation {
7
8
    /**
9
     * @var $form Form
10
     */
11
    protected $form;
12
13
    /**
14
     * @var $validator Validator
15
     */
16
    protected $validator;
17
18
    /**
19
     * @var $valid bool
20
     */
21
    protected $valid;
22
23
    /**
24
     * Create a new event instance.
25
     */
26
    public function __construct(Form $form, Validator $validator, $valid) {
27
        $this->form = $form;
28
        $this->validator = $validator;
29
        $this->valid = $valid;
30
    }
31
32
    /**
33
     * Return the event's form.
34
     */
35
    public function getForm() {
36
        return $this->form;
37
    }
38
39
    /**
40
     * Return the event's validator.
41
     */
42
    public function getValidator() {
43
        return $this->validator;
44
    }
45
46
    /**
47
     * Return wether the validation passed.
48
     */
49
    public function isValid() {
50
        return $this->valid;
51
    }
52
53
}
54