@@ -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() |