@@ -21,13 +21,13 @@ |
||
| 21 | 21 | public function register() |
| 22 | 22 | { |
| 23 | 23 | $this->app->singleton(RegistrarInterface::class, |
| 24 | - function (Container $app) { |
|
| 24 | + function(Container $app) { |
|
| 25 | 25 | return new LaravelRegistrar($app); |
| 26 | 26 | } |
| 27 | 27 | ); |
| 28 | 28 | |
| 29 | 29 | $this->app->bind(Sanitizer::class, |
| 30 | - function (Application $app) { |
|
| 30 | + function(Application $app) { |
|
| 31 | 31 | return (new Sanitizer)->setRegistrar( |
| 32 | 32 | $app->make(RegistrarInterface::class) |
| 33 | 33 | ); |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | */ |
| 52 | 52 | public function rules($ruleset) |
| 53 | 53 | { |
| 54 | - if (! is_array($ruleset)) { |
|
| 54 | + if (!is_array($ruleset)) { |
|
| 55 | 55 | $ruleset = [static::GLOBAL_KEY => $ruleset]; |
| 56 | 56 | } |
| 57 | 57 | |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | public function sanitize($data) |
| 73 | 73 | { |
| 74 | 74 | if ($this->hasGlobals()) { |
| 75 | - if (! is_array($data)) { |
|
| 75 | + if (!is_array($data)) { |
|
| 76 | 76 | return $this->sanitizeValueFor(static::GLOBAL_KEY, $data); |
| 77 | 77 | } |
| 78 | 78 | |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | foreach ($data as $key => $value) { |
| 85 | - if (! $this->shouldSanitize($key)) { |
|
| 85 | + if (!$this->shouldSanitize($key)) { |
|
| 86 | 86 | continue; |
| 87 | 87 | } |
| 88 | 88 | |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | */ |
| 124 | 124 | protected function hasRegistrar() |
| 125 | 125 | { |
| 126 | - return ! is_null($this->registrar); |
|
| 126 | + return !is_null($this->registrar); |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | /** |
@@ -219,14 +219,14 @@ discard block |
||
| 219 | 219 | */ |
| 220 | 220 | protected function buildArguments($value, array $args = null) |
| 221 | 221 | { |
| 222 | - if (! $args) { |
|
| 223 | - return (array) $value; |
|
| 222 | + if (!$args) { |
|
| 223 | + return (array)$value; |
|
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | $valuePosition = array_search(static::PLACEHOLDER_VALUE, $args, true); |
| 227 | 227 | |
| 228 | 228 | if ($valuePosition === false) { |
| 229 | - return array_merge((array) $value, $args); |
|
| 229 | + return array_merge((array)$value, $args); |
|
| 230 | 230 | } else { |
| 231 | 231 | $args[$valuePosition] = $value; |
| 232 | 232 | } |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | |
| 273 | 273 | $built = []; |
| 274 | 274 | |
| 275 | - foreach ((array) $rules as $rule) { |
|
| 275 | + foreach ((array)$rules as $rule) { |
|
| 276 | 276 | if (is_string($rule) && strpos($rule, ':') !== false) { |
| 277 | 277 | $args = explode(':', $rule); |
| 278 | 278 | $rule = array_shift($args); |
@@ -83,7 +83,7 @@ |
||
| 83 | 83 | */ |
| 84 | 84 | public function initialize(array $query = [], array $request = [], array $attributes = [], array $cookies = [], array $files = [], array $server = [], $content = null) |
| 85 | 85 | { |
| 86 | - if (! empty($request) && ($rules = $this->sanitize())) { |
|
| 86 | + if (!empty($request) && ($rules = $this->sanitize())) { |
|
| 87 | 87 | $sanitizer = app(Sanitizer::class)->rules($rules); |
| 88 | 88 | |
| 89 | 89 | $request = $sanitizer->sanitize($request); |