@@ -42,7 +42,7 @@ |
||
42 | 42 | public function value($value = null) |
43 | 43 | { |
44 | 44 | if (is_null($value)) { |
45 | - if (! is_null($this->value) && is_null($this->value['start']) && is_null($this->value['end'])) { |
|
45 | + if (!is_null($this->value) && is_null($this->value['start']) && is_null($this->value['end'])) { |
|
46 | 46 | return $this->getDefault(); |
47 | 47 | } |
48 | 48 |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | */ |
54 | 54 | public function getValidator(array $input) |
55 | 55 | { |
56 | - if (! array_key_exists($this->column, $input)) { |
|
56 | + if (!array_key_exists($this->column, $input)) { |
|
57 | 57 | return false; |
58 | 58 | } |
59 | 59 | |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | |
64 | 64 | /** @var Field $field */ |
65 | 65 | foreach ($this->buildEmbeddedForm()->fields() as $field) { |
66 | - if (! $fieldRules = $field->getRules()) { |
|
66 | + if (!$fieldRules = $field->getRules()) { |
|
67 | 67 | continue; |
68 | 68 | } |
69 | 69 | |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | $column = array_flip($column); |
181 | 181 | |
182 | 182 | foreach ($input[$this->column] as $key => $value) { |
183 | - if (! array_key_exists($key, $column)) { |
|
183 | + if (!array_key_exists($key, $column)) { |
|
184 | 184 | continue; |
185 | 185 | } |
186 | 186 |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | try { |
243 | 243 | $this->storage = Storage::disk($disk); |
244 | 244 | } catch (\Exception $exception) { |
245 | - if (! array_key_exists($disk, config('filesystems.disks'))) { |
|
245 | + if (!array_key_exists($disk, config('filesystems.disks'))) { |
|
246 | 246 | admin_error( |
247 | 247 | 'Config error.', |
248 | 248 | "Disk [$disk] not configured, please add a disk config in `config/filesystems.php`." |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | { |
384 | 384 | $this->renameIfExists($file); |
385 | 385 | |
386 | - if (! is_null($this->storagePermission)) { |
|
386 | + if (!is_null($this->storagePermission)) { |
|
387 | 387 | return $this->storage->putFileAs($this->getDirectory(), $file, $this->name, $this->storagePermission); |
388 | 388 | } |
389 | 389 |
@@ -38,17 +38,17 @@ |
||
38 | 38 | return $this->validator->call($this, $input); |
39 | 39 | } |
40 | 40 | |
41 | - if (! is_string($this->column)) { |
|
41 | + if (!is_string($this->column)) { |
|
42 | 42 | return false; |
43 | 43 | } |
44 | 44 | |
45 | 45 | $rules = $attributes = []; |
46 | 46 | |
47 | - if (! $fieldRules = $this->getRules()) { |
|
47 | + if (!$fieldRules = $this->getRules()) { |
|
48 | 48 | return false; |
49 | 49 | } |
50 | 50 | |
51 | - if (! Arr::has($input, $this->column)) { |
|
51 | + if (!Arr::has($input, $this->column)) { |
|
52 | 52 | return false; |
53 | 53 | } |
54 | 54 |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | */ |
44 | 44 | public function callInterventionMethods($target) |
45 | 45 | { |
46 | - if (! empty($this->interventionCalls)) { |
|
46 | + if (!empty($this->interventionCalls)) { |
|
47 | 47 | $image = ImageManagerStatic::make($target); |
48 | 48 | |
49 | 49 | foreach ($this->interventionCalls as $call) { |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | return $this; |
74 | 74 | } |
75 | 75 | |
76 | - if (! class_exists(ImageManagerStatic::class)) { |
|
76 | + if (!class_exists(ImageManagerStatic::class)) { |
|
77 | 77 | throw new \Exception('To use image handling and manipulation, please install [intervention/image] first.'); |
78 | 78 | } |
79 | 79 | |
@@ -170,11 +170,11 @@ discard block |
||
170 | 170 | |
171 | 171 | $action = $size[2] ?? 'resize'; |
172 | 172 | // Resize image with aspect ratio |
173 | - $image->$action($size[0], $size[1], function (Constraint $constraint) { |
|
173 | + $image->$action($size[0], $size[1], function(Constraint $constraint) { |
|
174 | 174 | $constraint->aspectRatio(); |
175 | 175 | })->resizeCanvas($size[0], $size[1], 'center', false, '#ffffff'); |
176 | 176 | |
177 | - if (! is_null($this->storagePermission)) { |
|
177 | + if (!is_null($this->storagePermission)) { |
|
178 | 178 | $this->storage->put("{$this->getDirectory()}/{$path}", $image->encode(), $this->storagePermission); |
179 | 179 | } else { |
180 | 180 | $this->storage->put("{$this->getDirectory()}/{$path}", $image->encode()); |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | */ |
106 | 106 | public function getValidator(array $input) |
107 | 107 | { |
108 | - if (! array_key_exists($this->column, $input)) { |
|
108 | + if (!array_key_exists($this->column, $input)) { |
|
109 | 109 | return false; |
110 | 110 | } |
111 | 111 | |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | |
118 | 118 | /* @var Field $field */ |
119 | 119 | foreach ($form->fields() as $field) { |
120 | - if (! $fieldRules = $field->getRules()) { |
|
120 | + if (!$fieldRules = $field->getRules()) { |
|
121 | 121 | continue; |
122 | 122 | } |
123 | 123 | |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | /* |
271 | 271 | * if doesn't have column name, continue to the next loop |
272 | 272 | */ |
273 | - if (! array_key_exists($name, $column)) { |
|
273 | + if (!array_key_exists($name, $column)) { |
|
274 | 274 | continue; |
275 | 275 | } |
276 | 276 | |
@@ -400,7 +400,7 @@ discard block |
||
400 | 400 | |
401 | 401 | $relation = call_user_func([$model, $this->relationName]); |
402 | 402 | |
403 | - if (! $relation instanceof Relation && ! $relation instanceof MorphMany) { |
|
403 | + if (!$relation instanceof Relation && !$relation instanceof MorphMany) { |
|
404 | 404 | throw new \Exception('hasMany field must be a HasMany or MorphMany relation.'); |
405 | 405 | } |
406 | 406 | |
@@ -638,7 +638,7 @@ discard block |
||
638 | 638 | */ |
639 | 639 | public function render() |
640 | 640 | { |
641 | - if (! $this->shouldRender()) { |
|
641 | + if (!$this->shouldRender()) { |
|
642 | 642 | return ''; |
643 | 643 | } |
644 | 644 | |
@@ -697,7 +697,7 @@ discard block |
||
697 | 697 | } |
698 | 698 | |
699 | 699 | /* Build row elements */ |
700 | - $template = array_reduce($fields, function ($all, $field) { |
|
700 | + $template = array_reduce($fields, function($all, $field) { |
|
701 | 701 | $all .= "<td>{$field}</td>"; |
702 | 702 | |
703 | 703 | return $all; |
@@ -226,12 +226,12 @@ |
||
226 | 226 | public function model($model, $idField = 'id', $textField = 'name') |
227 | 227 | { |
228 | 228 | if ( |
229 | - ! class_exists($model) |
|
230 | - || ! in_array(Model::class, class_parents($model)) |
|
229 | + !class_exists($model) |
|
230 | + || !in_array(Model::class, class_parents($model)) |
|
231 | 231 | ) { |
232 | 232 | throw new \InvalidArgumentException("[$model] must be a valid model class"); |
233 | 233 | } |
234 | - $this->options = function ($value) use ($model, $idField, $textField) { |
|
234 | + $this->options = function($value) use ($model, $idField, $textField) { |
|
235 | 235 | if (empty($value)) { |
236 | 236 | return []; |
237 | 237 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | |
73 | 73 | $attributes = []; |
74 | 74 | |
75 | - if (! $fieldRules = $this->getRules()) { |
|
75 | + if (!$fieldRules = $this->getRules()) { |
|
76 | 76 | return false; |
77 | 77 | } |
78 | 78 | |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | { |
173 | 173 | $this->name = $this->getStoreName($file); |
174 | 174 | |
175 | - return tap($this->upload($file), function () { |
|
175 | + return tap($this->upload($file), function() { |
|
176 | 176 | $this->name = null; |
177 | 177 | }); |
178 | 178 | } |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | |
315 | 315 | $this->setupDefaultOptions(); |
316 | 316 | |
317 | - if (! empty($this->value)) { |
|
317 | + if (!empty($this->value)) { |
|
318 | 318 | $this->options(['initialPreview' => $this->preview()]); |
319 | 319 | $this->setupPreviewOptions(); |
320 | 320 | } |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | |
340 | 340 | $file = Arr::get($files, $key); |
341 | 341 | |
342 | - if (! $this->retainable && $this->storage->exists($file)) { |
|
342 | + if (!$this->retainable && $this->storage->exists($file)) { |
|
343 | 343 | $this->storage->delete($file); |
344 | 344 | } |
345 | 345 |
@@ -80,17 +80,17 @@ discard block |
||
80 | 80 | return $this->validator->call($this, $input); |
81 | 81 | } |
82 | 82 | |
83 | - if (! is_string($this->column)) { |
|
83 | + if (!is_string($this->column)) { |
|
84 | 84 | return false; |
85 | 85 | } |
86 | 86 | |
87 | 87 | $rules = $attributes = []; |
88 | 88 | |
89 | - if (! $fieldRules = $this->getRules()) { |
|
89 | + if (!$fieldRules = $this->getRules()) { |
|
90 | 90 | return false; |
91 | 91 | } |
92 | 92 | |
93 | - if (! Arr::has($input, $this->column)) { |
|
93 | + if (!Arr::has($input, $this->column)) { |
|
94 | 94 | return false; |
95 | 95 | } |
96 | 96 | |
@@ -99,11 +99,11 @@ discard block |
||
99 | 99 | |
100 | 100 | $rules["{$this->column}.values"][] = 'array'; |
101 | 101 | |
102 | - if (! is_null($this->max)) { |
|
102 | + if (!is_null($this->max)) { |
|
103 | 103 | $rules["{$this->column}.values"][] = "max:$this->max"; |
104 | 104 | } |
105 | 105 | |
106 | - if (! is_null($this->min)) { |
|
106 | + if (!is_null($this->min)) { |
|
107 | 107 | $rules["{$this->column}.values"][] = "min:$this->min"; |
108 | 108 | } |
109 | 109 |