Passed
Push — develop ( 728d57...c3bbc8 )
by Septianata
05:08
created
database/migrations/2021_05_22_000012_create_items_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
      */
19 19
     public function up()
20 20
     {
21
-        Schema::create('items', function (Blueprint $table) {
21
+        Schema::create('items', function(Blueprint $table) {
22 22
             $table->id();
23 23
             $table->foreignIdFor(Order::class)->constrained()->onUpdate('cascade')->onDelete('cascade');
24 24
             $table->foreignIdFor(Denomination::class)->constrained()->onUpdate('cascade')->onDelete('cascade');
Please login to merge, or discard this patch.
database/seeders/ConfigurationSeeder.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
      */
15 15
     public function run()
16 16
     {
17
-        array_map(fn (array $attributes) => Configuration::create($attributes), [
17
+        array_map(fn(array $attributes) => Configuration::create($attributes), [
18 18
             [
19 19
                 'key' => 'maximum_total_order_value',
20 20
                 'value' => 44000000,
Please login to merge, or discard this patch.
app/Providers/RouteServiceProvider.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
     {
38 38
         $this->configureRateLimiting();
39 39
 
40
-        $this->routes(function () {
40
+        $this->routes(function() {
41 41
             Route::prefix('api')
42 42
                 ->middleware('api')
43 43
                 ->namespace($this->namespace)
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
                 ->namespace($this->namespace)
48 48
                 ->group(base_path('routes/web.php'));
49 49
 
50
-            Route::match(['get', 'post'], '/botman', function () {
50
+            Route::match([ 'get', 'post' ], '/botman', function() {
51 51
                 $this->mapBotManCommands();
52 52
             })->middleware('web_without_csrf');
53 53
         });
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
      */
61 61
     protected function configureRateLimiting()
62 62
     {
63
-        RateLimiter::for('api', function (Request $request) {
63
+        RateLimiter::for ('api', function(Request $request) {
64 64
             return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip());
65 65
         });
66 66
     }
Please login to merge, or discard this patch.
app/Conversations/Conversation.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
      * @param  array  $additionalParameters
20 20
      * @return $this
21 21
      */
22
-    protected function sayRenderable($view, array $viewData = [], array $viewMergeData = [], array $additionalParameters = [])
22
+    protected function sayRenderable($view, array $viewData = [ ], array $viewMergeData = [ ], array $additionalParameters = [ ])
23 23
     {
24 24
         $view = $view instanceof Renderable ? $view : view($view, $viewData, $viewMergeData);
25 25
 
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
      * @param  array  $additionalParameters
39 39
      * @return $this
40 40
      */
41
-    protected function askRenderable($view, $next, array $viewData = [], array $viewMergeData = [], array $additionalParameters = [])
41
+    protected function askRenderable($view, $next, array $viewData = [ ], array $viewMergeData = [ ], array $additionalParameters = [ ])
42 42
     {
43 43
         $view = $view instanceof Renderable ? $view : view($view, $viewData, $viewMergeData);
44 44
 
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
      */
87 87
     protected function setUserStorage(array $data, string $key = null)
88 88
     {
89
-        $this->getBot()->userStorage()->save($data,$key);
89
+        $this->getBot()->userStorage()->save($data, $key);
90 90
     }
91 91
 
92 92
     /**
@@ -97,10 +97,10 @@  discard block
 block discarded – undo
97 97
      * @param  bool  $forceDestroy
98 98
      * @return void
99 99
      */
100
-    protected function destroyUserStorage(string $key = null, array $excepts = [], bool $forceDestroy = false)
100
+    protected function destroyUserStorage(string $key = null, array $excepts = [ ], bool $forceDestroy = false)
101 101
     {
102 102
         if (!$forceDestroy) {
103
-            $excepts[] = '_previous_conversation';
103
+            $excepts[ ] = '_previous_conversation';
104 104
 
105 105
             /** @var \Illuminate\Support\Collection $storage */
106 106
             $storage = $this->getUserStorage();
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
     protected function displayValidationErrorMessage(string $validationErrorMessage = null)
138 138
     {
139 139
         if ($validationErrorMessage) {
140
-            $this->say('⛔️ ' . $validationErrorMessage);
140
+            $this->say('⛔️ '.$validationErrorMessage);
141 141
         }
142 142
 
143 143
         return $this;
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
         if (is_a($conversation, BaseConversation::class)) {
193 193
             $conversation = is_object($conversation) ? get_class($conversation) : $conversation;
194 194
 
195
-            $this->setUserStorage(['_previous_conversation' => $conversation]);
195
+            $this->setUserStorage([ '_previous_conversation' => $conversation ]);
196 196
         }
197 197
 
198 198
         return $this;
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
      * @param  \Closure|null  $callback
232 232
      * @return \Symfony\Component\HttpFoundation\Response
233 233
      */
234
-    protected function reply($message, array $additionalParameters = [], Closure $callback = null)
234
+    protected function reply($message, array $additionalParameters = [ ], Closure $callback = null)
235 235
     {
236 236
         $response = $this->getBot()->reply($message, $additionalParameters);
237 237
 
Please login to merge, or discard this patch.
app/Http/Requests/Configuration/UpdateRequest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
     public function rules()
24 24
     {
25 25
         return [
26
-            'key' => ['required', 'string', 'max:255', Rule::unique(Configuration::class)->ignoreModel($this->route('configuration'))],
26
+            'key' => [ 'required', 'string', 'max:255', Rule::unique(Configuration::class)->ignoreModel($this->route('configuration')) ],
27 27
             'value' => 'required|string|max:255',
28 28
             'description' => 'sometimes|nullable|string',
29 29
         ];
Please login to merge, or discard this patch.
app/Http/Resources/DataTables/DenominationResource.php 5 patches
Indentation   -30 removed lines patch added patch discarded remove patch
@@ -18,33 +18,3 @@
 block discarded – undo
18 18
     public function toArray($request)
19 19
     {
20 20
         $typeBadge = sprintf(<<<'html'
21
-            <span class="badge badge-%s">
22
-                <i class="fa fa-%s"></i> %s
23
-            </span>
24
-        html,
25
-            $this->resource->type->isCoin() ? 'danger' : 'success',
26
-            $this->resource->type->isCoin() ? 'coins' : 'money-bill',
27
-            $this->resource->type->label
28
-        );
29
-
30
-        return [
31
-            'checkbox' => view('components.datatables.checkbox', [
32
-                'value' => $this->resource->getKey(),
33
-            ])->render(),
34
-            'name' => $this->resource->name,
35
-            'value' => $this->resource->value,
36
-            'type' => $typeBadge,
37
-            'quantity_per_bundle' => $this->resource->quantity_per_bundle,
38
-            'action' => view('components.datatables.button-group', [
39
-                'elements' => [
40
-                    view('components.datatables.link-show', [
41
-                        'url' => route('admin.denomination.edit', $this->resource),
42
-                    ])->render(),
43
-                    view('components.datatables.link-destroy', [
44
-                        'url' => route('admin.denomination.destroy', $this->resource),
45
-                    ])->render(),
46
-                ],
47
-            ])->render(),
48
-        ];
49
-    }
50
-}
Please login to merge, or discard this patch.
Switch Indentation   -30 removed lines patch added patch discarded remove patch
@@ -18,33 +18,3 @@
 block discarded – undo
18 18
     public function toArray($request)
19 19
     {
20 20
         $typeBadge = sprintf(<<<'html'
21
-            <span class="badge badge-%s">
22
-                <i class="fa fa-%s"></i> %s
23
-            </span>
24
-        html,
25
-            $this->resource->type->isCoin() ? 'danger' : 'success',
26
-            $this->resource->type->isCoin() ? 'coins' : 'money-bill',
27
-            $this->resource->type->label
28
-        );
29
-
30
-        return [
31
-            'checkbox' => view('components.datatables.checkbox', [
32
-                'value' => $this->resource->getKey(),
33
-            ])->render(),
34
-            'name' => $this->resource->name,
35
-            'value' => $this->resource->value,
36
-            'type' => $typeBadge,
37
-            'quantity_per_bundle' => $this->resource->quantity_per_bundle,
38
-            'action' => view('components.datatables.button-group', [
39
-                'elements' => [
40
-                    view('components.datatables.link-show', [
41
-                        'url' => route('admin.denomination.edit', $this->resource),
42
-                    ])->render(),
43
-                    view('components.datatables.link-destroy', [
44
-                        'url' => route('admin.denomination.destroy', $this->resource),
45
-                    ])->render(),
46
-                ],
47
-            ])->render(),
48
-        ];
49
-    }
50
-}
Please login to merge, or discard this patch.
Spacing   -30 removed lines patch added patch discarded remove patch
@@ -18,33 +18,3 @@
 block discarded – undo
18 18
     public function toArray($request)
19 19
     {
20 20
         $typeBadge = sprintf(<<<'html'
21
-            <span class="badge badge-%s">
22
-                <i class="fa fa-%s"></i> %s
23
-            </span>
24
-        html,
25
-            $this->resource->type->isCoin() ? 'danger' : 'success',
26
-            $this->resource->type->isCoin() ? 'coins' : 'money-bill',
27
-            $this->resource->type->label
28
-        );
29
-
30
-        return [
31
-            'checkbox' => view('components.datatables.checkbox', [
32
-                'value' => $this->resource->getKey(),
33
-            ])->render(),
34
-            'name' => $this->resource->name,
35
-            'value' => $this->resource->value,
36
-            'type' => $typeBadge,
37
-            'quantity_per_bundle' => $this->resource->quantity_per_bundle,
38
-            'action' => view('components.datatables.button-group', [
39
-                'elements' => [
40
-                    view('components.datatables.link-show', [
41
-                        'url' => route('admin.denomination.edit', $this->resource),
42
-                    ])->render(),
43
-                    view('components.datatables.link-destroy', [
44
-                        'url' => route('admin.denomination.destroy', $this->resource),
45
-                    ])->render(),
46
-                ],
47
-            ])->render(),
48
-        ];
49
-    }
50
-}
Please login to merge, or discard this patch.
Braces   -30 removed lines patch added patch discarded remove patch
@@ -18,33 +18,3 @@
 block discarded – undo
18 18
     public function toArray($request)
19 19
     {
20 20
         $typeBadge = sprintf(<<<'html'
21
-            <span class="badge badge-%s">
22
-                <i class="fa fa-%s"></i> %s
23
-            </span>
24
-        html,
25
-            $this->resource->type->isCoin() ? 'danger' : 'success',
26
-            $this->resource->type->isCoin() ? 'coins' : 'money-bill',
27
-            $this->resource->type->label
28
-        );
29
-
30
-        return [
31
-            'checkbox' => view('components.datatables.checkbox', [
32
-                'value' => $this->resource->getKey(),
33
-            ])->render(),
34
-            'name' => $this->resource->name,
35
-            'value' => $this->resource->value,
36
-            'type' => $typeBadge,
37
-            'quantity_per_bundle' => $this->resource->quantity_per_bundle,
38
-            'action' => view('components.datatables.button-group', [
39
-                'elements' => [
40
-                    view('components.datatables.link-show', [
41
-                        'url' => route('admin.denomination.edit', $this->resource),
42
-                    ])->render(),
43
-                    view('components.datatables.link-destroy', [
44
-                        'url' => route('admin.denomination.destroy', $this->resource),
45
-                    ])->render(),
46
-                ],
47
-            ])->render(),
48
-        ];
49
-    }
50
-}
Please login to merge, or discard this patch.
Upper-Lower-Casing   -30 removed lines patch added patch discarded remove patch
@@ -18,33 +18,3 @@
 block discarded – undo
18 18
     public function toArray($request)
19 19
     {
20 20
         $typeBadge = sprintf(<<<'html'
21
-            <span class="badge badge-%s">
22
-                <i class="fa fa-%s"></i> %s
23
-            </span>
24
-        html,
25
-            $this->resource->type->isCoin() ? 'danger' : 'success',
26
-            $this->resource->type->isCoin() ? 'coins' : 'money-bill',
27
-            $this->resource->type->label
28
-        );
29
-
30
-        return [
31
-            'checkbox' => view('components.datatables.checkbox', [
32
-                'value' => $this->resource->getKey(),
33
-            ])->render(),
34
-            'name' => $this->resource->name,
35
-            'value' => $this->resource->value,
36
-            'type' => $typeBadge,
37
-            'quantity_per_bundle' => $this->resource->quantity_per_bundle,
38
-            'action' => view('components.datatables.button-group', [
39
-                'elements' => [
40
-                    view('components.datatables.link-show', [
41
-                        'url' => route('admin.denomination.edit', $this->resource),
42
-                    ])->render(),
43
-                    view('components.datatables.link-destroy', [
44
-                        'url' => route('admin.denomination.destroy', $this->resource),
45
-                    ])->render(),
46
-                ],
47
-            ])->render(),
48
-        ];
49
-    }
50
-}
Please login to merge, or discard this patch.
app/Http/Controllers/Admin/RoleController.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
     public function datatable()
30 30
     {
31 31
         return DataTables::eloquent(Role::query())
32
-            ->setTransformer(fn ($model) => RoleResource::make($model)->resolve())
32
+            ->setTransformer(fn($model) => RoleResource::make($model)->resolve())
33 33
             ->toJson();
34 34
     }
35 35
 
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
         return redirect()->route('admin.role.index')->with([
57 57
             'alert' => [
58 58
                 'type' => 'alert-success',
59
-                'message' => trans('The :resource was created!', ['resource' => trans('admin-lang.role')]),
59
+                'message' => trans('The :resource was created!', [ 'resource' => trans('admin-lang.role') ]),
60 60
             ],
61 61
         ]);
62 62
     }
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
         return redirect()->route('admin.role.index')->with([
87 87
             'alert' => [
88 88
                 'type' => 'alert-success',
89
-                'message' => trans('The :resource was updated!', ['resource' => trans('admin-lang.role')]),
89
+                'message' => trans('The :resource was updated!', [ 'resource' => trans('admin-lang.role') ]),
90 90
             ],
91 91
         ]);
92 92
     }
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
         return redirect()->route('admin.role.index')->with([
105 105
             'alert' => [
106 106
                 'type' => 'alert-success',
107
-                'message' => trans('The :resource was deleted!', ['resource' => trans('admin-lang.role')]),
107
+                'message' => trans('The :resource was deleted!', [ 'resource' => trans('admin-lang.role') ]),
108 108
             ],
109 109
         ]);
110 110
     }
@@ -117,12 +117,12 @@  discard block
 block discarded – undo
117 117
      */
118 118
     public function destroyMultiple(Request $request)
119 119
     {
120
-        Role::destroy($request->input('checkbox', []));
120
+        Role::destroy($request->input('checkbox', [ ]));
121 121
 
122 122
         return redirect()->route('admin.role.index')->with([
123 123
             'alert' => [
124 124
                 'type' => 'alert-success',
125
-                'message' => trans('The :resource was deleted!', ['resource' => trans('admin-lang.role')]),
125
+                'message' => trans('The :resource was deleted!', [ 'resource' => trans('admin-lang.role') ]),
126 126
             ],
127 127
         ]);
128 128
     }
Please login to merge, or discard this patch.
app/Http/Controllers/Admin/DenominationController.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
     public function datatable()
32 32
     {
33 33
         return DataTables::eloquent(Denomination::query())
34
-            ->setTransformer(fn ($model) => DenominationResource::make($model)->resolve())
34
+            ->setTransformer(fn($model) => DenominationResource::make($model)->resolve())
35 35
             ->toJson();
36 36
     }
37 37
 
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
         return redirect()->route('admin.denomination.index')->with([
65 65
             'alert' => [
66 66
                 'type' => 'alert-success',
67
-                'message' => trans('The :resource was created!', ['resource' => trans('admin-lang.denomination')]),
67
+                'message' => trans('The :resource was created!', [ 'resource' => trans('admin-lang.denomination') ]),
68 68
             ],
69 69
         ]);
70 70
     }
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
         return redirect()->route('admin.denomination.index')->with([
101 101
             'alert' => [
102 102
                 'type' => 'alert-success',
103
-                'message' => trans('The :resource was updated!', ['resource' => trans('admin-lang.denomination')]),
103
+                'message' => trans('The :resource was updated!', [ 'resource' => trans('admin-lang.denomination') ]),
104 104
             ],
105 105
         ]);
106 106
     }
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
         return redirect()->route('admin.denomination.index')->with([
119 119
             'alert' => [
120 120
                 'type' => 'alert-success',
121
-                'message' => trans('The :resource was deleted!', ['resource' => trans('admin-lang.denomination')]),
121
+                'message' => trans('The :resource was deleted!', [ 'resource' => trans('admin-lang.denomination') ]),
122 122
             ],
123 123
         ]);
124 124
     }
@@ -131,12 +131,12 @@  discard block
 block discarded – undo
131 131
      */
132 132
     public function destroyMultiple(Request $request)
133 133
     {
134
-        Denomination::destroy($request->input('checkbox', []));
134
+        Denomination::destroy($request->input('checkbox', [ ]));
135 135
 
136 136
         return redirect()->route('admin.denomination.index')->with([
137 137
             'alert' => [
138 138
                 'type' => 'alert-success',
139
-                'message' => trans('The :resource was deleted!', ['resource' => trans('admin-lang.denomination')]),
139
+                'message' => trans('The :resource was deleted!', [ 'resource' => trans('admin-lang.denomination') ]),
140 140
             ],
141 141
         ]);
142 142
     }
@@ -149,14 +149,14 @@  discard block
 block discarded – undo
149 149
      */
150 150
     public function destroyImage(Denomination $denomination)
151 151
     {
152
-        Storage::delete(Denomination::IMAGE_PATH . '/' . $denomination->getRawOriginal('image'));
152
+        Storage::delete(Denomination::IMAGE_PATH.'/'.$denomination->getRawOriginal('image'));
153 153
 
154
-        $denomination->update(['image' => null]);
154
+        $denomination->update([ 'image' => null ]);
155 155
 
156 156
         return redirect()->route('admin.denomination.edit', $denomination)->with([
157 157
             'alert' => [
158 158
                 'type' => 'alert-success',
159
-                'message' => trans('The :resource was deleted!', ['resource' => trans('This image')]),
159
+                'message' => trans('The :resource was deleted!', [ 'resource' => trans('This image') ]),
160 160
             ],
161 161
         ]);
162 162
     }
Please login to merge, or discard this patch.
app/Http/Controllers/Admin/ConfigurationController.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
     public function datatable()
30 30
     {
31 31
         return DataTables::eloquent(Configuration::query())
32
-            ->setTransformer(fn ($model) => ConfigurationResource::make($model)->resolve())
32
+            ->setTransformer(fn($model) => ConfigurationResource::make($model)->resolve())
33 33
             ->toJson();
34 34
     }
35 35
 
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
         return redirect()->route('admin.configuration.index')->with([
57 57
             'alert' => [
58 58
                 'type' => 'alert-success',
59
-                'message' => trans('The :resource was created!', ['resource' => trans('admin-lang.configuration')]),
59
+                'message' => trans('The :resource was created!', [ 'resource' => trans('admin-lang.configuration') ]),
60 60
             ],
61 61
         ]);
62 62
     }
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
         return redirect()->route('admin.configuration.index')->with([
87 87
             'alert' => [
88 88
                 'type' => 'alert-success',
89
-                'message' => trans('The :resource was updated!', ['resource' => trans('admin-lang.configuration')]),
89
+                'message' => trans('The :resource was updated!', [ 'resource' => trans('admin-lang.configuration') ]),
90 90
             ],
91 91
         ]);
92 92
     }
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
         return redirect()->route('admin.configuration.index')->with([
105 105
             'alert' => [
106 106
                 'type' => 'alert-success',
107
-                'message' => trans('The :resource was deleted!', ['resource' => trans('admin-lang.configuration')]),
107
+                'message' => trans('The :resource was deleted!', [ 'resource' => trans('admin-lang.configuration') ]),
108 108
             ],
109 109
         ]);
110 110
     }
@@ -117,12 +117,12 @@  discard block
 block discarded – undo
117 117
      */
118 118
     public function destroyMultiple(Request $request)
119 119
     {
120
-        Configuration::destroy($request->input('checkbox', []));
120
+        Configuration::destroy($request->input('checkbox', [ ]));
121 121
 
122 122
         return redirect()->route('admin.configuration.index')->with([
123 123
             'alert' => [
124 124
                 'type' => 'alert-success',
125
-                'message' => trans('The :resource was deleted!', ['resource' => trans('admin-lang.configuration')]),
125
+                'message' => trans('The :resource was deleted!', [ 'resource' => trans('admin-lang.configuration') ]),
126 126
             ],
127 127
         ]);
128 128
     }
Please login to merge, or discard this patch.