Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Passed
Pull Request — main (#5693)
by
unknown
12:53
created
src/app/Library/CrudPanel/Traits/Buttons.php 2 patches
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
         $otherButtons = collect([]);
26 26
 
27 27
         // we get the buttons that belong to the specified stack
28
-        $stackButtons = $this->buttons()->reject(function ($item) use ($stack, $otherButtons) {
28
+        $stackButtons = $this->buttons()->reject(function($item) use ($stack, $otherButtons) {
29 29
             if ($item->stack != $stack) {
30 30
                 // if the button does not belong to this stack we just add it for merging later
31 31
                 $otherButtons->push($item);
@@ -37,10 +37,10 @@  discard block
 block discarded – undo
37 37
         });
38 38
 
39 39
         // we parse the ordered buttons
40
-        collect($order)->each(function ($btnKey) use ($abortIfNotExist, $newButtons, $stackButtons) {
40
+        collect($order)->each(function($btnKey) use ($abortIfNotExist, $newButtons, $stackButtons) {
41 41
             if (!$button = $stackButtons->where('name', $btnKey)->first()) {
42 42
                 if ($abortIfNotExist) {
43
-                    abort(500, 'Button name [«' . $btnKey . '»] not found.', ['developer-error-exception']);
43
+                    abort(500, 'Button name [«'.$btnKey.'»] not found.', ['developer-error-exception']);
44 44
                 }
45 45
             }
46 46
             $newButtons->push($button);
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
         // we add the remaining buttons to the end of the ordered ones
51 51
         if (count($newButtons) < count($stackButtons)) {
52 52
             foreach ($stackButtons as $button) {
53
-                if (! $newButtons->where('name', $button->name)->first()) {
53
+                if (!$newButtons->where('name', $button->name)->first()) {
54 54
                     $newButtons->push($button);
55 55
                 }
56 56
             }
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
          */
120 120
         $button = $this->buttons()->firstWhere('name', $name);
121 121
 
122
-        if (! $button) {
122
+        if (!$button) {
123 123
             abort(500, 'CRUD Button "'.$name.'" not found. Please ensure the button exists before you modify it.', ['developer-error-exception']);
124 124
         }
125 125
 
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
      */
141 141
     public function removeButton($name, $stack = null)
142 142
     {
143
-        $this->setOperationSetting('buttons', $this->buttons()->reject(function ($button) use ($name, $stack) {
143
+        $this->setOperationSetting('buttons', $this->buttons()->reject(function($button) use ($name, $stack) {
144 144
             return $stack == null ? $button->name == $name : ($button->stack == $stack) && ($button->name == $name);
145 145
         }));
146 146
     }
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
      */
152 152
     public function removeButtons($names, $stack = null)
153 153
     {
154
-        if (! empty($names)) {
154
+        if (!empty($names)) {
155 155
             foreach ($names as $name) {
156 156
                 $this->removeButton($name, $stack);
157 157
             }
@@ -165,14 +165,14 @@  discard block
 block discarded – undo
165 165
 
166 166
     public function removeAllButtonsFromStack($stack)
167 167
     {
168
-        $this->setOperationSetting('buttons', $this->buttons()->reject(function ($button) use ($stack) {
168
+        $this->setOperationSetting('buttons', $this->buttons()->reject(function($button) use ($stack) {
169 169
             return $button->stack == $stack;
170 170
         }));
171 171
     }
172 172
 
173 173
     public function removeButtonFromStack($name, $stack)
174 174
     {
175
-        $this->setOperationSetting('buttons', $this->buttons()->reject(function ($button) use ($name, $stack) {
175
+        $this->setOperationSetting('buttons', $this->buttons()->reject(function($button) use ($name, $stack) {
176 176
             return $button->name == $name && $button->stack == $stack;
177 177
         }));
178 178
     }
@@ -192,15 +192,15 @@  discard block
 block discarded – undo
192 192
         $destinationKey = $this->getButtonKey($destination);
193 193
         $newDestinationKey = ($where == 'before' ? $destinationKey : $destinationKey + 1);
194 194
 
195
-        $newButtons = $this->buttons()->filter(function ($value, $key) use ($target) {
195
+        $newButtons = $this->buttons()->filter(function($value, $key) use ($target) {
196 196
             return $value->name != $target;
197 197
         });
198 198
 
199
-        if (! $targetButton) {
199
+        if (!$targetButton) {
200 200
             return;
201 201
         }
202 202
 
203
-        if (! $destinationButton) {
203
+        if (!$destinationButton) {
204 204
             return;
205 205
         }
206 206
 
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 
210 210
         $newButtons = $firstSlice->push($targetButton);
211 211
 
212
-        $lastSlice->each(function ($item, $key) use ($newButtons) {
212
+        $lastSlice->each(function($item, $key) use ($newButtons) {
213 213
             $newButtons->push($item);
214 214
         });
215 215
 
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
     /**
269 269
      * Add a new button to the current CRUD operation.
270 270
      */
271
-    public function button(string|array $nameOrAttributes): CrudButton
271
+    public function button(string | array $nameOrAttributes): CrudButton
272 272
     {
273 273
         return new CrudButton($nameOrAttributes);
274 274
     }
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
      * @param array|string $startButtons
281 281
      * @param bool         $abortIfNotExist
282 282
      */
283
-    public function buttonsStartWith(string $stack, array|string $startButtons, bool $abortIfNotExist = true): void
283
+    public function buttonsStartWith(string $stack, array | string $startButtons, bool $abortIfNotExist = true): void
284 284
     {
285 285
         $startButtons = is_array($startButtons)
286 286
             ? $startButtons
@@ -295,8 +295,8 @@  discard block
 block discarded – undo
295 295
 
296 296
         foreach ($startButtons as $btnKey) {
297 297
             if (!in_array($btnKey, $stackButtons)) {
298
-                if($abortIfNotExist) {
299
-                    abort(500, 'Button name [«' . $btnKey . '»] not found.', ['developer-error-exception']);
298
+                if ($abortIfNotExist) {
299
+                    abort(500, 'Button name [«'.$btnKey.'»] not found.', ['developer-error-exception']);
300 300
                 }
301 301
             }
302 302
             else {
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
      * @param bool         $abortIfNotExist
319 319
      */
320 320
     public
321
-    function buttonsEndWith(string $stack, array|string $endButtons, bool $abortIfNotExist = true): void
321
+    function buttonsEndWith(string $stack, array | string $endButtons, bool $abortIfNotExist = true): void
322 322
     {
323 323
         $endButtons = is_array($endButtons)
324 324
             ? $endButtons
@@ -333,8 +333,8 @@  discard block
 block discarded – undo
333 333
 
334 334
         foreach ($endButtons as $btnKey) {
335 335
             if (!in_array($btnKey, $stackButtons)) {
336
-                if($abortIfNotExist) {
337
-                    abort(500, 'Button name [«' . $btnKey . '»] not found.', ['developer-error-exception']);
336
+                if ($abortIfNotExist) {
337
+                    abort(500, 'Button name [«'.$btnKey.'»] not found.', ['developer-error-exception']);
338 338
                 }
339 339
             }
340 340
             else {
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -298,8 +298,7 @@  discard block
 block discarded – undo
298 298
                 if($abortIfNotExist) {
299 299
                     abort(500, 'Button name [«' . $btnKey . '»] not found.', ['developer-error-exception']);
300 300
                 }
301
-            }
302
-            else {
301
+            } else {
303 302
                 $startItems[] = $btnKey;
304 303
             }
305 304
         }
@@ -336,8 +335,7 @@  discard block
 block discarded – undo
336 335
                 if($abortIfNotExist) {
337 336
                     abort(500, 'Button name [«' . $btnKey . '»] not found.', ['developer-error-exception']);
338 337
                 }
339
-            }
340
-            else {
338
+            } else {
341 339
                 $endItems[] = $btnKey;
342 340
             }
343 341
         }
Please login to merge, or discard this patch.