jqh 6 vuotta sitten
vanhempi
commit
e9b8a99446
80 muutettua tiedostoa jossa 99 lisäystä ja 134 poistoa
  1. 2 1
      src/Form/Field/SwitchField.php
  2. 0 1
      src/Form/Field/UploadField.php
  3. 2 1
      src/Grid.php
  4. 1 1
      src/Grid/Concerns/HasActions.php
  5. 2 1
      src/Grid/Displayers/Editable.php
  6. 2 1
      src/Grid/Displayers/SwitchDisplay.php
  7. 2 1
      src/Grid/Tools/FilterButton.php
  8. 4 1
      src/Grid/Tools/Selector.php
  9. 6 2
      src/Layout/Menu.php
  10. 0 1
      src/Layout/Navbar.php
  11. 2 2
      src/Layout/SectionManager.php
  12. 0 1
      src/Middleware/Bootstrap.php
  13. 0 1
      src/Models/AdminTablesSeeder.php
  14. 0 1
      src/Models/Administrator.php
  15. 0 1
      src/Models/Menu.php
  16. 0 1
      src/Models/MenuCache.php
  17. 3 1
      src/Models/Permission.php
  18. 3 2
      src/Models/Repositories/Extension.php
  19. 0 1
      src/Models/Repositories/OperationLog.php
  20. 0 1
      src/Models/Role.php
  21. 3 2
      src/Repositories/EloquentRepository.php
  22. 0 1
      src/Repositories/Repository.php
  23. 0 1
      src/Repositories/RepositoryListener.php
  24. 6 2
      src/Scaffold/FormCreator.php
  25. 6 2
      src/Scaffold/GridCreator.php
  26. 3 3
      src/Scaffold/LangCreator.php
  27. 3 1
      src/Scaffold/ModelCreator.php
  28. 0 1
      src/Scaffold/RepositoryCreator.php
  29. 3 1
      src/Scaffold/ShowCreator.php
  30. 0 1
      src/Show/AbstractField.php
  31. 3 4
      src/Show/Field.php
  32. 0 1
      src/Show/Tools.php
  33. 0 1
      src/Support/AdminSection.php
  34. 0 1
      src/Support/Composer.php
  35. 0 1
      src/Support/ComposerProperty.php
  36. 1 7
      src/Support/Helper.php
  37. 0 1
      src/Support/StringOutput.php
  38. 0 1
      src/Traits/HasAssets.php
  39. 0 1
      src/Traits/HasBuilderEvents.php
  40. 0 1
      src/Traits/HasDefinitions.php
  41. 0 2
      src/Traits/HasHtmlAttributes.php
  42. 0 1
      src/Traits/ModelTree.php
  43. 1 3
      src/Widgets/AjaxRequestBuilder.php
  44. 0 1
      src/Widgets/Alert.php
  45. 0 1
      src/Widgets/Box.php
  46. 0 1
      src/Widgets/Card.php
  47. 0 1
      src/Widgets/Chart/Bar.php
  48. 0 2
      src/Widgets/Chart/Bubble.php
  49. 16 10
      src/Widgets/Chart/Chart.php
  50. 0 1
      src/Widgets/Chart/Doughnut.php
  51. 0 1
      src/Widgets/Chart/Pie.php
  52. 6 2
      src/Widgets/Chart/ScaleSetting.php
  53. 0 1
      src/Widgets/Checkbox.php
  54. 2 2
      src/Widgets/Code.php
  55. 0 1
      src/Widgets/Color.php
  56. 0 1
      src/Widgets/DataCard/Card.php
  57. 6 3
      src/Widgets/Dropdown.php
  58. 0 1
      src/Widgets/Dump.php
  59. 0 2
      src/Widgets/Form.php
  60. 0 2
      src/Widgets/Markdown.php
  61. 0 2
      src/Widgets/ModalForm.php
  62. 1 4
      src/Widgets/Navbar.php
  63. 0 3
      src/Widgets/Sparkline/Sparkline.php
  64. 0 1
      src/Widgets/Terminal.php
  65. 0 1
      src/Widgets/Tooltip.php
  66. 6 2
      src/Widgets/Tree.php
  67. 0 1
      src/Widgets/Widget.php
  68. 0 3
      tests/Controllers/DropdownController.php
  69. 0 2
      tests/Controllers/ReportController.php
  70. 0 1
      tests/CreatesApplication.php
  71. 4 2
      tests/DuskTestCase.php
  72. 0 2
      tests/Feature/CombineGridTest.php
  73. 0 3
      tests/Feature/IndexTest.php
  74. 0 2
      tests/Feature/OperationLogTest.php
  75. 0 2
      tests/Feature/RolesTest.php
  76. 0 3
      tests/Feature/SectionTest.php
  77. 0 1
      tests/Feature/TranslationTest.php
  78. 0 1
      tests/Feature/UserShowTest.php
  79. 0 1
      tests/Repositories/User.php
  80. 0 1
      tests/TestCase.php

