@@ -61,14 +61,14 @@ |
||
61 | 61 | $this->failHook($exception); |
62 | 62 | } |
63 | 63 | |
64 | - return tap($value, function ($value) { |
|
64 | + return tap($value, function($value) { |
|
65 | 65 | $this->successHook($value); |
66 | 66 | }); |
67 | 67 | } |
68 | 68 | |
69 | 69 | public function resolveBeforeHook() |
70 | 70 | { |
71 | - $method = 'as' . Str::studly($this->runningAs); |
|
71 | + $method = 'as'.Str::studly($this->runningAs); |
|
72 | 72 | |
73 | 73 | if (method_exists($this, $method)) { |
74 | 74 | return $this->resolveAndCall($this, $method); |
@@ -21,7 +21,7 @@ |
||
21 | 21 | return $this->rule("exists:$table,$column"); |
22 | 22 | } |
23 | 23 | |
24 | - public function filled(){ |
|
24 | + public function filled() { |
|
25 | 25 | return $this->rule('filled'); |
26 | 26 | } |
27 | 27 | } |
28 | 28 | \ No newline at end of file |
@@ -23,27 +23,27 @@ |
||
23 | 23 | |
24 | 24 | public function endsWith(string ...$values) |
25 | 25 | { |
26 | - return $this->rule('ends_with:' . implode(',', $values)); |
|
26 | + return $this->rule('ends_with:'.implode(',', $values)); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | public function in(string ...$values) |
30 | 30 | { |
31 | - return $this->rule('in:' . implode(',', $values)); |
|
31 | + return $this->rule('in:'.implode(',', $values)); |
|
32 | 32 | } |
33 | 33 | |
34 | - public function ip(){ |
|
34 | + public function ip() { |
|
35 | 35 | return $this->rule('ip'); |
36 | 36 | } |
37 | 37 | |
38 | - public function ipv4(){ |
|
38 | + public function ipv4() { |
|
39 | 39 | return $this->rule('ipv4'); |
40 | 40 | } |
41 | 41 | |
42 | - public function ipv6(){ |
|
42 | + public function ipv6() { |
|
43 | 43 | return $this->rule('ipv6'); |
44 | 44 | } |
45 | 45 | |
46 | - public function json(){ |
|
46 | + public function json() { |
|
47 | 47 | return $this->rule('json'); |
48 | 48 | } |
49 | 49 | } |
50 | 50 | \ No newline at end of file |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | } |
41 | 41 | |
42 | 42 | foreach ($this->includes() as $key => $included) { |
43 | - if (! array_key_exists($key, $rules)) { |
|
43 | + if (!array_key_exists($key, $rules)) { |
|
44 | 44 | $rules[$key] = 'required'; |
45 | 45 | } |
46 | 46 | } |
@@ -75,13 +75,13 @@ discard block |
||
75 | 75 | $filtered = []; |
76 | 76 | $rules = collect($this->buildRules()); |
77 | 77 | $keys = $rules->keys(); |
78 | - $rules->each(function ($rules, $key) use ($original, $keys, &$filtered) { |
|
78 | + $rules->each(function($rules, $key) use ($original, $keys, &$filtered) { |
|
79 | 79 | //Allow for array or pipe-delimited rule-sets |
80 | 80 | if (is_string($rules)) { |
81 | 81 | $rules = explode('|', $rules); |
82 | 82 | } |
83 | 83 | //In case a rule requires an element to be an array, look for nested rules |
84 | - $nestedRules = $keys->filter(function ($otherKey) use ($key) { |
|
84 | + $nestedRules = $keys->filter(function($otherKey) use ($key) { |
|
85 | 85 | return strpos($otherKey, "$key.") === 0; |
86 | 86 | }); |
87 | 87 | //If the input must be an array, default missing nested rules to a wildcard |
@@ -118,14 +118,14 @@ discard block |
||
118 | 118 | |
119 | 119 | protected function resolveValidation() |
120 | 120 | { |
121 | - if (! $this->passesValidation()) { |
|
121 | + if (!$this->passesValidation()) { |
|
122 | 122 | $this->failedValidation(); |
123 | 123 | } |
124 | 124 | |
125 | 125 | return $this; |
126 | 126 | } |
127 | 127 | |
128 | - protected function setValidatorInstance($validator){ |
|
128 | + protected function setValidatorInstance($validator) { |
|
129 | 129 | $this->validator = $validator; |
130 | 130 | } |
131 | 131 | |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | } |
147 | 147 | |
148 | 148 | if (method_exists($this, 'afterValidator')) { |
149 | - $validator->after(function ($validator) { |
|
149 | + $validator->after(function($validator) { |
|
150 | 150 | $this->resolveAndCall($this, 'afterValidator', compact('validator')); |
151 | 151 | }); |
152 | 152 | } |
@@ -86,10 +86,10 @@ discard block |
||
86 | 86 | */ |
87 | 87 | public static function optional() |
88 | 88 | { |
89 | - return tap(static::make(), function (Attribute $attribute) { |
|
89 | + return tap(static::make(), function(Attribute $attribute) { |
|
90 | 90 | $attribute->setRules( |
91 | 91 | collect($attribute->getRules()) |
92 | - ->reject(function ($value) { |
|
92 | + ->reject(function($value) { |
|
93 | 93 | return $value === 'required'; |
94 | 94 | }) |
95 | 95 | ->toArray() |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | */ |
122 | 122 | public function rule(...$rules) |
123 | 123 | { |
124 | - collect($rules)->each(function ($rule) { |
|
124 | + collect($rules)->each(function($rule) { |
|
125 | 125 | $this->setRules( |
126 | 126 | collect($this->extractRules($rule)) |
127 | 127 | ->flatten() |