Passed
Push — master ( d5d794...b1bf4d )
by Pascal
12:05
created
src/Components/HandlesValidationErrors.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
      */
35 35
     protected function getErrorBag(string $bag = 'default'): MessageBag
36 36
     {
37
-        $bags = View::shared('errors', fn () => request()->session()->get('errors', new ViewErrorBag));
37
+        $bags = View::shared('errors', fn() => request()->session()->get('errors', new ViewErrorBag));
38 38
 
39 39
         return $bags->getBag($bag);
40 40
     }
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
      */
49 49
     public function hasError(string $name, string $bag = 'default'): bool
50 50
     {
51
-        $name = str_replace(['[', ']'], ['.', ''], Str::before($name, '[]'));
51
+        $name = str_replace([ '[', ']' ], [ '.', '' ], Str::before($name, '[]'));
52 52
 
53 53
         $errorBag = $this->getErrorBag($bag);
54 54
 
Please login to merge, or discard this patch.
src/Components/Form.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
     {
28 28
         $this->method = strtoupper($method);
29 29
 
30
-        $this->spoofMethod = in_array($this->method, ['PUT', 'PATCH', 'DELETE']);
30
+        $this->spoofMethod = in_array($this->method, [ 'PUT', 'PATCH', 'DELETE' ]);
31 31
     }
32 32
 
33 33
     /**
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
      */
39 39
     public function hasError($bag = 'default'): bool
40 40
     {
41
-        $errors = View::shared('errors', fn () => request()->session()->get('errors', new ViewErrorBag));
41
+        $errors = View::shared('errors', fn() => request()->session()->get('errors', new ViewErrorBag));
42 42
 
43 43
         return $errors->getBag($bag)->isNotEmpty();
44 44
     }
Please login to merge, or discard this patch.
src/Components/FormSelect.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
     public function __construct(
27 27
         string $name,
28 28
         string $label = '',
29
-        $options = [],
29
+        $options = [ ],
30 30
         $bind = null,
31 31
         $default = null,
32 32
         bool $multiple = false,
Please login to merge, or discard this patch.
src/Components/Component.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 
27 27
         $framework = config("form-components.framework");
28 28
 
29
-        return str_replace('{framework}', $framework, $config['view']);
29
+        return str_replace('{framework}', $framework, $config[ 'view' ]);
30 30
     }
31 31
 
32 32
     /**
@@ -97,6 +97,6 @@  discard block
 block discarded – undo
97 97
      */
98 98
     protected static function convertBracketsToDots($name): string
99 99
     {
100
-        return str_replace(['[', ']'], ['.', ''], $name);
100
+        return str_replace([ '[', ']' ], [ '.', '' ], $name);
101 101
     }
102 102
 }
Please login to merge, or discard this patch.
src/Components/HandlesBoundValues.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -82,14 +82,14 @@
 block discarded – undo
82 82
             return $date;
83 83
         }
84 84
 
85
-        $cast = $model->getCasts()[$key] ?? null;
85
+        $cast = $model->getCasts()[ $key ] ?? null;
86 86
 
87 87
         if (!$cast || $cast === 'date' || $cast === 'datetime') {
88 88
             return Carbon::instance($date)->toJSON();
89 89
         }
90 90
 
91 91
         if ($this->isCustomDateTimeCast($cast)) {
92
-            return $date->format(explode(':', $cast, 2)[1]);
92
+            return $date->format(explode(':', $cast, 2)[ 1 ]);
93 93
         }
94 94
 
95 95
         return $date;
Please login to merge, or discard this patch.
src/Support/ServiceProvider.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -28,19 +28,19 @@  discard block
 block discarded – undo
28 28
 
29 29
         //
30 30
 
31
-        Blade::directive('bind', function ($bind) {
31
+        Blade::directive('bind', function($bind) {
32 32
             return '<?php app(\ProtoneMedia\LaravelFormComponents\FormDataBinder::class)->bind(' . $bind . '); ?>';
33 33
         });
34 34
 
35
-        Blade::directive('endbind', function () {
35
+        Blade::directive('endbind', function() {
36 36
             return '<?php app(\ProtoneMedia\LaravelFormComponents\FormDataBinder::class)->pop(); ?>';
37 37
         });
38 38
 
39
-        Blade::directive('wire', function ($modifier) {
39
+        Blade::directive('wire', function($modifier) {
40 40
             return '<?php app(\ProtoneMedia\LaravelFormComponents\FormDataBinder::class)->wire(' . $modifier . '); ?>';
41 41
         });
42 42
 
43
-        Blade::directive('endwire', function () {
43
+        Blade::directive('endwire', function() {
44 44
             return '<?php app(\ProtoneMedia\LaravelFormComponents\FormDataBinder::class)->endWire(); ?>';
45 45
         });
46 46
 
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
         $prefix = config('form-components.prefix');
50 50
 
51 51
         Collection::make(config('form-components.components'))->each(
52
-            fn ($component, $alias) => Blade::component($alias, $component['class'], $prefix)
52
+            fn($component, $alias) => Blade::component($alias, $component[ 'class' ], $prefix)
53 53
         );
54 54
     }
55 55
 
@@ -60,6 +60,6 @@  discard block
 block discarded – undo
60 60
     {
61 61
         $this->mergeConfigFrom(__DIR__ . '/../../config/config.php', 'form-components');
62 62
 
63
-        $this->app->singleton(FormDataBinder::class, fn () => new FormDataBinder);
63
+        $this->app->singleton(FormDataBinder::class, fn() => new FormDataBinder);
64 64
     }
65 65
 }
Please login to merge, or discard this patch.
src/FormDataBinder.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
     /**
10 10
      * Tree of bound targets.
11 11
      */
12
-    private array $bindings = [];
12
+    private array $bindings = [ ];
13 13
 
14 14
     /**
15 15
      * Wired to a Livewire component.
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
      */
25 25
     public function bind($target): void
26 26
     {
27
-        $this->bindings[] = $target;
27
+        $this->bindings[ ] = $target;
28 28
     }
29 29
 
30 30
     /**
Please login to merge, or discard this patch.