+ 2 - 1
src/Form/Field/SwitchField.php

@@ -105,7 +105,8 @@ class SwitchField extends Field
         $this->attribute('type', 'checkbox');
         $this->attribute('data-plugin', $this->getFormId().'switchery');
 
-        Admin::script(<<<JS
+        Admin::script(
+            <<<JS
 function swty(){\$('[data-plugin="{$this->getFormId()}switchery"]').each(function(){new Switchery($(this)[0],$(this).data())})} swty();
 JS
         );

+ 0 - 1
src/Form/Field/UploadField.php

@@ -208,7 +208,6 @@ trait UploadField
             }
 
             return $this->responseError(107, trans('admin.upload.upload_failed'));
-
         } catch (\Throwable $e) {
             $this->deleteTempFile();
 

+ 2 - 1
src/Grid.php

@@ -487,7 +487,8 @@ HTML
             $queryString = http_build_query($constraints);
         }
 
-        return sprintf('%s/create%s',
+        return sprintf(
+            '%s/create%s',
             $this->getResource(),
             $queryString ? ('?'.$queryString) : ''
         );

+ 1 - 1
src/Grid/Concerns/HasActions.php

@@ -201,4 +201,4 @@ trait HasActions
     {
         return $this->disableDeleteButton(!$val);
     }
-}
+}

+ 2 - 1
src/Grid/Displayers/Editable.php

