Completed
Push — 0.3 ( da43ab...625b56 )
by Ben
96:17 queued 52:29
created

NullValidator::failed()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Thinktomorrow\Chief\Fields\Validators;
4
5
use Illuminate\Contracts\Validation\Validator;
6
use Illuminate\Support\MessageBag;
7
8
class NullValidator implements Validator
9
{
10
11
    /**
12
     * Get the messages for the instance.
13
     *
14
     * @return \Illuminate\Contracts\Support\MessageBag
15
     */
16
    public function getMessageBag()
17
    {
18
        return new MessageBag();
19
    }
20
21
    /**
22
     * Run the validator's rules against its data.
23
     *
24
     * @return array
25
     */
26 80
    public function validate()
27
    {
28 80
        return [];
29
    }
30
31
    /**
32
     * Get the attributes and values that were validated.
33
     *
34
     * @return array
35
     */
36
    public function validated()
37
    {
38
        return [];
39
    }
40
41
    /**
42
     * Determine if the data fails the validation rules.
43
     *
44
     * @return bool
45
     */
46
    public function fails()
47
    {
48
        return false;
49
    }
50
51
    /**
52
     * Get the failed validation rules.
53
     *
54
     * @return array
55
     */
56
    public function failed()
57
    {
58
        return [];
59
    }
60
61
    /**
62
     * Add conditions to a given field based on a Closure.
63
     *
64
     * @param  string|array $attribute
65
     * @param  string|array $rules
66
     * @param  callable $callback
67
     * @return $this
68
     */
69
    public function sometimes($attribute, $rules, callable $callback)
70
    {
71
        return $this;
72
    }
73
74
    /**
75
     * Add an after validation callback.
76
     *
77
     * @param  callable|string $callback
78
     * @return $this
79
     */
80
    public function after($callback)
81
    {
82
        return $this;
83
    }
84
85
    /**
86
     * Get all of the validation error messages.
87
     *
88
     * @return \Illuminate\Support\MessageBag
89
     */
90
    public function errors()
91
    {
92
        return new MessageBag();
93
    }
94
}
95