@@ -169,7 +169,8 @@ class Editable extends AbstractDisplayer
     {
         if (!static::$setup) {
             static::$setup = 1;
-            Admin::script(<<<'JS'
+            Admin::script(
+                <<<'JS'
 $.fn.editable.defaults.params = function (params) {
     params._token = LA.token;
     params._editable = 1;

+ 2 - 1
src/Grid/Displayers/SwitchDisplay.php

@@ -82,7 +82,8 @@ EOF;
 
     protected function setupScript()
     {
-        Admin::script(<<<JS
+        Admin::script(
+            <<<JS
 (function(){
     var swt = $('.grid-switch-{$this->grid->getName()}'), t;
     function init(){

+ 2 - 1
src/Grid/Tools/FilterButton.php

@@ -46,7 +46,8 @@ class FilterButton extends AbstractTool
     {
         $id = $this->filter()->getFilterID();
 
-        Admin::script(<<<JS
+        Admin::script(
+            <<<JS
 $('.{$this->getElementClassName()}').click(function(){
     $('#{$id}').parent().collapse('toggle');
 }); 

+ 4 - 1
src/Grid/Tools/Selector.php

@@ -92,7 +92,10 @@ class Selector
         }
 
         $this->selectors[$column] = compact(
-            'label', 'options', 'type', 'query'
+            'label',
+            'options',
+            'type',
+            'query'
         );
 
         return $this;

+ 6 - 2
src/Layout/Menu.php

@@ -172,7 +172,9 @@ class Menu
      */
     public function getPath($uri)
     {
-        if (!$uri) return $uri;
+        if (!$uri) {
+            return $uri;
+        }
 
         return url()->isValidUrl($uri) ? $uri : admin_base_path($uri);
     }
@@ -184,7 +186,9 @@ class Menu
      */
     public function getUrl($uri)
     {
-        if (!$uri) return $uri;
+        if (!$uri) {
+            return $uri;
+        }
 
         return admin_url($uri);
     }

+ 0 - 1
src/Layout/Navbar.php

@@ -77,5 +77,4 @@ class Navbar implements Renderable
             return (string) $element;
         })->implode('');
     }
-
 }

+ 2 - 2
src/Layout/SectionManager.php

@@ -102,7 +102,6 @@ class SectionManager
         $content = $this->getSections($section) ?: $defaultSection;
 
         return $this->resolveContent($section, $content, $options);
-
     }
 
     /**
@@ -130,7 +129,8 @@ class SectionManager
         krsort($this->sections[$name]);
 
         return call_user_func_array(
-            'array_merge', $this->sections[$name]
+            'array_merge',
+            $this->sections[$name]
         );
     }
 

+ 0 - 1
src/Middleware/Bootstrap.php

@@ -25,5 +25,4 @@ class Bootstrap
 
         return $next($request);
     }
-
 }

+ 0 - 1
src/Models/AdminTablesSeeder.php

@@ -159,6 +159,5 @@ class AdminTablesSeeder extends Seeder
         ]);
 
         (new Menu())->destroyCache();
-
     }
 }

+ 0 - 1
src/Models/Administrator.php

@@ -71,5 +71,4 @@ class Administrator extends Model implements AuthenticatableContract
 
         return $this->belongsToMany($relatedModel, $pivotTable, 'user_id', 'role_id');
     }
-
 }

+ 0 - 1
src/Models/Menu.php

@@ -135,7 +135,6 @@ class Menu extends Model
             $model->permissions()->detach();
 
             $model->destroyCache();
-
         });
 
         static::saved(function ($model) {

+ 0 - 1
src/Models/MenuCache.php

@@ -62,5 +62,4 @@ trait MenuCache
     {
         return Cache::store(config('admin.menu.cache.store', 'file'));
     }
-
 }

+ 3 - 1
src/Models/Permission.php

@@ -121,7 +121,9 @@ class Permission extends Model
      */
     public function setHttpPathAttribute($path)
     {
-        if (is_array($path)) $path = implode(',', $path);
+        if (is_array($path)) {
+            $path = implode(',', $path);
+        }
 
         return $this->attributes['http_path'] = $path;
     }

+ 3 - 2
src/Models/Repositories/Extension.php

@@ -60,7 +60,9 @@ class Extension extends Repository
 
         $extension = Admin::getExtensions()[$id] ?? null;
 
-        if (!$extension) return false;
+        if (!$extension) {
+            return false;
+        }
 
         $attributes = $form->getUpdates();
 
@@ -100,5 +102,4 @@ class Extension extends Repository
     {
         return [];
     }
-
 }

+ 0 - 1
src/Models/Repositories/OperationLog.php

@@ -8,5 +8,4 @@ use Dcat\Admin\Models\OperationLog as OperationLogModel;
 class OperationLog extends EloquentRepository
 {
     protected $eloquentClass = OperationLogModel::class;
-
 }

+ 0 - 1
src/Models/Role.php

@@ -135,5 +135,4 @@ class Role extends Model
             $model->permissions()->detach();
         });
     }
-
 }

+ 3 - 2
src/Repositories/EloquentRepository.php

@@ -301,7 +301,9 @@ abstract class EloquentRepository extends Repository
         collect(explode(',', $id))->filter()->each(function ($id) use ($form, $deletingData) {
             $data = $deletingData->get($id, []);
 
-            if (!$data) return;
+            if (!$data) {
+                return;
+            }
 
             $model = $this->createEloquent($data);
             $model->exists = true;
@@ -389,7 +391,6 @@ abstract class EloquentRepository extends Repository
             foreach ($builder->getFields() as $field) {
                 $columns[] = $field->getName();
             }
-
         }
 
         $model = $this->eloquent();

+ 0 - 1
src/Repositories/Repository.php

@@ -280,5 +280,4 @@ abstract class Repository implements \Dcat\Admin\Contracts\Repository
     {
         $this->attributes[$name] = $value;
     }
-
 }

+ 0 - 1
src/Repositories/RepositoryListener.php

@@ -66,5 +66,4 @@ abstract class RepositoryListener
     public function deleted(Form $form, array $originalAttributes, $result)
     {
     }
-
 }

+ 6 - 2
src/Scaffold/FormCreator.php

@@ -24,9 +24,13 @@ EOF
         ];
 
         foreach ($fields as $field) {
-            if (empty($field['name'])) continue;
+            if (empty($field['name'])) {
+                continue;
+            }
 
-            if ($field['name'] == $primaryKey) continue;
+            if ($field['name'] == $primaryKey) {
+                continue;
+            }
 
             $rows[] = "            \$form->text('{$field['name']}');";
         }

+ 6 - 2
src/Scaffold/GridCreator.php

@@ -20,9 +20,13 @@ trait GridCreator
         ];
 
         foreach ($fields as $field) {
-            if (empty($field['name'])) continue;
+            if (empty($field['name'])) {
+                continue;
+            }
 
-            if ($field['name'] == $primaryKey) continue;
+            if ($field['name'] == $primaryKey) {
+                continue;
+            }
 
             $rows[] = "            \$grid->{$field['name']};";
         }

+ 3 - 3
src/Scaffold/LangCreator.php

@@ -38,7 +38,9 @@ class LangCreator
             'options' => [],
         ];
         foreach ($this->fields as $field) {
-            if (empty($field['name'])) continue;
+            if (empty($field['name'])) {
+                continue;
+            }
 
             $content['fields'][$field['name']] = $field['translation'] ?: $field['name'];
         }
@@ -60,6 +62,4 @@ class LangCreator
 
         return $path . '/' . Str::slug($controller) . '.php';
     }
-
 }
-

+ 3 - 1
src/Scaffold/ModelCreator.php

@@ -138,7 +138,9 @@ class ModelCreator
     protected function replaceNamespace(&$stub, $name)
     {
         $stub = str_replace(
-            'DummyNamespace', $this->getNamespace($name), $stub
+            'DummyNamespace',
+            $this->getNamespace($name),
+            $stub
         );
 
         return $this;

+ 0 - 1
src/Scaffold/RepositoryCreator.php

@@ -55,4 +55,3 @@ class RepositoryCreator
         return __DIR__ . '/stubs/repository.stub';
     }
 }
-

+ 3 - 1
src/Scaffold/ShowCreator.php

@@ -22,7 +22,9 @@ trait ShowCreator
         }
 
         foreach ($fields as $k => $field) {
-            if (empty($field['name'])) continue;
+            if (empty($field['name'])) {
+                continue;
+            }
 
             $rows[] = "            \$show->{$field['name']};";
 

+ 0 - 1
src/Show/AbstractField.php

@@ -63,5 +63,4 @@ abstract class AbstractField implements Renderable
      * @return mixed
      */
     abstract public function render();
-
 }

+ 3 - 4
src/Show/Field.php

@@ -423,7 +423,9 @@ HTML;
     public function explode(string $d = ',')
     {
         return $this->as(function ($v) use ($d) {
-            if (is_array($v) || $v instanceof Arrayable) return $v;
+            if (is_array($v) || $v instanceof Arrayable) {
+                return $v;
+            }
 
             return $v ? explode($d, $v) : [];
         });
@@ -578,7 +580,6 @@ HTML;
 
             return $extend->render(...$arguments);
         });
-
     }
 
     /**
@@ -666,7 +667,6 @@ HTML;
         }
 
         $this->as($class);
-
     }
 
     /**
@@ -689,5 +689,4 @@ HTML;
     {
         return static::$extendedFields;
     }
-
 }

+ 0 - 1
src/Show/Tools.php

@@ -267,7 +267,6 @@ HTML;
         <i class="ti-pencil-alt "></i><span class="hidden-xs"> {$edit}</span>
     </a>
 EOF;
-
         }
 
         if ($this->showQuickEdit) {

+ 0 - 1
src/Support/AdminSection.php

@@ -32,5 +32,4 @@ class AdminSection
     const RIGHT_SIDEBAR = 'ADMIN_RIGHT_SIDEBAR';
     // 右侧导航栏样式,支持"control-sidebar-light" 和 "control-sidebar-dark"
     const RIGHT_SIDEBAR_CLASS = 'ADMIN_RIGHT_SIDEBAR_CLASS';
-
 }

+ 0 - 1
src/Support/Composer.php

@@ -63,5 +63,4 @@ class Composer
 
         return static::$files[$path] = [];
     }
-
 }

+ 0 - 1
src/Support/ComposerProperty.php

@@ -90,5 +90,4 @@ class ComposerProperty implements Arrayable
     {
         return json_encode($this->toArray());
     }
-
 }

+ 1 - 7
src/Support/Helper.php

@@ -50,16 +50,12 @@ class Helper
         }
 
         if (is_array($value)) {
-
         } elseif ($value instanceof Arrayable) {
             $value = $value->toArray();
-
         } elseif (is_string($value)) {
             $value = explode(',', $value);
-
         } else {
             $value = (array) $value;
-
         }
 
         return $filter ? array_filter($value, function ($v) {
@@ -207,8 +203,7 @@ class Helper
         ?string $primaryKeyName = null,
         ?string $parentKeyName = null,
         ?string $childrenKeyName = null
-    )
-    {
+    ) {
         $branch = [];
         $primaryKeyName  = $primaryKeyName ?: 'id';
         $parentKeyName   = $parentKeyName ?: 'parent_id';
@@ -308,5 +303,4 @@ class Helper
     {
         return "<?php \nreturn " . static::exportArray($array) . ";\n";
     }
-
 }

+ 0 - 1
src/Support/StringOutput.php

@@ -30,4 +30,3 @@ class StringOutput extends Output
         return trim($this->output);
     }
 }
-

+ 0 - 1
src/Traits/HasAssets.php

@@ -342,7 +342,6 @@ trait HasAssets
         $script = implode(';', array_unique(self::$script));
 
         return "<script data-exec-on-popstate>LA.ready(function () { {$script} });</script>";
-
     }
 
     /**

+ 0 - 1
src/Traits/HasBuilderEvents.php

@@ -89,5 +89,4 @@ trait HasBuilderEvents
     {
         return static::class.'::'.$key;
     }
-
 }

+ 0 - 1
src/Traits/HasDefinitions.php

@@ -30,5 +30,4 @@ trait HasDefinitions
     {
         return isset(static::$definitions[$name]);
     }
-
 }

+ 0 - 2
src/Traits/HasHtmlAttributes.php

@@ -92,6 +92,4 @@ trait HasHtmlAttributes
     {
         return Helper::buildHtmlAttributes($this->htmlAttributes);
     }
-
 }
-

+ 0 - 1
src/Traits/ModelTree.php

@@ -167,7 +167,6 @@ trait ModelTree
             ->orderByRaw($byOrder)
             ->get()
             ->toArray();
-
     }
 
     /**

+ 1 - 3
src/Widgets/AjaxRequestBuilder.php

@@ -90,7 +90,7 @@ trait AjaxRequestBuilder
      */
     public function refetch($selector)
     {
-        $this->buttonSelectors = 
+        $this->buttonSelectors =
             array_merge($this->buttonSelectors, (array)$selector);
 
         return $this;
@@ -167,7 +167,6 @@ window.{$this->fn} = function (p) {
 {$this->fn}();
 $binding;
 JS;
-
     }
 
     /**
@@ -189,5 +188,4 @@ JS;
 
         return $this;
     }
-
 }

+ 0 - 1
src/Widgets/Alert.php

@@ -164,5 +164,4 @@ class Alert extends Widget
             'showCloseBtn' => $this->showCloseBtn,
         ];
     }
-
 }

+ 0 - 1
src/Widgets/Box.php

@@ -174,5 +174,4 @@ class Box extends Widget
             'padding'    => $this->padding,
         ];
     }
-
 }

+ 0 - 1
src/Widgets/Card.php

@@ -101,5 +101,4 @@ class Card extends Widget
             'padding'    => $this->padding,
         ];
     }
-
 }

+ 0 - 1
src/Widgets/Chart/Bar.php

@@ -47,5 +47,4 @@ class Bar extends Chart
     {
         return $this->options(['minBarLength' => $val]);
     }
-
 }

+ 0 - 2
src/Widgets/Chart/Bubble.php

@@ -27,6 +27,4 @@ class Bubble extends Chart
     ];
 
     protected $type = 'bubble';
-
-
 }

+ 16 - 10
src/Widgets/Chart/Chart.php

@@ -50,15 +50,13 @@ abstract class Chart extends Widget
     public function __construct(...$params)
     {
         if (count($params) == 2) {
-            list ($title, $labels) = $params;
+            list($title, $labels) = $params;
 
             $title && $this->title($title);
             $labels && $this->labels($labels);
-
         } elseif (!empty($params[0])) {
             if (is_string($params[0])) {
                 $this->title($params[0]);
-
             } elseif (is_array($params[0])) {
                 $this->labels($params[0]);
             }
@@ -162,7 +160,9 @@ abstract class Chart extends Widget
      */
     public function legend(array $opts)
     {
-        if (!isset($this->options['legend'])) $this->options['legend'] = [];
+        if (!isset($this->options['legend'])) {
+            $this->options['legend'] = [];
+        }
 
         $this->options['legend'] = array_merge($this->options['legend'], $opts);
 
@@ -193,7 +193,9 @@ abstract class Chart extends Widget
      */
     public function tooltips(array $opts)
     {
-        if (!isset($this->options['tooltips'])) $this->options['tooltips'] = [];
+        if (!isset($this->options['tooltips'])) {
+            $this->options['tooltips'] = [];
+        }
 
         $this->options['tooltips'] = array_merge($this->options['tooltips'], $opts);
 
@@ -235,7 +237,9 @@ abstract class Chart extends Widget
      */
     public function elements(array $options)
     {
-        if (!isset($this->options['elements'])) $this->options['elements'] = [];
+        if (!isset($this->options['elements'])) {
+            $this->options['elements'] = [];
+        }
 
         $this->options['elements'] = array_merge($this->options['elements'], $options);
 
@@ -250,7 +254,9 @@ abstract class Chart extends Widget
      */
     public function layout(array $opts)
     {
-        if (!isset($this->options['layout'])) $this->options['layout'] = [];
+        if (!isset($this->options['layout'])) {
+            $this->options['layout'] = [];
+        }
 
         $this->options['layout'] = array_merge($this->options['layout'], $opts);
 
@@ -274,7 +280,9 @@ abstract class Chart extends Widget
      */
     public function animation(array $opts)
     {
-        if (!isset($this->options['animation'])) $this->options['animation'] = [];
+        if (!isset($this->options['animation'])) {
+            $this->options['animation'] = [];
+        }
 
         $this->options['animation'] = array_merge($this->options['animation'], $opts);
 
@@ -398,7 +406,6 @@ JS
         );
 
         return $globalSettings.$this->buildFetchingScript();
-
     }
 
     /**
@@ -415,7 +422,6 @@ JS
 
             return $v;
         }, $this->data['datasets']);
-
     }
 
     /**

+ 0 - 1
src/Widgets/Chart/Doughnut.php

@@ -11,5 +11,4 @@ use Illuminate\Support\Arr;
 class Doughnut extends Pie
 {
     protected $type = 'doughnut';
-
 }

+ 0 - 1
src/Widgets/Chart/Pie.php

@@ -71,5 +71,4 @@ class Pie extends Chart
     {
         return $this->animation(['animateScale' => $val]);
     }
-
 }

+ 6 - 2
src/Widgets/Chart/ScaleSetting.php

@@ -13,7 +13,9 @@ trait ScaleSetting
      */
     public function scales(array $opts)
     {
-        if (!isset($this->options['scales'])) $this->options['scales'] = [];
+        if (!isset($this->options['scales'])) {
+            $this->options['scales'] = [];
+        }
 
         $this->options['scales'] = array_merge($this->options['scales'], $opts);
 
@@ -78,7 +80,9 @@ trait ScaleSetting
      */
     public function scale(array $opts)
     {
-        if (!isset($this->options['scale'])) $this->options['scale'] = [];
+        if (!isset($this->options['scale'])) {
+            $this->options['scale'] = [];
+        }
 
         $this->options['scale'] = array_merge($this->options['scale'], $opts);
 

+ 0 - 1
src/Widgets/Checkbox.php

@@ -55,5 +55,4 @@ class Checkbox extends Radio
 
         return $v;
     }
-
 }

+ 2 - 2
src/Widgets/Code.php

@@ -99,8 +99,9 @@ class Code extends Markdown
 
         $source = '';
         while (($row = fgets($file)) !== false) {
-            if (++$line > $end)
+            if (++$line > $end) {
                 break;
+            }
 
             if ($line >= $start) {
                 $source .= htmlspecialchars($row, ENT_NOQUOTES, config('charset', 'utf-8'));
@@ -125,6 +126,5 @@ class Code extends Markdown
 ```
 </textarea></div>
 EOF;
-
     }
 }

+ 0 - 1
src/Widgets/Color.php

@@ -177,6 +177,5 @@ class Color
         $key = Helper::slug($method);
 
         return static::$theme[$key] ?? ($arguments[0] ?? null);
-
     }
 }

+ 0 - 1
src/Widgets/DataCard/Card.php

@@ -219,5 +219,4 @@ JS
         Admin::collectComponentAssets('waypoints');
         Admin::collectComponentAssets('jquery.counterup');
     }
-
 }

+ 6 - 3
src/Widgets/Dropdown.php

@@ -70,7 +70,9 @@ class Dropdown extends Widget
      */
     public function options($options = [], string $title = null)
     {
-        if (!$options) return $this;
+        if (!$options) {
+            return $this;
+        }
 
         if ($options instanceof Arrayable) {
             $options = $options->toArray();
@@ -199,7 +201,9 @@ class Dropdown extends Widget
      */
     protected function renderButton()
     {
-        if (is_null($this->button['text']) && !$this->click) return;
+        if (is_null($this->button['text']) && !$this->click) {
+            return;
+        }
 
         $text  = $this->button['text'];
         $class = $this->button['class'];
@@ -337,5 +341,4 @@ JS
             $opt
         );
     }
-
 }

+ 0 - 1
src/Widgets/Dump.php

@@ -101,6 +101,5 @@ class Dump extends Widget
         return <<<EOF
 <div style="padding:{$this->padding}"><pre class="dump" {$this->formatHtmlAttributes()}>{$this->content}</pre></div>
 EOF;
-
     }
 }

+ 0 - 2
src/Widgets/Form.php

@@ -144,7 +144,6 @@ class Form implements Renderable
         $this->initFields();
 
         $this->initFormAttributes();
-
     }
 
     /**
@@ -557,7 +556,6 @@ HTML;
     });
 })()
 JS
-
         );
     }
 

+ 0 - 2
src/Widgets/Markdown.php

@@ -80,7 +80,6 @@ class Markdown extends Widget
         return <<<EOF
 <div {$this->formatHtmlAttributes()}><textarea style="display:none;">{$this->content}</textarea></div>
 EOF;
-
     }
 
     public function render()
@@ -95,5 +94,4 @@ EOF;
 
         return $this->build();
     }
-
 }

+ 0 - 2
src/Widgets/ModalForm.php

@@ -242,7 +242,6 @@ class ModalForm
 })();
 JS
         );
-
     }
 
     protected function setupOptions()
@@ -294,5 +293,4 @@ JS
             $content->setView(static::$contentView);
         });
     }
-
 }

+ 1 - 4
src/Widgets/Navbar.php

@@ -110,8 +110,7 @@ class Navbar extends Widget
         array $options,
         \Closure $closure = null,
         bool $right = false
-    )
-    {
+    ) {
         $dropdown = Dropdown::make($options)
             ->button($text)
             ->buttonClass('')
@@ -177,6 +176,4 @@ JS
 
         return "<li class='nav-li $active'>$item</li>";
     }
-
 }
-

+ 0 - 3
src/Widgets/Sparkline/Sparkline.php

@@ -170,7 +170,6 @@ class Sparkline extends Widget
             $combos .= <<<JS
 $('#{$this->id}').sparkline($v, $o);
 JS;
-
         }
 
         if (!$this->allowBuildFetchingScript()) {
@@ -211,7 +210,6 @@ JS
         return <<<HTML
 <span {$this->formatHtmlAttributes()}></span>
 HTML;
-
     }
 
     /**
@@ -283,5 +281,4 @@ HTML;
         $this->script && Admin::script($this->script);
         Admin::collectComponentAssets('jquery.sparkline');
     }
-
 }

+ 0 - 1
src/Widgets/Terminal.php

@@ -52,6 +52,5 @@ class Terminal extends Widget
         return <<<EOF
 {$style}<pre {$this->formatHtmlAttributes()}>{$this->content}</pre>
 EOF;
-
     }
 }

+ 0 - 1
src/Widgets/Tooltip.php

@@ -168,6 +168,5 @@ class Tooltip extends Widget
         $opts = json_encode($this->options, JSON_UNESCAPED_UNICODE);
 
         Admin::script("$('{$this->selector}').tooltip({$opts});");
-
     }
 }

+ 6 - 2
src/Widgets/Tree.php

@@ -130,7 +130,9 @@ class Tree extends Widget
         }
         $value = (array)$value;
 
-        if (!$this->nodes) return;
+        if (!$this->nodes) {
+            return;
+        }
 
         $idColumn     = $this->columnNames['id'];
         $textColumn   = $this->columnNames['text'];
@@ -139,7 +141,9 @@ class Tree extends Widget
         $nodes = [];
 
         foreach ($this->nodes as &$v) {
-            if (empty($v[$idColumn])) continue;
+            if (empty($v[$idColumn])) {
+                continue;
+            }
 
             $parentId = $v[$parentColumn] ?? '#';
             if (empty($parentId)) {

+ 0 - 1
src/Widgets/Widget.php

@@ -195,5 +195,4 @@ abstract class Widget implements Renderable
     {
         return $this->render();
     }
-
 }

+ 0 - 3
tests/Controllers/DropdownController.php

@@ -23,7 +23,6 @@ class DropdownController extends Controller
                 $row->column(3, $this->example2());
                 $row->column(3, $this->example3());
             });
-
     }
 
     protected function example1()
@@ -84,6 +83,4 @@ JS
 
         return Box::make('Example3', $menu1);
     }
-
-
 }

+ 0 - 2
tests/Controllers/ReportController.php

@@ -59,10 +59,8 @@ class ReportController extends Controller
 
             $filter->equal('content');
             $filter->equal('cost');
-
         });
 
         return $grid;
-
     }
 }

+ 0 - 1
tests/CreatesApplication.php

@@ -22,6 +22,5 @@ trait CreatesApplication
         $app->make('config')->set('app.locale', 'en');
 
         return $app;
-
     }
 }

+ 4 - 2
tests/DuskTestCase.php

@@ -51,8 +51,10 @@ abstract class DuskTestCase extends BaseTestCase
         ]);
 
         return RemoteWebDriver::create(
-            'http://localhost:9515', DesiredCapabilities::chrome()->setCapability(
-                ChromeOptions::CAPABILITY, $options
+            'http://localhost:9515',
+            DesiredCapabilities::chrome()->setCapability(
+                ChromeOptions::CAPABILITY,
+                $options
             )
         );
     }

+ 0 - 2
tests/Feature/CombineGridTest.php

@@ -6,8 +6,6 @@ use Tests\TestCase;
 
 class CombineGridTest extends TestCase
 {
-
-
     public function test()
     {
         $this->visit('admin/tests/report')

+ 0 - 3
tests/Feature/IndexTest.php

@@ -6,8 +6,6 @@ use Tests\TestCase;
 
 class IndexTest extends TestCase
 {
-
-
     public function testIndex()
     {
         $this->visit('admin/')
@@ -46,6 +44,5 @@ class IndexTest extends TestCase
             ->seePageis('admin/helpers/routes')
             ->click('Icons')
             ->seePageis('admin/helpers/icons');
-
     }
 }

+ 0 - 2
tests/Feature/OperationLogTest.php

@@ -7,8 +7,6 @@ use Dcat\Admin\Models\OperationLog;
 
 class OperationLogTest extends TestCase
 {
-
-
     public function testOperationLogIndex()
     {
         $this->visit('admin/auth/logs')

+ 0 - 2
tests/Feature/RolesTest.php

@@ -8,8 +8,6 @@ use Dcat\Admin\Models\Administrator;
 
 class RolesTest extends TestCase
 {
-
-
     public function testRolesIndex()
     {
         $this->visit('admin/auth/roles')

+ 0 - 3
tests/Feature/SectionTest.php

@@ -34,7 +34,6 @@ class SectionTest extends TestCase
 
         admin_inject_section('key1', function ($options) {
             return "previous:{$options->previous},name:{$options->name},age:{$options->age}";
-
         }, false);
 
         $this->assertEquals(
@@ -105,7 +104,5 @@ class SectionTest extends TestCase
         admin_inject_section('key', '');
 
         $this->assertEquals(admin_section('key'), '');
-
     }
-
 }

+ 0 - 1
tests/Feature/TranslationTest.php

@@ -21,7 +21,6 @@ class TranslationTest extends TestCase
 
         $this->assertEquals(admin_trans_field('value'), 'value');
         $this->assertEquals(admin_trans_field('profile.value'), 'value');
-
     }
 
     public function testTransLabel()

+ 0 - 1
tests/Feature/UserShowTest.php

@@ -26,7 +26,6 @@ class UserShowTest extends TestCase
             ->seeInElement('a[href="http://localhost:8000/admin/tests/users/1/edit"]', 'Edit');
 
         $this->assertCount(1, $this->crawler()->filter('hr'));
-
     }
 
     protected function seedsTable($count = 100)

+ 0 - 1
tests/Repositories/User.php

@@ -5,7 +5,6 @@ namespace Tests\Repositories;
 use Dcat\Admin\Repositories\EloquentRepository;
 
 class User extends EloquentRepository
-
 {
     protected $eloquentClass = \Tests\Models\User::class;
 }

+ 0 - 1
tests/TestCase.php

@@ -22,5 +22,4 @@ class TestCase extends BaseTestCase
     protected $user;
 
     protected $login = true;
-
 }