Parcourir la source

Apply fixes from StyleCI

Jiang Qinghua il y a 6 ans
Parent
commit
d08a866a37
100 fichiers modifiés avec 364 ajouts et 364 suppressions
  1. 3 3
      src/Admin.php
  2. 3 3
      src/AdminServiceProvider.php
  3. 2 2
      src/Auth/Permission.php
  4. 1 1
      src/Console/CreateUserCommand.php
  5. 5 5
      src/Console/ExtendCommand.php
  6. 3 3
      src/Console/IdeHelperCommand.php
  7. 2 2
      src/Console/ImportCommand.php
  8. 1 1
      src/Console/ResetPasswordCommand.php
  9. 1 1
      src/Console/UninstallCommand.php
  10. 4 4
      src/Controllers/AuthController.php
  11. 5 5
      src/Controllers/ExtensionController.php
  12. 1 1
      src/Controllers/LogController.php
  13. 2 2
      src/Controllers/MenuController.php
  14. 9 9
      src/Controllers/PermissionController.php
  15. 2 2
      src/Controllers/RoleController.php
  16. 3 3
      src/Controllers/RouteController.php
  17. 4 4
      src/Controllers/ScaffoldController.php
  18. 4 4
      src/Controllers/UserController.php
  19. 1 1
      src/Extension.php
  20. 17 17
      src/Form.php
  21. 10 10
      src/Form/Builder.php
  22. 2 2
      src/Form/Concerns/HasEvents.php
  23. 8 8
      src/Form/Concerns/HasFieldValidator.php
  24. 6 6
      src/Form/Concerns/HasFiles.php
  25. 3 3
      src/Form/Concerns/HasSteps.php
  26. 2 2
      src/Form/Condition.php
  27. 2 2
      src/Form/Field.php
  28. 3 3
      src/Form/Field/BootstrapFile.php
  29. 3 3
      src/Form/Field/BootstrapMultipleFile.php
  30. 4 4
      src/Form/Field/BootstrapUploadField.php
  31. 1 1
      src/Form/Field/Captcha.php
  32. 4 4
      src/Form/Field/Embeds.php
  33. 2 2
      src/Form/Field/File.php
  34. 5 5
      src/Form/Field/HasMany.php
  35. 2 2
      src/Form/Field/Image.php
  36. 5 5
      src/Form/Field/ImageField.php
  37. 3 3
      src/Form/Field/KeyValue.php
  38. 5 5
      src/Form/Field/ListField.php
  39. 1 1
      src/Form/Field/PlainInput.php
  40. 2 2
      src/Form/Field/Select.php
  41. 2 2
      src/Form/Field/SelectResource.php
  42. 1 1
      src/Form/Field/Table.php
  43. 3 3
      src/Form/Field/Tags.php
  44. 1 1
      src/Form/Field/Tree.php
  45. 15 15
      src/Form/Field/UploadField.php
  46. 2 2
      src/Form/Field/WebUploader.php
  47. 6 6
      src/Form/Footer.php
  48. 2 2
      src/Form/NestedForm.php
  49. 8 8
      src/Form/StepBuilder.php
  50. 1 1
      src/Form/Tab.php
  51. 6 6
      src/Form/Tools.php
  52. 17 17
      src/Grid.php
  53. 2 2
      src/Grid/Actions/QuickEdit.php
  54. 7 7
      src/Grid/Column.php
  55. 2 2
      src/Grid/Column/Condition.php
  56. 3 3
      src/Grid/Column/Filter/Between.php
  57. 2 2
      src/Grid/Column/HasDisplayers.php
  58. 1 1
      src/Grid/Column/Sorter.php
  59. 11 11
      src/Grid/Concerns/HasActions.php
  60. 6 6
      src/Grid/Concerns/HasExporter.php
  61. 4 4
      src/Grid/Concerns/HasFilter.php
  62. 3 3
      src/Grid/Concerns/HasMultipleHeader.php
  63. 4 4
      src/Grid/Concerns/HasPaginator.php
  64. 7 7
      src/Grid/Concerns/HasQuickSearch.php
  65. 1 1
      src/Grid/Concerns/HasSelector.php
  66. 6 6
      src/Grid/Concerns/HasTools.php
  67. 10 10
      src/Grid/Displayers/Actions.php
  68. 8 8
      src/Grid/Displayers/DropdownActions.php
  69. 2 2
      src/Grid/Displayers/Editable.php
  70. 1 1
      src/Grid/Displayers/Modal.php
  71. 1 1
      src/Grid/Displayers/Orderable.php
  72. 1 1
      src/Grid/Displayers/SwitchGroup.php
  73. 4 4
      src/Grid/Exporter.php
  74. 1 1
      src/Grid/Exporters/AbstractExporter.php
  75. 1 1
      src/Grid/Exporters/ExcelExporter.php
  76. 7 7
      src/Grid/Filter.php
  77. 2 2
      src/Grid/Filter/AbstractFilter.php
  78. 3 3
      src/Grid/Filter/Between.php
  79. 1 1
      src/Grid/Filter/Group.php
  80. 2 2
      src/Grid/Filter/Presenter/Select.php
  81. 2 2
      src/Grid/Filter/Presenter/SelectResource.php
  82. 1 1
      src/Grid/GridAction.php
  83. 5 5
      src/Grid/Model.php
  84. 1 1
      src/Grid/Row.php
  85. 1 1
      src/Grid/RowAction.php
  86. 2 2
      src/Grid/Tools.php
  87. 1 1
      src/Grid/Tools/AbstractTool.php
  88. 2 2
      src/Grid/Tools/BatchActions.php
  89. 4 4
      src/Grid/Tools/CreateButton.php
  90. 4 4
      src/Grid/Tools/ExportButton.php
  91. 3 3
      src/Grid/Tools/FilterButton.php
  92. 1 1
      src/Grid/Tools/Paginator.php
  93. 4 4
      src/Grid/Tools/Selector.php
  94. 1 1
      src/Layout/Column.php
  95. 4 4
      src/Layout/Content.php
  96. 5 5
      src/Layout/Menu.php
  97. 1 1
      src/Layout/Navbar.php
  98. 1 1
      src/Layout/Row.php
  99. 6 6
      src/Layout/SectionManager.php
  100. 2 2
      src/Middleware/Authenticate.php

+ 3 - 3
src/Admin.php

@@ -353,7 +353,7 @@ class Admin
         if (is_string($repository)) {
             $repository = new $class($args);
         }
-        if (!$repository instanceof Repository) {
+        if (! $repository instanceof Repository) {
             throw new \InvalidArgumentException("[$class] must be a valid repository class.");
         }
 
@@ -387,7 +387,7 @@ class Admin
 
         static::$availableExtensions = [];
         foreach (static::$extensions as $k => $extension) {
-            if (!config("admin-extensions.{$k}.enable")) {
+            if (! config("admin-extensions.{$k}.enable")) {
                 continue;
             }
 
@@ -419,7 +419,7 @@ class Admin
      */
     public static function enableExtenstion(string $class, bool $enable = true)
     {
-        if (!$class || !is_subclass_of($class, Extension::class)) {
+        if (! $class || ! is_subclass_of($class, Extension::class)) {
             return false;
         }
 

+ 3 - 3
src/AdminServiceProvider.php

@@ -178,11 +178,11 @@ class AdminServiceProvider extends ServiceProvider
     protected function registerDefaultSections()
     {
         Content::composing(function () {
-            if (!admin_has_default_section(\AdminSection::NAVBAR_USER_PANEL)) {
+            if (! admin_has_default_section(\AdminSection::NAVBAR_USER_PANEL)) {
                 admin_inject_default_section(\AdminSection::NAVBAR_USER_PANEL, view('admin::partials.navbar-user-panel'));
             }
 
-            if (!admin_has_default_section(\AdminSection::LEFT_SIDEBAR_USER_PANEL)) {
+            if (! admin_has_default_section(\AdminSection::LEFT_SIDEBAR_USER_PANEL)) {
                 admin_inject_default_section(\AdminSection::LEFT_SIDEBAR_USER_PANEL, view('admin::partials.sidebar-user-panel'));
             }
 
@@ -219,7 +219,7 @@ class AdminServiceProvider extends ServiceProvider
             $router->aliasMiddleware($key, $middleware);
         }
 
-        $disablePermission = !config('admin.permission.enable');
+        $disablePermission = ! config('admin.permission.enable');
 
         // register middleware group.
         foreach ($this->middlewareGroups as $key => $middleware) {

+ 2 - 2
src/Auth/Permission.php

@@ -48,7 +48,7 @@ class Permission
             return true;
         }
 
-        if (!Admin::user()->inRoles($roles)) {
+        if (! Admin::user()->inRoles($roles)) {
             static::error();
         }
     }
@@ -86,7 +86,7 @@ class Permission
      */
     public static function error()
     {
-        if (!request()->pjax() && request()->ajax()) {
+        if (! request()->pjax() && request()->ajax()) {
             abort(403, trans('admin.deny'));
         }
 

+ 1 - 1
src/Console/CreateUserCommand.php

@@ -25,7 +25,7 @@ class CreateUserCommand extends Command
      */
     public function handle()
     {
-        if (!config('app.debug')) {
+        if (! config('app.debug')) {
             $this->error('Permission deny!');
 
             return;

+ 5 - 5
src/Console/ExtendCommand.php

@@ -82,14 +82,14 @@ class ExtendCommand extends Command
 //            goto InputExtensionDir;
         }
 
-        if (!file_exists($this->extensionDir)) {
+        if (! file_exists($this->extensionDir)) {
             $this->makeDir();
         }
 
         $this->package = $this->argument('extension');
 
         InputExtensionName:
-        if (!$this->validateExtensionName($this->package)) {
+        if (! $this->validateExtensionName($this->package)) {
             $this->package = $this->ask("[$this->package] is not a valid package name, please input a name like (<vendor>/<name>)");
             goto InputExtensionName;
         }
@@ -206,8 +206,8 @@ TREE;
      */
     protected function getRootNameSpace()
     {
-        if (!$namespace = $this->option('namespace')) {
-            list($vendor, $name) = explode('/', $this->package);
+        if (! $namespace = $this->option('namespace')) {
+            [$vendor, $name] = explode('/', $this->package);
 
             $default = str_replace(['-', '-'], '', Str::title($vendor).'\\'.Str::title($name));
 
@@ -296,7 +296,7 @@ TREE;
             return;
         }
 
-        if (!file_exists($from)) {
+        if (! file_exists($from)) {
             return;
         }
 

+ 3 - 3
src/Console/IdeHelperCommand.php

@@ -68,7 +68,7 @@ class IdeHelperCommand extends Command
      */
     public function handle()
     {
-        if (!config('app.debug')) {
+        if (! config('app.debug')) {
             $this->error('Permission deny!');
 
             return;
@@ -147,7 +147,7 @@ class IdeHelperCommand extends Command
         return $this->getAllControllers()
             ->merge(explode(',', $option))
             ->map(function ($controller) use (&$reject) {
-                if (!$controller || !$content = $this->getClassContent($controller)) {
+                if (! $controller || ! $content = $this->getClassContent($controller)) {
                     return [];
                 }
 
@@ -374,7 +374,7 @@ class IdeHelperCommand extends Command
      */
     public function getFileNameByClass($class)
     {
-        if (!class_exists($class)) {
+        if (! class_exists($class)) {
             return;
         }
 

+ 2 - 2
src/Console/ImportCommand.php

@@ -35,13 +35,13 @@ class ImportCommand extends VendorPublishCommand
 
         $extensions = Admin::getExtensions();
 
-        if (empty($extension) || !Arr::has($extensions, $extension)) {
+        if (empty($extension) || ! Arr::has($extensions, $extension)) {
             $extension = $this->choice('Please choose a extension to import', array_keys($extensions));
         }
 
         $className = Arr::get($extensions, $extension);
 
-        if (!class_exists($className) || !is_subclass_of($className, Extension::class) || !$className::make()->getName()) {
+        if (! class_exists($className) || ! is_subclass_of($className, Extension::class) || ! $className::make()->getName()) {
             $this->error("Invalid Extension [$className]");
 
             return;

+ 1 - 1
src/Console/ResetPasswordCommand.php

@@ -25,7 +25,7 @@ class ResetPasswordCommand extends Command
      */
     public function handle()
     {
-        if (!config('app.debug')) {
+        if (! config('app.debug')) {
             $this->error('Permission deny!');
 
             return;

+ 1 - 1
src/Console/UninstallCommand.php

@@ -27,7 +27,7 @@ class UninstallCommand extends Command
      */
     public function handle()
     {
-        if (!$this->confirm('Are you sure to uninstall dcat-admin?')) {
+        if (! $this->confirm('Are you sure to uninstall dcat-admin?')) {
             return;
         }
 

+ 4 - 4
src/Controllers/AuthController.php

@@ -114,7 +114,7 @@ class AuthController extends Controller
     {
         $form = $this->settingForm();
 
-        if (!$this->validateCredentialsWhenUpdatingPassword()) {
+        if (! $this->validateCredentialsWhenUpdatingPassword()) {
             $form->responseValidationMessages('old_password', trans('admin.old_password_error'));
         }
 
@@ -129,13 +129,13 @@ class AuthController extends Controller
         $newPassword = \request('password');
 
         if (
-            (!$newPassword)
+            (! $newPassword)
             || ($newPassword === $user->getAuthPassword())
         ) {
             return true;
         }
 
-        if (!$oldPassword) {
+        if (! $oldPassword) {
             return false;
         }
 
@@ -189,7 +189,7 @@ class AuthController extends Controller
                 $form->password = bcrypt($form->password);
             }
 
-            if (!$form->password) {
+            if (! $form->password) {
                 $form->deleteInput('password');
             }
         });

+ 5 - 5
src/Controllers/ExtensionController.php

@@ -41,7 +41,7 @@ class ExtensionController extends Controller
     {
         $extension = request('id');
 
-        if (!$extension) {
+        if (! $extension) {
             return response()->json(['status' => false, 'messages' => 'Invalid extension hash.']);
         }
 
@@ -111,7 +111,7 @@ class ExtensionController extends Controller
             })
             ->limit(14)
             ->expand(function ($expand) {
-                if (!$this->description) {
+                if (! $this->description) {
                     return;
                 }
 
@@ -168,7 +168,7 @@ class ExtensionController extends Controller
     protected function getExpandHandler($key = 'require')
     {
         return function () use ($key) {
-            if (!$this->{$key}) {
+            if (! $this->{$key}) {
                 return;
             }
 
@@ -204,7 +204,7 @@ class ExtensionController extends Controller
         };
 
         $authors = function ($v) {
-            if (!$v) {
+            if (! $v) {
                 return;
             }
 
@@ -216,7 +216,7 @@ class ExtensionController extends Controller
         };
 
         $imported = function ($v) {
-            if (!$v) {
+            if (! $v) {
                 $text = trans('admin.is_not_import');
 
                 return "<label class='label label-default'>$text</label>";

+ 1 - 1
src/Controllers/LogController.php

@@ -69,7 +69,7 @@ class LogController extends Controller
             $filter->equal('user_id', trans('admin.user'))
                 ->selectResource('auth/users')
                 ->options(function ($v) {
-                    if (!$v) {
+                    if (! $v) {
                         return $v;
                     }
                     $userModel = config('admin.database.users_model');

+ 2 - 2
src/Controllers/MenuController.php

@@ -71,7 +71,7 @@ class MenuController extends Controller
         $tree->branch(function ($branch) {
             $payload = "<i class='fa {$branch['icon']}'></i>&nbsp;<strong>{$branch['title']}</strong>";
 
-            if (!isset($branch['children'])) {
+            if (! isset($branch['children'])) {
                 if (url()->isValidUrl($branch['uri'])) {
                     $uri = $branch['uri'];
                 } else {
@@ -141,7 +141,7 @@ class MenuController extends Controller
                     return (new $permissionModel())->allNodes();
                 })
                 ->customFormat(function ($v) {
-                    if (!$v) {
+                    if (! $v) {
                         return [];
                     }
 

+ 9 - 9
src/Controllers/PermissionController.php

@@ -128,7 +128,7 @@ class PermissionController extends Controller
 
             $path = array_filter($branch['http_path']);
 
-            if (!$path) {
+            if (! $path) {
                 return $payload.'</div>&nbsp;';
             }
 
@@ -142,11 +142,11 @@ class PermissionController extends Controller
 
             $path = collect($path)->map(function ($path) use ($branch, &$method) {
                 if (Str::contains($path, ':')) {
-                    list($me, $path) = explode(':', $path);
+                    [$me, $path] = explode(':', $path);
 
                     $method = array_merge($method, explode(',', $me));
                 }
-                if ($path !== '...' && !empty(config('admin.route.prefix'))) {
+                if ($path !== '...' && ! empty(config('admin.route.prefix'))) {
                     $path = admin_base_path($path);
                 }
 
@@ -183,7 +183,7 @@ class PermissionController extends Controller
         $grid->name;
 
         $grid->http_path->display(function ($path) {
-            if (!$path) {
+            if (! $path) {
                 return;
             }
 
@@ -196,7 +196,7 @@ class PermissionController extends Controller
 
             return collect($path)->filter()->map(function ($path) use ($method) {
                 if (Str::contains($path, ':')) {
-                    list($method, $path) = explode(':', $path);
+                    [$method, $path] = explode(':', $path);
                     $method = collect(explode(',', $method))->map(function ($name) {
                         return strtoupper($name);
                     })->map(function ($name) {
@@ -204,7 +204,7 @@ class PermissionController extends Controller
                     })->implode('&nbsp;').'&nbsp;';
                 }
 
-                if (!empty(config('admin.route.prefix'))) {
+                if (! empty(config('admin.route.prefix'))) {
                     $path = admin_base_path($path);
                 }
 
@@ -256,7 +256,7 @@ class PermissionController extends Controller
                 $method = $this->http_method ?: ['ANY'];
 
                 if (Str::contains($path, ':')) {
-                    list($method, $path) = explode(':', $path);
+                    [$method, $path] = explode(':', $path);
                     $method = explode(',', $method);
                 }
 
@@ -266,7 +266,7 @@ class PermissionController extends Controller
                     return "<span class='label label-primary'>{$name}</span>";
                 })->implode('&nbsp;');
 
-                if (!empty(config('admin.route.prefix'))) {
+                if (! empty(config('admin.route.prefix'))) {
                     $path = '/'.trim(config('admin.route.prefix'), '/').$path;
                 }
 
@@ -324,7 +324,7 @@ class PermissionController extends Controller
         $prefix = config('admin.route.prefix');
 
         return collect(app('router')->getRoutes())->map(function ($route) use ($prefix) {
-            if (!Str::startsWith($uri = $route->uri(), $prefix)) {
+            if (! Str::startsWith($uri = $route->uri(), $prefix)) {
                 return;
             }
 

+ 2 - 2
src/Controllers/RoleController.php

@@ -107,7 +107,7 @@ class RoleController extends Controller
         $grid->slug->label('primary');
         $grid->name;
 
-        if (!$mini) {
+        if (! $mini) {
             $grid->created_at;
             $grid->updated_at->sortable();
         }
@@ -181,7 +181,7 @@ class RoleController extends Controller
                     return $permissionModel->allNodes();
                 })
                 ->customFormat(function ($v) {
-                    if (!$v) {
+                    if (! $v) {
                         return [];
                     }
 

+ 3 - 3
src/Controllers/RouteController.php

@@ -116,10 +116,10 @@ class RouteController extends Controller
                 return $this->routes = collect($this->routes)->filter(function ($route) {
                     foreach ($this->where as $column => $condition) {
                         if (is_array($route[$column])) {
-                            if (!in_array($condition, $route[$column])) {
+                            if (! in_array($condition, $route[$column])) {
                                 return false;
                             }
-                        } elseif (!Str::contains(strtolower($route[$column]), strtolower($condition))) {
+                        } elseif (! Str::contains(strtolower($route[$column]), strtolower($condition))) {
                             return false;
                         }
                     }
@@ -187,7 +187,7 @@ class RouteController extends Controller
             $column = $sort['column'];
             $type = $sort['type'];
 
-            return $type === 'asc' ? !$route[$column] : $route[$column];
+            return $type === 'asc' ? ! $route[$column] : $route[$column];
         });
     }
 

+ 4 - 4
src/Controllers/ScaffoldController.php

@@ -63,7 +63,7 @@ class ScaffoldController extends Controller
 
     public function index(Content $content)
     {
-        if (!config('app.debug')) {
+        if (! config('app.debug')) {
             Permission::error();
         }
 
@@ -84,7 +84,7 @@ class ScaffoldController extends Controller
 
     public function store(Request $request)
     {
-        if (!config('app.debug')) {
+        if (! config('app.debug')) {
             Permission::error();
         }
 
@@ -168,7 +168,7 @@ class ScaffoldController extends Controller
     {
         $db = addslashes(\request('db'));
         $table = \request('tb');
-        if (!$table || !$db) {
+        if (! $table || ! $db) {
             return ['status' => 1, 'list' => []];
         }
 
@@ -212,7 +212,7 @@ class ScaffoldController extends Controller
                 $tmp = DB::connection($connectName)->select($sql);
 
                 $collection = collect($tmp)->map(function ($v) use ($value) {
-                    if (!$p = Arr::get($value, 'prefix')) {
+                    if (! $p = Arr::get($value, 'prefix')) {
                         return (array) $v;
                     }
                     $v = (array) $v;

+ 4 - 4
src/Controllers/UserController.php

@@ -100,7 +100,7 @@ class UserController extends Controller
             $nodes = (new $permissionModel())->allNodes();
             $grid->permissions
                 ->if(function () {
-                    return !empty($this->roles);
+                    return ! empty($this->roles);
                 })
                 ->tree(function (Grid\Displayers\Tree $tree) use (&$nodes, $roleModel) {
                     $tree->nodes($nodes);
@@ -176,7 +176,7 @@ class UserController extends Controller
             $show->divider();
 
             $show->roles->width(6)->as(function ($roles) {
-                if (!$roles) {
+                if (! $roles) {
                     return;
                 }
 
@@ -201,7 +201,7 @@ class UserController extends Controller
                     }
                 }
 
-                if (!$isAdministrator) {
+                if (! $isAdministrator) {
                     $keyName = $permissionModel->getKeyName();
                     $tree->checked(
                         $roleModel::getPermissionId(array_column($roles, $keyName))->flatten()
@@ -283,7 +283,7 @@ class UserController extends Controller
                 $form->password = bcrypt($form->password);
             }
 
-            if (!$form->password) {
+            if (! $form->password) {
                 $form->deleteInput('password');
             }
         });

+ 1 - 1
src/Extension.php

@@ -198,7 +198,7 @@ abstract class Extension
      */
     final public static function disabled()
     {
-        return !static::enabled();
+        return ! static::enabled();
     }
 
     /**

+ 17 - 17
src/Form.php

@@ -401,7 +401,7 @@ class Form implements Renderable
      */
     public function disableAjaxSubmit(bool $disable = true)
     {
-        $this->useAjaxSubmit = !$disable;
+        $this->useAjaxSubmit = ! $disable;
 
         return $this;
     }
@@ -621,7 +621,7 @@ class Form implements Renderable
         }
 
         if ($response = $this->handleUploadFile($data)) {
-            if (($value = $response->getData()) && !empty($value->id)) {
+            if (($value = $response->getData()) && ! empty($value->id)) {
                 $this->step()->stash(
                     [$data['upload_column'] => $value->id],
                     true
@@ -684,7 +684,7 @@ class Form implements Renderable
      */
     public function isAjaxRequest()
     {
-        return $this->request->ajax() && !$this->request->pjax();
+        return $this->request->ajax() && ! $this->request->pjax();
     }
 
     /**
@@ -848,7 +848,7 @@ class Form implements Renderable
      */
     protected function makeValidationErrorsResponse($validationMessages)
     {
-        if (!$this->isAjaxRequest()) {
+        if (! $this->isAjaxRequest()) {
             return back()->withInput()->withErrors($validationMessages);
         }
 
@@ -977,7 +977,7 @@ class Form implements Renderable
             $columns = $field->column();
 
             // If column not in input array data, then continue.
-            if (!Arr::has($updates, $columns)) {
+            if (! Arr::has($updates, $columns)) {
                 continue;
             }
 
@@ -1010,8 +1010,8 @@ class Form implements Renderable
     protected function invalidColumn($columns, $oneToOneRelation = false)
     {
         foreach ((array) $columns as $column) {
-            if ((!$oneToOneRelation && Str::contains($column, '.')) ||
-                ($oneToOneRelation && !Str::contains($column, '.'))) {
+            if ((! $oneToOneRelation && Str::contains($column, '.')) ||
+                ($oneToOneRelation && ! Str::contains($column, '.'))) {
                 return true;
             }
         }
@@ -1104,7 +1104,7 @@ class Form implements Renderable
      */
     public function getKeyName()
     {
-        if (!$this->repository) {
+        if (! $this->repository) {
             return 'id';
         }
 
@@ -1116,7 +1116,7 @@ class Form implements Renderable
      */
     public function getCreatedAtColumn()
     {
-        if (!$this->repository) {
+        if (! $this->repository) {
             return;
         }
 
@@ -1128,7 +1128,7 @@ class Form implements Renderable
      */
     public function getUpdatedAtColumn()
     {
-        if (!$this->repository) {
+        if (! $this->repository) {
             return;
         }
 
@@ -1158,7 +1158,7 @@ class Form implements Renderable
         if (is_array($columns)) {
             $value = [];
             foreach ($columns as $name => $column) {
-                if (!Arr::has($data, $column)) {
+                if (! Arr::has($data, $column)) {
                     continue;
                 }
                 $value[$name] = Arr::get($data, $column);
@@ -1214,7 +1214,7 @@ class Form implements Renderable
         $data = $this->model->toArray();
 
         $this->builder->fields()->each(function (Field $field) use ($data) {
-            if (!in_array($field->column(), $this->ignored)) {
+            if (! in_array($field->column(), $this->ignored)) {
                 $field->fill($data);
             }
         });
@@ -1294,11 +1294,11 @@ class Form implements Renderable
 
         /** @var Field $field */
         foreach ($this->builder->fields() as $field) {
-            if (!$validator = $field->getValidator($input)) {
+            if (! $validator = $field->getValidator($input)) {
                 continue;
             }
 
-            if (($validator instanceof Validator) && !$validator->passes()) {
+            if (($validator instanceof Validator) && ! $validator->passes()) {
                 $failedValidators[] = $validator;
             }
         }
@@ -1324,11 +1324,11 @@ class Form implements Renderable
             return $this->responseValidationMessages($column->getMessageBag()->getMessages());
         }
 
-        if (!$this->validationMessages) {
+        if (! $this->validationMessages) {
             $this->validationMessages = new MessageBag();
         }
 
-        if (!$column) {
+        if (! $column) {
             return $this;
         }
 
@@ -1727,7 +1727,7 @@ class Form implements Renderable
      */
     public function inModal(\Closure $callback = null)
     {
-        if (!$callback) {
+        if (! $callback) {
             return ModalForm::is();
         }
 

+ 10 - 10
src/Form/Builder.php

@@ -241,7 +241,7 @@ class Builder
      */
     public function step(?\Closure $callback = null)
     {
-        if (!$this->stepBuilder) {
+        if (! $this->stepBuilder) {
             $this->view = 'admin::form.steps';
 
             $this->stepBuilder = new StepBuilder($this->form);
@@ -478,7 +478,7 @@ class Builder
      */
     public function stepField($name)
     {
-        if (!$builder = $this->getStepBuilder()) {
+        if (! $builder = $this->getStepBuilder()) {
             return;
         }
 
@@ -496,7 +496,7 @@ class Builder
     {
         $fields = new Collection();
 
-        if (!$builder = $this->getStepBuilder()) {
+        if (! $builder = $this->getStepBuilder()) {
             return $fields;
         }
 
@@ -526,7 +526,7 @@ class Builder
      */
     public function hasRows()
     {
-        return !empty($this->form->getRows());
+        return ! empty($this->form->getRows());
     }
 
     /**
@@ -597,7 +597,7 @@ class Builder
      */
     public function disableHeader(bool $disable = true)
     {
-        $this->showHeader = !$disable;
+        $this->showHeader = ! $disable;
     }
 
     /**
@@ -607,7 +607,7 @@ class Builder
      */
     public function disableFooter(bool $disable = true)
     {
-        $this->showFooter = !$disable;
+        $this->showFooter = ! $disable;
     }
 
     /**
@@ -676,7 +676,7 @@ class Builder
     {
         $previous = URL::previous();
 
-        if (!$previous || $previous == URL::current()) {
+        if (! $previous || $previous == URL::current()) {
             return;
         }
 
@@ -741,7 +741,7 @@ class Builder
      */
     protected function removeReservedFields()
     {
-        if (!$this->isMode(static::MODE_CREATE)) {
+        if (! $this->isMode(static::MODE_CREATE)) {
             return;
         }
 
@@ -774,7 +774,7 @@ class Builder
      */
     public function renderFooter()
     {
-        if (!$this->showFooter) {
+        if (! $this->showFooter) {
             return;
         }
 
@@ -792,7 +792,7 @@ class Builder
 
         $tabObj = $this->form->getTab();
 
-        if (!$tabObj->isEmpty()) {
+        if (! $tabObj->isEmpty()) {
             $this->setupTabScript();
         }
 

+ 2 - 2
src/Form/Concerns/HasEvents.php

@@ -197,8 +197,8 @@ trait HasEvents
 
             if (
                 $response
-                || !$ret
-                || !$ret instanceof Response
+                || ! $ret
+                || ! $ret instanceof Response
                 || ($ret instanceof RedirectResponse && $this->isAjaxRequest())
             ) {
                 continue;

+ 8 - 8
src/Form/Concerns/HasFieldValidator.php

@@ -129,11 +129,11 @@ trait HasFieldValidator
             $rules = array_filter(explode('|', $rules));
         }
 
-        if (!$this->form) {
+        if (! $this->form) {
             return $rules;
         }
 
-        if (method_exists($this->form, 'getKey') || !$id = $this->form->getKey()) {
+        if (method_exists($this->form, 'getKey') || ! $id = $this->form->getKey()) {
             return $rules;
         }
 
@@ -175,7 +175,7 @@ trait HasFieldValidator
         if ($input instanceof \Closure) {
             $rules = $input;
         } else {
-            if (!empty($original)) {
+            if (! empty($original)) {
                 $original = $this->formatRules($original);
             }
             $rules = array_merge($original, $this->formatRules($input));
@@ -236,7 +236,7 @@ trait HasFieldValidator
             return;
         }
 
-        if (!is_string($rules)) {
+        if (! is_string($rules)) {
             return;
         }
 
@@ -287,7 +287,7 @@ trait HasFieldValidator
             return in_array($rule, $rules);
         }
 
-        if (!is_string($rules)) {
+        if (! is_string($rules)) {
             return false;
         }
 
@@ -325,12 +325,12 @@ trait HasFieldValidator
 
         $rules = $attributes = [];
 
-        if (!$fieldRules = $this->getRules()) {
+        if (! $fieldRules = $this->getRules()) {
             return false;
         }
 
         if (is_string($this->column)) {
-            if (!Arr::has($input, $this->column)) {
+            if (! Arr::has($input, $this->column)) {
                 return false;
             }
 
@@ -342,7 +342,7 @@ trait HasFieldValidator
 
         if (is_array($this->column)) {
             foreach ($this->column as $key => $column) {
-                if (!array_key_exists($column, $input)) {
+                if (! array_key_exists($column, $input)) {
                     continue;
                 }
                 $input[$column.$key] = Arr::get($input, $column);

+ 6 - 6
src/Form/Concerns/HasFiles.php

@@ -19,7 +19,7 @@ trait HasFiles
         $column = $data['upload_column'] ?? null;
         $file = $data['file'] ?? null;
 
-        if (!$column && !$file instanceof UploadedFile) {
+        if (! $column && ! $file instanceof UploadedFile) {
             return;
         }
 
@@ -37,14 +37,14 @@ trait HasFiles
      */
     protected function handleFileDeleteBeforeCreate(array $data)
     {
-        if (!array_key_exists(Field::FILE_DELETE_FLAG, $data)) {
+        if (! array_key_exists(Field::FILE_DELETE_FLAG, $data)) {
             return;
         }
 
         $column = $data['_column'] ?? null;
         $file = $data['key'] ?? null;
 
-        if (!$column && !$file) {
+        if (! $column && ! $file) {
             return;
         }
 
@@ -85,7 +85,7 @@ trait HasFiles
     public function deleteFiles($data, $forceDelete = false)
     {
         // If it's a soft delete, the files in the data will not be deleted.
-        if (!$forceDelete && $this->isSoftDeletes) {
+        if (! $forceDelete && $this->isSoftDeletes) {
             return;
         }
 
@@ -106,14 +106,14 @@ trait HasFiles
      */
     protected function handleFileDelete(array $input = [])
     {
-        if (!array_key_exists(Field::FILE_DELETE_FLAG, $input)) {
+        if (! array_key_exists(Field::FILE_DELETE_FLAG, $input)) {
             return $input;
         }
 
         $input[Field::FILE_DELETE_FLAG] = $input['key'];
         unset($input['key']);
 
-        if (!empty($input['_column'])) {
+        if (! empty($input['_column'])) {
             $input[$input['_column']] = '';
 
             unset($input['_column']);

+ 3 - 3
src/Form/Concerns/HasSteps.php

@@ -33,7 +33,7 @@ trait HasSteps
         if (
             empty($stepBuilder)
             || empty($stepBuilder->count())
-            || (!isset($data[StepBuilder::ALL_STEPS]) && !$this->isStepFormValidationRequest())
+            || (! isset($data[StepBuilder::ALL_STEPS]) && ! $this->isStepFormValidationRequest())
         ) {
             return;
         }
@@ -54,7 +54,7 @@ trait HasSteps
             return;
         }
 
-        if (!empty($data[StepBuilder::ALL_STEPS])) {
+        if (! empty($data[StepBuilder::ALL_STEPS])) {
             foreach ($steps as $stepForm) {
                 foreach ($stepForm->fields() as $field) {
                     $this->pushField($field);
@@ -98,7 +98,7 @@ trait HasSteps
      */
     protected function responseDoneStep()
     {
-        if (!$builder = $this->builder->getStepBuilder()) {
+        if (! $builder = $this->builder->getStepBuilder()) {
             return;
         }
 

+ 2 - 2
src/Form/Condition.php

@@ -48,7 +48,7 @@ class Condition
         $self = $this;
 
         $condition = $this->form->if(function () use ($self) {
-            return !$self->getResult();
+            return ! $self->getResult();
         });
 
         if ($next) {
@@ -65,7 +65,7 @@ class Condition
         }
         $this->done = true;
 
-        if (!$this->is()) {
+        if (! $this->is()) {
             return;
         }
 

+ 2 - 2
src/Form/Field.php

@@ -862,7 +862,7 @@ class Field implements Renderable
      */
     protected function getElementClass()
     {
-        if (!$this->elementClass) {
+        if (! $this->elementClass) {
             $name = $this->elementName ?: $this->formatName($this->column);
 
             $this->elementClass = (array) str_replace(['[', ']'], '_', $name);
@@ -1134,7 +1134,7 @@ class Field implements Renderable
      */
     public function render()
     {
-        if (!$this->shouldRender()) {
+        if (! $this->shouldRender()) {
             return '';
         }
 

+ 3 - 3
src/Form/Field/BootstrapFile.php

@@ -83,7 +83,7 @@ class BootstrapFile extends Field
 
         $rules = $attributes = [];
 
-        if (!$fieldRules = $this->getRules()) {
+        if (! $fieldRules = $this->getRules()) {
             return false;
         }
 
@@ -124,7 +124,7 @@ class BootstrapFile extends Field
 
         $path = null;
 
-        if (!is_null($this->storagePermission)) {
+        if (! is_null($this->storagePermission)) {
             $path = $this->storage->putFileAs($this->getDirectory(), $file, $this->name, $this->storagePermission);
         } else {
             $path = $this->storage->putFileAs($this->getDirectory(), $file, $this->name);
@@ -177,7 +177,7 @@ class BootstrapFile extends Field
         $this->options(['overwriteInitial' => true]);
         $this->setupDefaultOptions();
 
-        if (!empty($this->value)) {
+        if (! empty($this->value)) {
             $this->attribute('data-initial-preview', $this->preview());
             $this->attribute('data-initial-caption', $this->initialCaption($this->value));
 

+ 3 - 3
src/Form/Field/BootstrapMultipleFile.php

@@ -68,13 +68,13 @@ class BootstrapMultipleFile extends Field
 
         $attributes = [];
 
-        if (!$fieldRules = $this->getRules()) {
+        if (! $fieldRules = $this->getRules()) {
             return false;
         }
 
         $attributes[$this->column] = $this->label;
 
-        list($rules, $input) = $this->hydrateFiles(Arr::get($input, $this->column, []));
+        [$rules, $input] = $this->hydrateFiles(Arr::get($input, $this->column, []));
 
         return Validator::make($input, $rules, $this->getValidationMessages(), $attributes);
     }
@@ -219,7 +219,7 @@ class BootstrapMultipleFile extends Field
 
         $this->setupDefaultOptions();
 
-        if (!empty($this->value())) {
+        if (! empty($this->value())) {
             $this->options(['initialPreview' => $this->preview()]);
             $this->setupPreviewOptions();
         }

+ 4 - 4
src/Form/Field/BootstrapUploadField.php

@@ -103,7 +103,7 @@ trait BootstrapUploadField
      */
     protected function setupPreviewOptions()
     {
-        if (!$this->removable) {
+        if (! $this->removable) {
             return;
         }
 
@@ -153,7 +153,7 @@ trait BootstrapUploadField
         try {
             $this->storage = Storage::disk($disk);
         } catch (\Exception $exception) {
-            if (!array_key_exists($disk, config('filesystems.disks'))) {
+            if (! array_key_exists($disk, config('filesystems.disks'))) {
                 admin_error(
                     'Config error.',
                     "Disk [$disk] not configured, please add a disk config in `config/filesystems.php`."
@@ -304,7 +304,7 @@ trait BootstrapUploadField
     {
         $this->renameIfExists($file);
 
-        if (!is_null($this->storagePermission)) {
+        if (! is_null($this->storagePermission)) {
             return $this->storage->putFileAs($this->getDirectory(), $file, $this->name, $this->storagePermission);
         }
 
@@ -396,7 +396,7 @@ trait BootstrapUploadField
      */
     protected function deleteFile($path)
     {
-        if (!$path) {
+        if (! $path) {
             return;
         }
         if ($this->storage->exists($path)) {

+ 1 - 1
src/Form/Field/Captcha.php

@@ -10,7 +10,7 @@ class Captcha extends Text
 
     public function __construct()
     {
-        if (!class_exists(\Mews\Captcha\Captcha::class)) {
+        if (! class_exists(\Mews\Captcha\Captcha::class)) {
             throw new \Exception('To use captcha field, please install [mews/captcha] first.');
         }
 

+ 4 - 4
src/Form/Field/Embeds.php

@@ -31,7 +31,7 @@ class Embeds extends Field
         }
 
         if (count($arguments) == 2) {
-            list($this->label, $this->builder) = $arguments;
+            [$this->label, $this->builder] = $arguments;
         }
     }
 
@@ -54,7 +54,7 @@ class Embeds extends Field
      */
     public function getValidator(array $input)
     {
-        if (!array_key_exists($this->column, $input)) {
+        if (! array_key_exists($this->column, $input)) {
             return false;
         }
 
@@ -64,7 +64,7 @@ class Embeds extends Field
 
         /** @var Field $field */
         foreach ($this->buildEmbeddedForm()->fields() as $field) {
-            if (!$fieldRules = $field->getRules()) {
+            if (! $fieldRules = $field->getRules()) {
                 continue;
             }
 
@@ -204,7 +204,7 @@ class Embeds extends Field
         $column = array_flip($column);
 
         foreach ($input[$this->column] as $key => $value) {
-            if (!array_key_exists($key, $column)) {
+            if (! array_key_exists($key, $column)) {
                 continue;
             }
 

+ 2 - 2
src/Form/Field/File.php

@@ -82,7 +82,7 @@ class File extends Field
 
         $rules = $attributes = [];
 
-        if (!$this->hasRule('required')) {
+        if (! $this->hasRule('required')) {
             return false;
         }
 
@@ -159,7 +159,7 @@ class File extends Field
     {
         $this->setDefaultServer();
 
-        if (!empty($this->value())) {
+        if (! empty($this->value())) {
             $this->setupPreviewOptions();
         }
 

+ 5 - 5
src/Form/Field/HasMany.php

@@ -91,7 +91,7 @@ class HasMany extends Field
         }
 
         if (count($arguments) == 2) {
-            list($this->label, $this->builder) = $arguments;
+            [$this->label, $this->builder] = $arguments;
         }
     }
 
@@ -104,7 +104,7 @@ class HasMany extends Field
      */
     public function getValidator(array $input)
     {
-        if (!array_key_exists($this->column, $input)) {
+        if (! array_key_exists($this->column, $input)) {
             return false;
         }
 
@@ -116,7 +116,7 @@ class HasMany extends Field
 
         /* @var Field $field */
         foreach ($form->fields() as $field) {
-            if (!$fieldRules = $field->getRules()) {
+            if (! $fieldRules = $field->getRules()) {
                 continue;
             }
 
@@ -272,7 +272,7 @@ class HasMany extends Field
                 /*
                  * if doesn't have column name, continue to the next loop
                  */
-                if (!array_key_exists($name, $column)) {
+                if (! array_key_exists($name, $column)) {
                     continue;
                 }
 
@@ -646,7 +646,7 @@ JS;
         // specify a view to render.
         $this->view = $this->views[$this->viewMode];
 
-        list($template, $script) = $this->buildNestedForm($this->column, $this->builder)
+        [$template, $script] = $this->buildNestedForm($this->column, $this->builder)
             ->getTemplateHtmlAndScript();
 
         $this->setupScript($script);

+ 2 - 2
src/Form/Field/Image.php

@@ -62,7 +62,7 @@ class Image extends File
 
     protected function setupImage()
     {
-        if (!isset($this->options['accept'])) {
+        if (! isset($this->options['accept'])) {
             $this->options['accept'] = [];
         }
 
@@ -86,7 +86,7 @@ class Image extends File
      */
     public function dimensions(array $options)
     {
-        if (!$options) {
+        if (! $options) {
             return $this;
         }
 

+ 5 - 5
src/Form/Field/ImageField.php

@@ -47,7 +47,7 @@ trait ImageField
      */
     public function callInterventionMethods($target, $mime)
     {
-        if (!empty($this->interventionCalls)) {
+        if (! empty($this->interventionCalls)) {
             $image = ImageManagerStatic::make($target);
 
             $mime = $mime ?: finfo_file(finfo_open(FILEINFO_MIME_TYPE), $target);
@@ -79,7 +79,7 @@ trait ImageField
             return $this;
         }
 
-        if (!class_exists(ImageManagerStatic::class)) {
+        if (! class_exists(ImageManagerStatic::class)) {
             throw new \Exception('To use image handling and manipulation, please install [intervention/image] first.');
         }
 
@@ -123,12 +123,12 @@ trait ImageField
      */
     public function destroyThumbnail($file = null, bool $force = false)
     {
-        if ($this->retainable && !$force) {
+        if ($this->retainable && ! $force) {
             return;
         }
 
         $file = $file ?: $this->original;
-        if (!$file) {
+        if (! $file) {
             return;
         }
 
@@ -184,7 +184,7 @@ trait ImageField
                 $constraint->aspectRatio();
             });
 
-            if (!is_null($this->storagePermission)) {
+            if (! is_null($this->storagePermission)) {
                 $this->getStorage()->put("{$this->getDirectory()}/{$path}", $image->encode(), $this->storagePermission);
             } else {
                 $this->getStorage()->put("{$this->getDirectory()}/{$path}", $image->encode());

+ 3 - 3
src/Form/Field/KeyValue.php

@@ -38,17 +38,17 @@ class KeyValue extends Field
             return $this->validator->call($this, $input);
         }
 
-        if (!is_string($this->column)) {
+        if (! is_string($this->column)) {
             return false;
         }
 
         $rules = $attributes = [];
 
-        if (!$fieldRules = $this->getRules()) {
+        if (! $fieldRules = $this->getRules()) {
             return false;
         }
 
-        if (!Arr::has($input, $this->column)) {
+        if (! Arr::has($input, $this->column)) {
             return false;
         }
 

+ 5 - 5
src/Form/Field/ListField.php

@@ -80,16 +80,16 @@ class ListField extends Field
             return $this->validator->call($this, $input);
         }
 
-        if (!is_string($this->column)) {
+        if (! is_string($this->column)) {
             return false;
         }
 
         $rules = $attributes = [];
-        if (!$fieldRules = $this->getRules()) {
+        if (! $fieldRules = $this->getRules()) {
             return false;
         }
 
-        if (!Arr::has($input, $this->column)) {
+        if (! Arr::has($input, $this->column)) {
             return false;
         }
 
@@ -97,11 +97,11 @@ class ListField extends Field
         $attributes["{$this->column}.values.*"] = __('Value');
         $rules["{$this->column}.values"][] = 'array';
 
-        if (!is_null($this->max)) {
+        if (! is_null($this->max)) {
             $rules["{$this->column}.values"][] = "max:$this->max";
         }
 
-        if (!is_null($this->min)) {
+        if (! is_null($this->min)) {
             $rules["{$this->column}.values"][] = "min:$this->min";
         }
 

+ 1 - 1
src/Form/Field/PlainInput.php

@@ -35,7 +35,7 @@ trait PlainInput
 
     protected function defaultAttribute($attribute, $value)
     {
-        if (!array_key_exists($attribute, $this->attributes)) {
+        if (! array_key_exists($attribute, $this->attributes)) {
             $this->attribute($attribute, $value);
         }
 

+ 2 - 2
src/Form/Field/Select.php

@@ -184,8 +184,8 @@ JS;
      */
     public function model($model, $idField = 'id', $textField = 'name')
     {
-        if (!class_exists($model)
-            || !in_array(Model::class, class_parents($model))
+        if (! class_exists($model)
+            || ! in_array(Model::class, class_parents($model))
         ) {
             throw new \InvalidArgumentException("[$model] must be a valid model class");
         }

+ 2 - 2
src/Form/Field/SelectResource.php

@@ -139,7 +139,7 @@ class SelectResource extends Field
 
     protected function setDefaultSource()
     {
-        if (!$this->source) {
+        if (! $this->source) {
             if (strpos($this->column, '.')) {
                 $this->path(str_replace('_id', '', last(explode('.', $this->column))));
             } else {
@@ -170,7 +170,7 @@ class SelectResource extends Field
         $this->formatValue();
         $this->setDefaultSource();
 
-        if (!$this->maxItem || $this->maxItem > 1) {
+        if (! $this->maxItem || $this->maxItem > 1) {
             $primayDark = Color::primarydark();
 
             Admin::style(".select-resource .nav li a{padding:8px 10px;font-size:13px;font-weight:bold;color:{$primayDark}}.select-resource .nav li a.red{cursor:pointer}.select-resource .nav-stacked>li{border-bottom:1px solid #eee;background: #fff;}.select-resource .nav {border: 1px solid #eee;margin-bottom:5px;}");

+ 1 - 1
src/Form/Field/Table.php

@@ -26,7 +26,7 @@ class Table extends HasMany
             $this->label = $this->formatLabel();
             $this->builder = $arguments[0];
         } elseif (count($arguments) == 2) {
-            list($this->label, $this->builder) = $arguments;
+            [$this->label, $this->builder] = $arguments;
         }
     }
 

+ 3 - 3
src/Form/Field/Tags.php

@@ -55,7 +55,7 @@ class Tags extends Field
      */
     public function pluck($visibleColumn, $key)
     {
-        if (!empty($visibleColumn) && !empty($key)) {
+        if (! empty($visibleColumn) && ! empty($key)) {
             $this->keyAsValue = true;
         }
 
@@ -101,7 +101,7 @@ class Tags extends Field
             return $this;
         }
 
-        if (!$this->keyAsValue) {
+        if (! $this->keyAsValue) {
             return parent::options($options);
         }
 
@@ -125,7 +125,7 @@ class Tags extends Field
     {
         $value = array_filter($value, 'strlen');
 
-        if (is_array($value) && !Arr::isAssoc($value)) {
+        if (is_array($value) && ! Arr::isAssoc($value)) {
             $value = implode(',', $value);
         }
 

+ 1 - 1
src/Form/Field/Tree.php

@@ -137,7 +137,7 @@ class Tree extends Field
             $this->nodes = $this->nodes->call($this->getFormModel(), $this->value(), $this);
         }
 
-        if (!$this->nodes) {
+        if (! $this->nodes) {
             return;
         }
 

+ 15 - 15
src/Form/Field/UploadField.php

@@ -75,7 +75,7 @@ trait UploadField
     {
         $this->disk(config('admin.upload.disk'));
 
-        if (!$this->storage) {
+        if (! $this->storage) {
             $this->storage = false;
         }
     }
@@ -167,11 +167,11 @@ trait UploadField
     {
         try {
             $id = request('_id');
-            if (!$id) {
+            if (! $id) {
                 return $this->responseError(403, 'Missing id');
             }
 
-            if (!($file = $this->mergeChunks($id, $file))) {
+            if (! ($file = $this->mergeChunks($id, $file))) {
                 return $this->response(['merge' => 1]);
             }
 
@@ -187,7 +187,7 @@ trait UploadField
 
             $this->prepareFile($file);
 
-            if (!is_null($this->storagePermission)) {
+            if (! is_null($this->storagePermission)) {
                 $result = $this->getStorage()->putFileAs($this->getDirectory(), $file, $this->name, $this->storagePermission);
             } else {
                 $result = $this->getStorage()->putFileAs($this->getDirectory(), $file, $this->name);
@@ -244,13 +244,13 @@ trait UploadField
 
         $done = true;
         for ($index = 0; $index < $chunks; $index++) {
-            if (!is_file("{$tmpDir}/{$newFilename}.{$index}.part")) {
+            if (! is_file("{$tmpDir}/{$newFilename}.{$index}.part")) {
                 $done = false;
                 break;
             }
         }
 
-        if (!$done) {
+        if (! $done) {
             return;
         }
 
@@ -271,13 +271,13 @@ trait UploadField
      */
     public function deleteTempFile()
     {
-        if (!$this->tempFilePath) {
+        if (! $this->tempFilePath) {
             return;
         }
         @unlink($this->tempFilePath);
 
         if (
-            !Finder::create()
+            ! Finder::create()
             ->in($dir = dirname($this->tempFilePath))
             ->files()
             ->count()
@@ -298,7 +298,7 @@ trait UploadField
         if (flock($out, LOCK_EX)) {
             for ($index = 0; $index < $chunks; $index++) {
                 $partPath = "{$tmpDir}/{$newFileame}.{$index}.part";
-                if (!$in = @fopen($partPath, 'rb')) {
+                if (! $in = @fopen($partPath, 'rb')) {
                     break;
                 }
 
@@ -325,7 +325,7 @@ trait UploadField
     {
         $tmpDir = storage_path('tmp/'.$id);
 
-        if (!is_dir($tmpDir)) {
+        if (! is_dir($tmpDir)) {
             app('files')->makeDirectory($tmpDir, 0755, true);
         }
 
@@ -473,7 +473,7 @@ trait UploadField
     {
         $rules = $attributes = [];
 
-        if (!$fieldRules = $this->getRules()) {
+        if (! $fieldRules = $this->getRules()) {
             return false;
         }
 
@@ -483,7 +483,7 @@ trait UploadField
         /* @var \Illuminate\Validation\Validator $validator */
         $validator = Validator::make([$this->column => $file], $rules, $this->validationMessages, $attributes);
 
-        if (!$validator->passes()) {
+        if (! $validator->passes()) {
             $errors = $validator->errors()->getMessages()[$this->column];
 
             return implode('; ', $errors);
@@ -511,7 +511,7 @@ trait UploadField
      */
     public function destroyIfChanged($file)
     {
-        if (!$file || !$this->original) {
+        if (! $file || ! $this->original) {
             return $this->destroy();
         }
 
@@ -528,7 +528,7 @@ trait UploadField
      */
     public function deleteFile($path)
     {
-        if (!$path) {
+        if (! $path) {
             return;
         }
 
@@ -582,7 +582,7 @@ trait UploadField
         try {
             $this->storage = Storage::disk($disk);
         } catch (\Exception $exception) {
-            if (!array_key_exists($disk, config('filesystems.disks'))) {
+            if (! array_key_exists($disk, config('filesystems.disks'))) {
                 admin_error(
                     'Config error.',
                     "Disk [$disk] not configured, please add a disk config in `config/filesystems.php`."

+ 2 - 2
src/Form/Field/WebUploader.php

@@ -42,7 +42,7 @@ trait WebUploader
      */
     public function disableChunked(bool $disable = true)
     {
-        $this->options['chunked'] = !$disable;
+        $this->options['chunked'] = ! $disable;
 
         return $this;
     }
@@ -176,7 +176,7 @@ trait WebUploader
 
     protected function setDefaultServer()
     {
-        if (!$this->form || !method_exists($this->form, 'getAction')) {
+        if (! $this->form || ! method_exists($this->form, 'getAction')) {
             return;
         }
 

+ 6 - 6
src/Form/Footer.php

@@ -54,7 +54,7 @@ class Footer implements Renderable
     {
         if ($disable) {
             array_delete($this->buttons, 'reset');
-        } elseif (!in_array('reset', $this->buttons)) {
+        } elseif (! in_array('reset', $this->buttons)) {
             array_push($this->buttons, 'reset');
         }
 
@@ -70,7 +70,7 @@ class Footer implements Renderable
     {
         if ($disable) {
             array_delete($this->buttons, 'submit');
-        } elseif (!in_array('submit', $this->buttons)) {
+        } elseif (! in_array('submit', $this->buttons)) {
             array_push($this->buttons, 'submit');
         }
 
@@ -86,7 +86,7 @@ class Footer implements Renderable
     {
         if ($disable) {
             array_delete($this->checkboxes, 'view');
-        } elseif (!in_array('view', $this->checkboxes)) {
+        } elseif (! in_array('view', $this->checkboxes)) {
             array_push($this->checkboxes, 'view');
         }
 
@@ -102,7 +102,7 @@ class Footer implements Renderable
     {
         if ($disable) {
             array_delete($this->checkboxes, 'continue_editing');
-        } elseif (!in_array('continue_editing', $this->checkboxes)) {
+        } elseif (! in_array('continue_editing', $this->checkboxes)) {
             array_push($this->checkboxes, 'continue_editing');
         }
 
@@ -118,7 +118,7 @@ class Footer implements Renderable
     {
         if ($disable) {
             array_delete($this->checkboxes, 'continue_creating');
-        } elseif (!in_array('continue_creating', $this->checkboxes)) {
+        } elseif (! in_array('continue_creating', $this->checkboxes)) {
             array_push($this->checkboxes, 'continue_creating');
         }
 
@@ -150,7 +150,7 @@ class Footer implements Renderable
             $options[3] = sprintf('<span class="text-80 text-bold">%s</span>', trans('admin.view'));
         }
 
-        if (!$options) {
+        if (! $options) {
             return;
         }
 

+ 2 - 2
src/Form/NestedForm.php

@@ -161,7 +161,7 @@ class NestedForm
         }
 
         foreach ($data as $value) {
-            if (!isset($value[$relatedKeyName])) {
+            if (! isset($value[$relatedKeyName])) {
                 continue;
             }
 
@@ -285,7 +285,7 @@ class NestedForm
         if (is_array($columns)) {
             $value = [];
             foreach ($columns as $name => $column) {
-                if (!Arr::has($data, $column)) {
+                if (! Arr::has($data, $column)) {
                     continue;
                 }
                 $value[$name] = Arr::get($data, $column);

+ 8 - 8
src/Form/StepBuilder.php

@@ -190,7 +190,7 @@ class StepBuilder
      */
     public function getDoneStep()
     {
-        if (!$this->doneStep) {
+        if (! $this->doneStep) {
             $this->setDefaultDonePage();
         }
 
@@ -226,7 +226,7 @@ class StepBuilder
      */
     public function stash(array $data, bool $merge = false)
     {
-        if (!$this->options['remember']) {
+        if (! $this->options['remember']) {
             return;
         }
 
@@ -244,7 +244,7 @@ class StepBuilder
      */
     public function fetchStash()
     {
-        if (!$this->options['remember']) {
+        if (! $this->options['remember']) {
             return [];
         }
 
@@ -258,7 +258,7 @@ class StepBuilder
      */
     public function flushStash()
     {
-        if (!$this->options['remember']) {
+        if (! $this->options['remember']) {
             return;
         }
 
@@ -288,7 +288,7 @@ class StepBuilder
      */
     public function stashIndexByField($field)
     {
-        if (!$this->options['remember']) {
+        if (! $this->options['remember']) {
             return;
         }
 
@@ -323,7 +323,7 @@ class StepBuilder
      */
     protected function selectStep()
     {
-        if (!$this->options['remember'] || !$input = $this->fetchStash()) {
+        if (! $this->options['remember'] || ! $input = $this->fetchStash()) {
             return;
         }
 
@@ -332,11 +332,11 @@ class StepBuilder
 
         unset($input[static::CURRENT_VALIDATION_STEP], $input[static::ALL_STEPS]);
 
-        if ($current !== null && $current !== '' && !empty($input)) {
+        if ($current !== null && $current !== '' && ! empty($input)) {
             $this->select((int) ($current + 1));
         }
 
-        if (!empty($allStep) && !empty($input)) {
+        if (! empty($allStep) && ! empty($input)) {
             $this->select($this->count() - 1);
         }
     }

+ 1 - 1
src/Form/Tab.php

@@ -78,7 +78,7 @@ class Tab
 
             foreach ($rowFields as $field) {
                 if (($index = array_search($field, $all)) !== false) {
-                    if (!$match) {
+                    if (! $match) {
                         $fields->put($index, $row);
                     } else {
                         $fields->pull($index);

+ 6 - 6
src/Form/Tools.php

@@ -96,7 +96,7 @@ class Tools implements Renderable
      */
     public function disableList(bool $disable = true)
     {
-        $this->showList = !$disable;
+        $this->showList = ! $disable;
 
         return $this;
     }
@@ -108,7 +108,7 @@ class Tools implements Renderable
      */
     public function disableDelete(bool $disable = true)
     {
-        $this->showDelete = !$disable;
+        $this->showDelete = ! $disable;
 
         return $this;
     }
@@ -120,7 +120,7 @@ class Tools implements Renderable
      */
     public function disableView(bool $disable = true)
     {
-        $this->showView = !$disable;
+        $this->showView = ! $disable;
 
         return $this;
     }
@@ -176,7 +176,7 @@ class Tools implements Renderable
      */
     protected function renderList()
     {
-        if (!$this->showList) {
+        if (! $this->showList) {
             return;
         }
 
@@ -196,7 +196,7 @@ EOT;
      */
     protected function renderView()
     {
-        if (!$this->showView) {
+        if (! $this->showView) {
             return;
         }
 
@@ -218,7 +218,7 @@ HTML;
      */
     protected function renderDelete()
     {
-        if (!$this->showDelete) {
+        if (! $this->showDelete) {
             return;
         }
 

+ 17 - 17
src/Grid.php

@@ -241,7 +241,7 @@ class Grid
     public function column($name, $label = '')
     {
         if (strpos($name, '.') !== false) {
-            list($relationName, $relationColumn) = explode('.', $name);
+            [$relationName, $relationColumn] = explode('.', $name);
 
             $label = empty($label) ? admin_trans_field($relationColumn) : $label;
 
@@ -372,7 +372,7 @@ class Grid
      */
     protected function prependRowSelectorColumn()
     {
-        if (!$this->options['show_row_selector']) {
+        if (! $this->options['show_row_selector']) {
             return;
         }
 
@@ -514,7 +514,7 @@ HTML
      */
     public function renderCreateButton()
     {
-        if (!$this->options['show_create_btn'] && !$this->options['show_quick_create_btn']) {
+        if (! $this->options['show_create_btn'] && ! $this->options['show_quick_create_btn']) {
             return '';
         }
 
@@ -540,7 +540,7 @@ HTML
      */
     public function header($content = null)
     {
-        if (!$content) {
+        if (! $content) {
             return $this->header;
         }
 
@@ -556,7 +556,7 @@ HTML
      */
     public function renderHeader()
     {
-        if (!$this->header) {
+        if (! $this->header) {
             return '';
         }
 
@@ -588,7 +588,7 @@ HTML;
      */
     public function footer($content = null)
     {
-        if (!$content) {
+        if (! $content) {
             return $this->footer;
         }
 
@@ -604,7 +604,7 @@ HTML;
      */
     public function renderFooter()
     {
-        if (!$this->footer) {
+        if (! $this->footer) {
             return '';
         }
 
@@ -655,7 +655,7 @@ HTML;
     {
         $this->tools->disableBatchActions($disable);
 
-        return $this->option('show_row_selector', !$disable);
+        return $this->option('show_row_selector', ! $disable);
     }
 
     /**
@@ -665,7 +665,7 @@ HTML;
      */
     public function showRowSelector(bool $val = true)
     {
-        return $this->disableRowSelector(!$val);
+        return $this->disableRowSelector(! $val);
     }
 
     /**
@@ -675,7 +675,7 @@ HTML;
      */
     public function disableCreateButton(bool $disable = true)
     {
-        return $this->option('show_create_btn', !$disable);
+        return $this->option('show_create_btn', ! $disable);
     }
 
     /**
@@ -685,7 +685,7 @@ HTML;
      */
     public function showCreateButton(bool $val = true)
     {
-        return $this->disableCreateButton(!$val);
+        return $this->disableCreateButton(! $val);
     }
 
     /**
@@ -695,7 +695,7 @@ HTML;
      */
     public function disableQuickCreateButton(bool $disable = true)
     {
-        return $this->option('show_quick_create_btn', !$disable);
+        return $this->option('show_quick_create_btn', ! $disable);
     }
 
     /**
@@ -705,7 +705,7 @@ HTML;
      */
     public function showQuickCreateButton(bool $val = true)
     {
-        return $this->disableQuickCreateButton(!$val);
+        return $this->disableQuickCreateButton(! $val);
     }
 
     /**
@@ -737,7 +737,7 @@ HTML;
      */
     public function resource(string $path)
     {
-        if (!empty($path)) {
+        if (! empty($path)) {
             $this->resourcePath = admin_url($path);
         }
 
@@ -777,7 +777,7 @@ HTML;
      */
     public function responsive()
     {
-        if (!$this->responsive) {
+        if (! $this->responsive) {
             $this->responsive = new Responsive($this);
         }
 
@@ -847,7 +847,7 @@ HTML;
      */
     public function setView($view, $variables = [])
     {
-        if (!empty($variables)) {
+        if (! empty($variables)) {
             $this->with($variables);
         }
 
@@ -923,7 +923,7 @@ HTML;
     {
         $view = view($this->view, $this->variables());
 
-        if (!$wrapper = $this->wrapper) {
+        if (! $wrapper = $this->wrapper) {
             return $view->render();
         }
 

+ 2 - 2
src/Grid/Actions/QuickEdit.php

@@ -19,10 +19,10 @@ class QuickEdit extends RowAction
 
     public function render()
     {
-        if (!static::$resolvedWindow) {
+        if (! static::$resolvedWindow) {
             static::$resolvedWindow = true;
 
-            list($width, $height) = $this->parent->option('dialog_form_area');
+            [$width, $height] = $this->parent->option('dialog_form_area');
 
             Form::modal(trans('admin.edit'))
                 ->click(".{$this->getElementClass()}")

+ 7 - 7
src/Grid/Column.php

@@ -407,7 +407,7 @@ class Column
      */
     protected function formatLabel($label)
     {
-        if (!$label) {
+        if (! $label) {
             $label = admin_trans_field($this->name);
         }
 
@@ -507,7 +507,7 @@ class Column
      */
     public function hasDisplayCallbacks()
     {
-        return !empty($this->displayCallbacks);
+        return ! empty($this->displayCallbacks);
     }
 
     /**
@@ -538,9 +538,9 @@ class Column
     protected function callDisplayCallbacks($value)
     {
         foreach ($this->displayCallbacks as $callback) {
-            list($callback, $params) = $callback;
+            [$callback, $params] = $callback;
 
-            if (!$callback instanceof \Closure) {
+            if (! $callback instanceof \Closure) {
                 $value = $callback;
                 continue;
             }
@@ -554,7 +554,7 @@ class Column
                 $value instanceof static
                 && ($last = array_pop($this->displayCallbacks))
             ) {
-                list($last, $params) = $last;
+                [$last, $params] = $last;
                 $last = $this->bindOriginalRowModel($last);
                 $value = call_user_func($last, $previous, $this, ...$params);
             }
@@ -589,7 +589,7 @@ class Column
         $i = 0;
         foreach ($data as $key => &$row) {
             $i++;
-            if (!isset($row['#'])) {
+            if (! isset($row['#'])) {
                 $row['#'] = $i;
             }
 
@@ -641,7 +641,7 @@ class Column
             return;
         }
 
-        if (!class_exists($class) || !is_subclass_of($class, AbstractDisplayer::class)) {
+        if (! class_exists($class) || ! is_subclass_of($class, AbstractDisplayer::class)) {
             throw new \Exception("Invalid column definition [$class]");
         }
 

+ 2 - 2
src/Grid/Column/Condition.php

@@ -53,7 +53,7 @@ class Condition
         $self = $this;
 
         $condition = $this->column->if(function () use ($self) {
-            return !$self->getResult();
+            return ! $self->getResult();
         });
 
         if ($next) {
@@ -72,7 +72,7 @@ class Condition
 
     protected function callCallbacks(array $callbacks)
     {
-        if (!$callbacks) {
+        if (! $callbacks) {
             return;
         }
 

+ 3 - 3
src/Grid/Column/Filter/Between.php

@@ -101,11 +101,11 @@ class Between extends Filter
             }, $value);
         }
 
-        if (!isset($value['start'])) {
+        if (! isset($value['start'])) {
             return $model->where($this->getColumnName(), '<=', $value['end']);
         }
 
-        if (!isset($value['end'])) {
+        if (! isset($value['end'])) {
             return $model->where($this->getColumnName(), '=>', $value['start']);
         }
 
@@ -114,7 +114,7 @@ class Between extends Filter
 
     protected function addScript()
     {
-        if (!$this->dateFormat) {
+        if (! $this->dateFormat) {
             return;
         }
 

+ 2 - 2
src/Grid/Column/HasDisplayers.php

@@ -59,7 +59,7 @@ trait HasDisplayers
     public function bold($color = 'text-80')
     {
         return $this->display(function ($value) use ($color) {
-            if (!$value) {
+            if (! $value) {
                 return $value;
             }
 
@@ -77,7 +77,7 @@ trait HasDisplayers
     public function long2ip($default = null)
     {
         return $this->display(function ($value) use ($default) {
-            if (!$value) {
+            if (! $value) {
                 return $default;
             }
 

+ 1 - 1
src/Grid/Column/Sorter.php

@@ -84,7 +84,7 @@ class Sorter implements Renderable
             $sort['cast'] = $this->cast;
         }
 
-        if (!$this->isSorted() || $this->sort['type'] != 'asc') {
+        if (! $this->isSorted() || $this->sort['type'] != 'asc') {
             $url = request()->fullUrlWithQuery([
                 $this->sortName => $sort,
             ]);

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

@@ -74,7 +74,7 @@ trait HasActions
      */
     protected function appendActionsColumn()
     {
-        if (!$this->options['show_actions']) {
+        if (! $this->options['show_actions']) {
             return;
         }
 
@@ -89,7 +89,7 @@ trait HasActions
      */
     public function disableActions(bool $disable = true)
     {
-        return $this->option('show_actions', !$disable);
+        return $this->option('show_actions', ! $disable);
     }
 
     /**
@@ -99,7 +99,7 @@ trait HasActions
      */
     public function showActions(bool $val = true)
     {
-        return $this->disableActions(!$val);
+        return $this->disableActions(! $val);
     }
 
     /**
@@ -111,7 +111,7 @@ trait HasActions
      */
     public function disableEditButton(bool $disable = true)
     {
-        $this->options['show_edit_button'] = !$disable;
+        $this->options['show_edit_button'] = ! $disable;
 
         return $this;
     }
@@ -125,7 +125,7 @@ trait HasActions
      */
     public function showEditButton(bool $val = true)
     {
-        return $this->disableEditButton(!$val);
+        return $this->disableEditButton(! $val);
     }
 
     /**
@@ -135,7 +135,7 @@ trait HasActions
      */
     public function disableQuickEditButton(bool $disable = true)
     {
-        $this->options['show_quick_edit_button'] = !$disable;
+        $this->options['show_quick_edit_button'] = ! $disable;
 
         return $this;
     }
@@ -147,7 +147,7 @@ trait HasActions
      */
     public function showQuickEditButton(bool $val = true)
     {
-        return $this->disableQuickEditButton(!$val);
+        return $this->disableQuickEditButton(! $val);
     }
 
     /**
@@ -159,7 +159,7 @@ trait HasActions
      */
     public function disableViewButton(bool $disable = true)
     {
-        $this->options['show_view_button'] = !$disable;
+        $this->options['show_view_button'] = ! $disable;
 
         return $this;
     }
@@ -173,7 +173,7 @@ trait HasActions
      */
     public function showViewButton(bool $val = true)
     {
-        return $this->disableViewButton(!$val);
+        return $this->disableViewButton(! $val);
     }
 
     /**
@@ -185,7 +185,7 @@ trait HasActions
      */
     public function disableDeleteButton(bool $disable = true)
     {
-        $this->options['show_delete_button'] = !$disable;
+        $this->options['show_delete_button'] = ! $disable;
 
         return $this;
     }
@@ -199,6 +199,6 @@ trait HasActions
      */
     public function showDeleteButton(bool $val = true)
     {
-        return $this->disableDeleteButton(!$val);
+        return $this->disableDeleteButton(! $val);
     }
 }

+ 6 - 6
src/Grid/Concerns/HasExporter.php

@@ -53,7 +53,7 @@ trait HasExporter
      */
     protected function handleExportRequest($forceExport = false)
     {
-        if (!$scope = request($this->getExporter()->getQueryName())) {
+        if (! $scope = request($this->getExporter()->getQueryName())) {
             return;
         }
 
@@ -86,7 +86,7 @@ trait HasExporter
      */
     public function setExporterQueryName($gridName)
     {
-        if (!$this->allowExporter()) {
+        if (! $this->allowExporter()) {
             return;
         }
 
@@ -100,7 +100,7 @@ trait HasExporter
      */
     protected function resolveExportDriver($scope)
     {
-        if (!$this->exportDriver) {
+        if (! $this->exportDriver) {
             $this->exportDriver = $this->getExporter()->resolve();
         }
 
@@ -133,7 +133,7 @@ trait HasExporter
      */
     public function renderExportButton()
     {
-        if (!$this->allowExporter()) {
+        if (! $this->allowExporter()) {
             return '';
         }
 
@@ -147,7 +147,7 @@ trait HasExporter
      */
     public function disableExporter(bool $disable = true)
     {
-        return $this->option('show_exporter', !$disable);
+        return $this->option('show_exporter', ! $disable);
     }
 
     /**
@@ -157,7 +157,7 @@ trait HasExporter
      */
     public function showExporter(bool $val = true)
     {
-        return $this->disableExporter(!$val);
+        return $this->disableExporter(! $val);
     }
 
     /**

+ 4 - 4
src/Grid/Concerns/HasFilter.php

@@ -76,7 +76,7 @@ trait HasFilter
      */
     public function renderFilter()
     {
-        if (!$this->options['show_filter']) {
+        if (! $this->options['show_filter']) {
             return '';
         }
 
@@ -105,7 +105,7 @@ trait HasFilter
 //        $this->tools->disableFilterButton($disable);
         $this->filter->disableCollapse($disable);
 
-        return $this->option('show_filter', !$disable);
+        return $this->option('show_filter', ! $disable);
     }
 
     /**
@@ -117,7 +117,7 @@ trait HasFilter
      */
     public function showFilter(bool $val = true)
     {
-        return $this->disableFilter(!$val);
+        return $this->disableFilter(! $val);
     }
 
     /**
@@ -143,6 +143,6 @@ trait HasFilter
      */
     public function showFilterButton(bool $val = true)
     {
-        return $this->disableFilterButton(!$val);
+        return $this->disableFilterButton(! $val);
     }
 }

+ 3 - 3
src/Grid/Concerns/HasMultipleHeader.php

@@ -46,7 +46,7 @@ trait HasMultipleHeader
      */
     protected function sortHeaders()
     {
-        if (!$this->mutipleHeaders) {
+        if (! $this->mutipleHeaders) {
             return;
         }
 
@@ -70,12 +70,12 @@ trait HasMultipleHeader
         $before = $after = [];
         $isBefore = true;
         foreach ($originalColumns as $name => $column) {
-            if ($isBefore && !isset($this->columns[$name])) {
+            if ($isBefore && ! isset($this->columns[$name])) {
                 $before[$name] = $column;
                 continue;
             }
             $isBefore = false;
-            if (!isset($this->columns[$name])) {
+            if (! isset($this->columns[$name])) {
                 $after[$name] = $column;
             }
         }

+ 4 - 4
src/Grid/Concerns/HasPaginator.php

@@ -49,7 +49,7 @@ trait HasPaginator
      */
     public function paginator()
     {
-        if (!$this->options['show_pagination']) {
+        if (! $this->options['show_pagination']) {
             return;
         }
 
@@ -95,9 +95,9 @@ trait HasPaginator
      */
     public function disablePagination(bool $disable = true)
     {
-        $this->model->usePaginate(!$disable);
+        $this->model->usePaginate(! $disable);
 
-        return $this->option('show_pagination', !$disable);
+        return $this->option('show_pagination', ! $disable);
     }
 
     /**
@@ -109,6 +109,6 @@ trait HasPaginator
      */
     public function showPagination(bool $val = true)
     {
-        return $this->disablePagination(!$val);
+        return $this->disablePagination(! $val);
     }
 }

+ 7 - 7
src/Grid/Concerns/HasQuickSearch.php

@@ -73,7 +73,7 @@ trait HasQuickSearch
      */
     public function renderQuickSearch()
     {
-        if (!$this->quickSearch) {
+        if (! $this->quickSearch) {
             return '';
         }
 
@@ -87,11 +87,11 @@ trait HasQuickSearch
      */
     public function applyQuickSearch()
     {
-        if (!$this->quickSearch) {
+        if (! $this->quickSearch) {
             return;
         }
 
-        if (!$query = request()->get($this->quickSearch->getQueryName())) {
+        if (! $query = request()->get($this->quickSearch->getQueryName())) {
             return;
         }
 
@@ -120,13 +120,13 @@ trait HasQuickSearch
     protected function addWhereBindings($query)
     {
         $queries = preg_split('/\s(?=([^"]*"[^"]*")*[^"]*$)/', trim($query));
-        if (!$queries = $this->parseQueryBindings($queries)) {
+        if (! $queries = $this->parseQueryBindings($queries)) {
             $this->addWhereBasicBinding($this->getKeyName(), false, '=', '___');
 
             return;
         }
 
-        foreach ($queries as list($column, $condition, $or)) {
+        foreach ($queries as [$column, $condition, $or]) {
             if (preg_match('/(?<not>!?)\((?<values>.+)\)/', $condition, $match) !== 0) {
                 $this->addWhereInBinding($column, $or, (bool) $match['not'], $match['values']);
                 continue;
@@ -187,7 +187,7 @@ trait HasQuickSearch
             }
 
             $or = false;
-            list($column, $condition) = $segments;
+            [$column, $condition] = $segments;
 
             if (Str::startsWith($column, '|')) {
                 $or = true;
@@ -196,7 +196,7 @@ trait HasQuickSearch
 
             $column = $columnMap[$column] ?? null;
 
-            if (!$column) {
+            if (! $column) {
                 return;
             }
 

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

@@ -47,7 +47,7 @@ trait HasSelector
         $active = $this->_selector->parseSelected();
 
         $this->_selector->getSelectors()->each(function ($selector, $column) use ($active) {
-            if (!array_key_exists($column, $active)) {
+            if (! array_key_exists($column, $active)) {
                 return;
             }
 

+ 6 - 6
src/Grid/Concerns/HasTools.php

@@ -77,7 +77,7 @@ trait HasTools
      */
     public function disableToolbar(bool $val = true)
     {
-        return $this->option('show_toolbar', !$val);
+        return $this->option('show_toolbar', ! $val);
     }
 
     /**
@@ -87,7 +87,7 @@ trait HasTools
      */
     public function showToolbar(bool $val = true)
     {
-        return $this->disableToolbar(!$val);
+        return $this->disableToolbar(! $val);
     }
 
     /**
@@ -113,7 +113,7 @@ trait HasTools
      */
     public function showBatchActions(bool $val = true)
     {
-        return $this->disableBatchActions(!$val);
+        return $this->disableBatchActions(! $val);
     }
 
     /**
@@ -141,7 +141,7 @@ trait HasTools
      */
     public function showBatchDelete(bool $val = true)
     {
-        return $this->disableBatchDelete(!$val);
+        return $this->disableBatchDelete(! $val);
     }
 
     /**
@@ -167,7 +167,7 @@ trait HasTools
      */
     public function showRefreshButton(bool $val = true)
     {
-        return $this->disableRefreshButton(!$val);
+        return $this->disableRefreshButton(! $val);
     }
 
     /**
@@ -185,7 +185,7 @@ trait HasTools
                 || $this->allowCreateBtn()
                 || $this->allowQuickCreateBtn()
                 || $this->allowResponsive()
-                || !empty($this->variables['title'])
+                || ! empty($this->variables['title'])
             )
         ) {
             return true;

+ 10 - 10
src/Grid/Displayers/Actions.php

@@ -68,7 +68,7 @@ class Actions extends AbstractDisplayer
     {
         if ($disable) {
             array_delete($this->actions, 'view');
-        } elseif (!in_array('view', $this->actions)) {
+        } elseif (! in_array('view', $this->actions)) {
             array_push($this->actions, 'view');
         }
 
@@ -84,7 +84,7 @@ class Actions extends AbstractDisplayer
     {
         if ($disable) {
             array_delete($this->actions, 'delete');
-        } elseif (!in_array('delete', $this->actions)) {
+        } elseif (! in_array('delete', $this->actions)) {
             array_push($this->actions, 'delete');
         }
 
@@ -100,7 +100,7 @@ class Actions extends AbstractDisplayer
     {
         if ($disable) {
             array_delete($this->actions, 'edit');
-        } elseif (!in_array('edit', $this->actions)) {
+        } elseif (! in_array('edit', $this->actions)) {
             array_push($this->actions, 'edit');
         }
 
@@ -116,7 +116,7 @@ class Actions extends AbstractDisplayer
     {
         if ($disable) {
             array_delete($this->actions, 'quickEdit');
-        } elseif (!in_array('quickEdit', $this->actions)) {
+        } elseif (! in_array('quickEdit', $this->actions)) {
             array_push($this->actions, 'quickEdit');
         }
 
@@ -152,10 +152,10 @@ class Actions extends AbstractDisplayer
      */
     public function display(array $callbacks = [])
     {
-        $this->disableView(!$this->grid->option('show_view_button'));
-        $this->disableEdit(!$this->grid->option('show_edit_button'));
-        $this->disableQuickEdit(!$this->grid->option('show_quick_edit_button'));
-        $this->disableDelete(!$this->grid->option('show_delete_button'));
+        $this->disableView(! $this->grid->option('show_view_button'));
+        $this->disableEdit(! $this->grid->option('show_edit_button'));
+        $this->disableQuickEdit(! $this->grid->option('show_quick_edit_button'));
+        $this->disableDelete(! $this->grid->option('show_delete_button'));
 
         foreach ($callbacks as $callback) {
             if ($callback instanceof \Closure) {
@@ -212,10 +212,10 @@ EOT;
      */
     protected function renderQuickEdit()
     {
-        if (!static::$resolvedWindow) {
+        if (! static::$resolvedWindow) {
             static::$resolvedWindow = true;
 
-            list($width, $height) = $this->grid->option('dialog_form_area');
+            [$width, $height] = $this->grid->option('dialog_form_area');
 
             Form::modal(trans('admin.edit'))
                 ->click(".{$this->grid->getGridRowName()}-edit")

+ 8 - 8
src/Grid/Displayers/DropdownActions.php

@@ -148,7 +148,7 @@ JS;
     {
         if ($disable) {
             array_delete($this->defaultClass, Show::class);
-        } elseif (!in_array(Show::class, $this->defaultClass)) {
+        } elseif (! in_array(Show::class, $this->defaultClass)) {
             array_push($this->defaultClass, Show::class);
         }
 
@@ -166,7 +166,7 @@ JS;
     {
         if ($disable) {
             array_delete($this->defaultClass, Delete::class);
-        } elseif (!in_array(Delete::class, $this->defaultClass)) {
+        } elseif (! in_array(Delete::class, $this->defaultClass)) {
             array_push($this->defaultClass, Delete::class);
         }
 
@@ -184,7 +184,7 @@ JS;
     {
         if ($disable) {
             array_delete($this->defaultClass, Edit::class);
-        } elseif (!in_array(Edit::class, $this->defaultClass)) {
+        } elseif (! in_array(Edit::class, $this->defaultClass)) {
             array_push($this->defaultClass, Edit::class);
         }
 
@@ -200,7 +200,7 @@ JS;
     {
         if ($disable) {
             array_delete($this->defaultClass, QuickEdit::class);
-        } elseif (!in_array(Show::class, $this->defaultClass)) {
+        } elseif (! in_array(Show::class, $this->defaultClass)) {
             array_push($this->defaultClass, QuickEdit::class);
         }
 
@@ -214,10 +214,10 @@ JS;
      */
     public function display($callbacks = [])
     {
-        $this->disableView(!$this->grid->option('show_view_button'));
-        $this->disableEdit(!$this->grid->option('show_edit_button'));
-        $this->disableQuickEdit(!$this->grid->option('show_quick_edit_button'));
-        $this->disableDelete(!$this->grid->option('show_delete_button'));
+        $this->disableView(! $this->grid->option('show_view_button'));
+        $this->disableEdit(! $this->grid->option('show_edit_button'));
+        $this->disableQuickEdit(! $this->grid->option('show_quick_edit_button'));
+        $this->disableDelete(! $this->grid->option('show_delete_button'));
 
         $this->addScript();
 

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

@@ -167,7 +167,7 @@ class Editable extends AbstractDisplayer
 
     protected function setupScript()
     {
-        if (!static::$setup) {
+        if (! static::$setup) {
             static::$setup = 1;
             Admin::script(
                 <<<'JS'
@@ -214,7 +214,7 @@ JS
             'data-value' => "{$this->value}",
         ];
 
-        if (!empty($this->attributes)) {
+        if (! empty($this->attributes)) {
             $attributes = array_merge($attributes, $this->attributes);
         }
 

+ 1 - 1
src/Grid/Displayers/Modal.php

@@ -10,7 +10,7 @@ class Modal extends AbstractDisplayer
     {
         $title = $this->trans('title');
         if (func_num_args() == 2) {
-            list($title, $callback) = func_get_args();
+            [$title, $callback] = func_get_args();
         }
 
         $html = $this->value;

+ 1 - 1
src/Grid/Displayers/Orderable.php

@@ -12,7 +12,7 @@ class Orderable extends AbstractDisplayer
     {
         parent::__construct($value, $grid, $column, $row);
 
-        if (!trait_exists('\Spatie\EloquentSortable\SortableTrait')) {
+        if (! trait_exists('\Spatie\EloquentSortable\SortableTrait')) {
             throw new \Exception('To use orderable grid, please install package [spatie/eloquent-sortable] first.');
         }
     }

+ 1 - 1
src/Grid/Displayers/SwitchGroup.php

@@ -21,7 +21,7 @@ class SwitchGroup extends SwitchDisplay
             }
         }
 
-        if (!Arr::isAssoc($columns)) {
+        if (! Arr::isAssoc($columns)) {
             $labels = array_map('admin_trans_field', $columns);
             $columns = array_combine($columns, $labels);
         }

+ 4 - 4
src/Grid/Exporter.php

@@ -95,7 +95,7 @@ class Exporter
      */
     public function disableExportAll(bool $value = true)
     {
-        return $this->option('show_export_all', !$value);
+        return $this->option('show_export_all', ! $value);
     }
 
     /**
@@ -107,7 +107,7 @@ class Exporter
      */
     public function disableExportCurrentPage(bool $value = true)
     {
-        return $this->option('show_export_current_page', !$value);
+        return $this->option('show_export_current_page', ! $value);
     }
 
     /**
@@ -119,7 +119,7 @@ class Exporter
      */
     public function disableExportSelectedRow(bool $value = true)
     {
-        return $this->option('show_export_selected_rows', !$value);
+        return $this->option('show_export_selected_rows', ! $value);
     }
 
     /**
@@ -182,7 +182,7 @@ class Exporter
      */
     protected function getExporter($driver): ExporterInterface
     {
-        if (!$driver || !array_key_exists($driver, static::$drivers)) {
+        if (! $driver || ! array_key_exists($driver, static::$drivers)) {
             return $this->getDefaultExporter();
         }
 

+ 1 - 1
src/Grid/Exporters/AbstractExporter.php

@@ -189,7 +189,7 @@ abstract class AbstractExporter implements ExporterInterface
      */
     public function buildData(?int $page = null, ?int $perPage = null)
     {
-        if (!is_null($this->data)) {
+        if (! is_null($this->data)) {
             return $this->data;
         }
 

+ 1 - 1
src/Grid/Exporters/ExcelExporter.php

@@ -11,7 +11,7 @@ class ExcelExporter extends AbstractExporter
     {
         parent::__construct($titles);
 
-        if (!class_exists(Excel::class)) {
+        if (! class_exists(Excel::class)) {
             throw new \Exception('To use exporter, please install [dcat/easy-excel] first.');
         }
     }

+ 7 - 7
src/Grid/Filter.php

@@ -376,7 +376,7 @@ class Filter implements Renderable
     {
         $this->filters = array_filter($this->filters, function (AbstractFilter $filter) use (&$column) {
             if (is_array($column)) {
-                return !in_array($filter->getColumn(), $column);
+                return ! in_array($filter->getColumn(), $column);
             }
 
             return $filter->getColumn() != $column;
@@ -388,14 +388,14 @@ class Filter implements Renderable
      */
     public function getInputs()
     {
-        if (!is_null($this->inputs)) {
+        if (! is_null($this->inputs)) {
             return $this->inputs;
         }
 
         $this->inputs = Arr::dot(request()->all());
 
         $this->inputs = array_filter($this->inputs, function ($input) {
-            return $input !== '' && !is_null($input) && $input !== static::IGNORE_VALUE;
+            return $input !== '' && ! is_null($input) && $input !== static::IGNORE_VALUE;
         });
 
         $this->sanitizeInputs($this->inputs);
@@ -429,7 +429,7 @@ class Filter implements Renderable
         }
 
         return tap(array_filter($conditions), function ($conditions) {
-            if (!empty($conditions)) {
+            if (! empty($conditions)) {
                 $this->expand();
             }
         });
@@ -442,7 +442,7 @@ class Filter implements Renderable
      */
     protected function sanitizeInputs(&$inputs)
     {
-        if (!$this->name) {
+        if (! $this->name) {
             return $inputs;
         }
 
@@ -723,9 +723,9 @@ class Filter implements Renderable
      */
     public function __call($method, $arguments)
     {
-        if (!empty(static::$supports[$method])) {
+        if (! empty(static::$supports[$method])) {
             $class = static::$supports[$method];
-            if (!is_subclass_of($class, AbstractFilter::class)) {
+            if (! is_subclass_of($class, AbstractFilter::class)) {
                 throw new \InvalidArgumentException("The class [{$class}] must be a type of ".AbstractFilter::class.'.');
             }
 

+ 2 - 2
src/Grid/Filter/AbstractFilter.php

@@ -209,7 +209,7 @@ abstract class AbstractFilter
      */
     public function siblings($index = null)
     {
-        if (!is_null($index)) {
+        if (! is_null($index)) {
             return Arr::get($this->parent->filters(), $index);
         }
 
@@ -401,7 +401,7 @@ abstract class AbstractFilter
      */
     protected function presenter()
     {
-        if (!$this->presenter) {
+        if (! $this->presenter) {
             $this->setupDefaultPresenter();
         }
 

+ 3 - 3
src/Grid/Filter/Between.php

@@ -80,7 +80,7 @@ class Between extends AbstractFilter
      */
     public function condition($inputs)
     {
-        if (!Arr::has($inputs, $this->column)) {
+        if (! Arr::has($inputs, $this->column)) {
             return;
         }
 
@@ -102,11 +102,11 @@ class Between extends AbstractFilter
             return;
         }
 
-        if (!isset($value['start']) && isset($value['end'])) {
+        if (! isset($value['start']) && isset($value['end'])) {
             return $this->buildCondition($this->column, '<=', $value['end']);
         }
 
-        if (!isset($value['end']) && isset($value['start'])) {
+        if (! isset($value['end']) && isset($value['start'])) {
             return $this->buildCondition($this->column, '>=', $value['start']);
         }
 

+ 1 - 1
src/Grid/Filter/Group.php

@@ -255,7 +255,7 @@ class Group extends AbstractFilter
     {
         $value = Arr::get($inputs, $this->column);
 
-        if (!isset($value)) {
+        if (! isset($value)) {
             return;
         }
 

+ 2 - 2
src/Grid/Filter/Presenter/Select.php

@@ -130,8 +130,8 @@ SCRIPT;
      */
     public function model($model, $idField = 'id', $textField = 'name')
     {
-        if (!class_exists($model)
-            || !in_array(Model::class, class_parents($model))
+        if (! class_exists($model)
+            || ! in_array(Model::class, class_parents($model))
         ) {
             throw new \InvalidArgumentException("[$model] must be a valid model class");
         }

+ 2 - 2
src/Grid/Filter/Presenter/SelectResource.php

@@ -158,7 +158,7 @@ class SelectResource extends Presenter
 
     protected function setDefaultSource()
     {
-        if (!$this->source) {
+        if (! $this->source) {
             $column = $this->filter->getColumn();
             if (strpos($column, '.')) {
                 $this->path(str_replace('_id', '', last(explode('.', $column))));
@@ -184,7 +184,7 @@ class SelectResource extends Presenter
 
         $containerClass = 'form-control';
 
-        if (!$this->maxItem || $this->maxItem > 2) {
+        if (! $this->maxItem || $this->maxItem > 2) {
             // 选项大于两个时使用select2样式布局
             Admin::css(Admin::$componentsAssets['select2']['css']);
 

+ 1 - 1
src/Grid/GridAction.php

@@ -100,7 +100,7 @@ abstract class GridAction implements Renderable
      */
     public static function makeSelector($class, $prefix)
     {
-        if (!isset(static::$selectors[$class])) {
+        if (! isset(static::$selectors[$class])) {
             static::$selectors[$class] = uniqid($prefix);
         }
 

+ 5 - 5
src/Grid/Model.php

@@ -371,7 +371,7 @@ class Model
         ) {
             if ($isA) {
                 $data = collect($data);
-            } elseif (!empty($isP)) {
+            } elseif (! empty($isP)) {
                 $this->model = $data;
                 $this->data = $data->getCollection();
 
@@ -472,7 +472,7 @@ class Model
      */
     public function getCurrentPage()
     {
-        if (!$this->usePaginate) {
+        if (! $this->usePaginate) {
             return;
         }
 
@@ -496,7 +496,7 @@ class Model
      */
     public function getPerPage()
     {
-        if (!$this->usePaginate) {
+        if (! $this->usePaginate) {
             return;
         }
 
@@ -516,7 +516,7 @@ class Model
             return $query['method'] == 'paginate';
         });
 
-        if (!$this->usePaginate) {
+        if (! $this->usePaginate) {
             $query = [
                 'method'    => 'get',
                 'arguments' => [],
@@ -615,7 +615,7 @@ class Model
      */
     protected function setRelationSort($column)
     {
-        list($relationName, $relationColumn) = explode('.', $column);
+        [$relationName, $relationColumn] = explode('.', $column);
 
         if ($this->queries->contains(function ($query) use ($relationName) {
             return $query['method'] == 'with' && in_array($relationName, $query['arguments']);

+ 1 - 1
src/Grid/Row.php

@@ -214,7 +214,7 @@ class Row implements Arrayable
             $value = $value->toJson();
         }
 
-        if (!is_null($value) && !is_scalar($value)) {
+        if (! is_null($value) && ! is_scalar($value)) {
             return sprintf('<pre class="dump">%s</pre>', json_encode($value, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE));
         }
 

+ 1 - 1
src/Grid/RowAction.php

@@ -94,7 +94,7 @@ abstract class RowAction extends GridAction
     {
         $this->addScript();
 
-        if (!$href = $this->href()) {
+        if (! $href = $this->href()) {
             $href = 'javascript:void(0);';
         }
 

+ 2 - 2
src/Grid/Tools.php

@@ -81,7 +81,7 @@ class Tools implements Renderable
 
     public function has()
     {
-        return !$this->tools->isEmpty();
+        return ! $this->tools->isEmpty();
     }
 
     /**
@@ -151,7 +151,7 @@ class Tools implements Renderable
     {
         return $this->tools->map(function ($tool) {
             if ($tool instanceof AbstractTool) {
-                if (!$tool->allowed()) {
+                if (! $tool->allowed()) {
                     return '';
                 }
 

+ 1 - 1
src/Grid/Tools/AbstractTool.php

@@ -36,7 +36,7 @@ abstract class AbstractTool implements Renderable
      */
     public function allowed()
     {
-        return !$this->disabled;
+        return ! $this->disabled;
     }
 
     /**

+ 2 - 2
src/Grid/Tools/BatchActions.php

@@ -44,7 +44,7 @@ class BatchActions extends AbstractTool
      */
     public function disableDelete(bool $disable = true)
     {
-        $this->enableDelete = !$disable;
+        $this->enableDelete = ! $disable;
 
         return $this;
     }
@@ -88,7 +88,7 @@ class BatchActions extends AbstractTool
      */
     public function render()
     {
-        if (!$this->enableDelete) {
+        if (! $this->enableDelete) {
             $this->actions->shift();
         }
 

+ 4 - 4
src/Grid/Tools/CreateButton.php

@@ -19,14 +19,14 @@ class CreateButton
 
     protected function renderQuickCreateButton()
     {
-        if (!$this->grid->option('show_quick_create_btn')) {
+        if (! $this->grid->option('show_quick_create_btn')) {
             return;
         }
 
         $new = trans('admin.new');
         $url = $this->grid->getCreateUrl();
 
-        list($width, $height) = $this->grid->option('dialog_form_area');
+        [$width, $height] = $this->grid->option('dialog_form_area');
 
         Form::modal($new)
             ->click(".{$this->grid->getGridRowName()}-create")
@@ -41,7 +41,7 @@ class CreateButton
 
     protected function renderCreateButton()
     {
-        if (!$this->grid->option('show_create_btn')) {
+        if (! $this->grid->option('show_create_btn')) {
             return;
         }
 
@@ -55,7 +55,7 @@ class CreateButton
 
     public function render()
     {
-        if (!$this->grid->option('show_create_btn') && !$this->grid->option('show_quick_create_btn')) {
+        if (! $this->grid->option('show_create_btn') && ! $this->grid->option('show_quick_create_btn')) {
             return;
         }
 

+ 4 - 4
src/Grid/Tools/ExportButton.php

@@ -49,7 +49,7 @@ JS;
      */
     protected function renderExportAll()
     {
-        if (!$this->grid->getExporter()->option('show_export_all')) {
+        if (! $this->grid->getExporter()->option('show_export_all')) {
             return;
         }
         $all = trans('admin.all');
@@ -62,7 +62,7 @@ JS;
      */
     protected function renderExportCurrentPage()
     {
-        if (!$this->grid->getExporter()->option('show_export_current_page')) {
+        if (! $this->grid->getExporter()->option('show_export_current_page')) {
             return;
         }
 
@@ -78,8 +78,8 @@ JS;
     protected function renderExportSelectedRows()
     {
         if (
-            !$this->grid->option('show_row_selector')
-            || !$this->grid->getExporter()->option('show_export_selected_rows')
+            ! $this->grid->option('show_row_selector')
+            || ! $this->grid->getExporter()->option('show_export_selected_rows')
         ) {
             return;
         }

+ 3 - 3
src/Grid/Tools/FilterButton.php

@@ -32,7 +32,7 @@ class FilterButton extends AbstractTool
      */
     protected function getElementClassName()
     {
-        if (!$this->btnClassName) {
+        if (! $this->btnClassName) {
             $this->btnClassName = 'filter-btn-'.Str::random(8);
         }
 
@@ -87,13 +87,13 @@ JS
         $scopres = $filter->getScopes();
         $filters = $filter->filters();
 
-        if ($scopres->isEmpty() && !$filters) {
+        if ($scopres->isEmpty() && ! $filters) {
             return;
         }
 
         $this->setupScripts();
 
-        $onlyScopes = ((!$filters || $this->grid->option('show_filter') === false) && !$scopres->isEmpty()) ? true : false;
+        $onlyScopes = ((! $filters || $this->grid->option('show_filter') === false) && ! $scopres->isEmpty()) ? true : false;
 
         $variables = [
             'scopes'           => $scopres,

+ 1 - 1
src/Grid/Tools/Paginator.php

@@ -56,7 +56,7 @@ class Paginator extends AbstractTool
      */
     protected function perPageSelector()
     {
-        if (!$this->grid->getPerPages()) {
+        if (! $this->grid->getPerPages()) {
             return;
         }
 

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

@@ -116,17 +116,17 @@ class Selector
      */
     public function parseSelected()
     {
-        if (!is_null($this->selected)) {
+        if (! is_null($this->selected)) {
             return $this->selected;
         }
 
         $selected = $this->request->get($this->queryName, []);
-        if (!is_array($selected)) {
+        if (! is_array($selected)) {
             return [];
         }
 
         $selected = array_filter($selected, function ($value) {
-            return !is_null($value);
+            return ! is_null($value);
         });
 
         foreach ($selected as &$value) {
@@ -166,7 +166,7 @@ class Selector
             array_push($options, $value);
         }
 
-        if (!empty($options)) {
+        if (! empty($options)) {
             Arr::set($query, "{$this->queryName}.{$column}", implode(',', $options));
         } else {
             Arr::forget($query, "{$this->queryName}.{$column}");

+ 1 - 1
src/Layout/Column.php

@@ -69,7 +69,7 @@ class Column implements Buildable
      */
     public function row($content)
     {
-        if (!$content instanceof \Closure) {
+        if (! $content instanceof \Closure) {
             $row = new Row($content);
         } else {
             $row = new Row();

+ 4 - 4
src/Layout/Content.php

@@ -151,21 +151,21 @@ class Content implements Renderable
      */
     protected function formatBreadcrumb(array &$breadcrumb)
     {
-        if (!$breadcrumb) {
+        if (! $breadcrumb) {
             throw new \Exception('Breadcrumb format error!');
         }
 
         $notArray = false;
         foreach ($breadcrumb as &$item) {
             $isArray = is_array($item);
-            if ($isArray && !isset($item['text'])) {
+            if ($isArray && ! isset($item['text'])) {
                 throw new \Exception('Breadcrumb format error!');
             }
-            if (!$isArray && $item) {
+            if (! $isArray && $item) {
                 $notArray = true;
             }
         }
-        if (!$breadcrumb) {
+        if (! $breadcrumb) {
             throw new \Exception('Breadcrumb format error!');
         }
         if ($notArray) {

+ 5 - 5
src/Layout/Menu.php

@@ -53,7 +53,7 @@ class Menu
      */
     public function register()
     {
-        if (!admin_has_default_section(\AdminSection::LEFT_SIDEBAR_MENU)) {
+        if (! admin_has_default_section(\AdminSection::LEFT_SIDEBAR_MENU)) {
             admin_inject_default_section(\AdminSection::LEFT_SIDEBAR_MENU, function () {
                 $menuModel = config('admin.database.menu_model');
 
@@ -131,7 +131,7 @@ class Menu
             if ($path == trim($this->getPath($v['uri']), '/')) {
                 return true;
             }
-            if (!empty($v['children'])) {
+            if (! empty($v['children'])) {
                 if (static::isActive($v, $path)) {
                     return true;
                 }
@@ -152,7 +152,7 @@ class Menu
         $roles = array_column($menuItem['roles'] ?? [], 'slug');
         $permissions = array_column($menuItem['permissions'] ?? [], 'slug');
 
-        if (!$permissionIds && !$roles && !$permissions) {
+        if (! $permissionIds && ! $roles && ! $permissions) {
             return true;
         }
 
@@ -178,7 +178,7 @@ class Menu
      */
     public function getPath($uri)
     {
-        if (!$uri) {
+        if (! $uri) {
             return $uri;
         }
 
@@ -192,7 +192,7 @@ class Menu
      */
     public function getUrl($uri)
     {
-        if (!$uri) {
+        if (! $uri) {
             return $uri;
         }
 

+ 1 - 1
src/Layout/Navbar.php

@@ -61,7 +61,7 @@ class Navbar implements Renderable
     {
         $this->callComposing($part);
 
-        if (!isset($this->elements[$part]) || $this->elements[$part]->isEmpty()) {
+        if (! isset($this->elements[$part]) || $this->elements[$part]->isEmpty()) {
             return '';
         }
 

+ 1 - 1
src/Layout/Row.php

@@ -18,7 +18,7 @@ class Row implements Buildable, Renderable
      */
     public function __construct($content = '')
     {
-        if (!empty($content)) {
+        if (! empty($content)) {
             $this->column(12, $content);
         }
     }

+ 6 - 6
src/Layout/SectionManager.php

@@ -63,17 +63,17 @@ class SectionManager
      */
     protected function put($section, $content, bool $append = false, int $priority = 10)
     {
-        if (!$section) {
+        if (! $section) {
             throw new \InvalidArgumentException('Section name is required.');
         }
 
-        if (!isset($this->sections[$section])) {
+        if (! isset($this->sections[$section])) {
             unset($this->defaultSections[$section]);
 
             $this->sections[$section] = [];
         }
 
-        if (!isset($this->sections[$section][$priority])) {
+        if (! isset($this->sections[$section][$priority])) {
             $this->sections[$section][$priority] = [];
         }
 
@@ -96,7 +96,7 @@ class SectionManager
     {
         $defaultSection = $this->defaultSections[$section] ?? null;
 
-        if (!$this->hasSection($section) && $defaultSection === null) {
+        if (! $this->hasSection($section) && $defaultSection === null) {
             return Helper::render($default, [new Fluent()]);
         }
 
@@ -174,7 +174,7 @@ class SectionManager
             return $content;
         }
 
-        if (!is_array($content)) {
+        if (! is_array($content)) {
             $content = [['append' => true, 'value' => $content]];
         }
 
@@ -187,7 +187,7 @@ class SectionManager
             $value = Helper::render($item['value'] ?? '', [$options]);
             $append = $item['append'] ?? false;
 
-            if (!$append) {
+            if (! $append) {
                 $result = '';
             }
             $result .= $value;

+ 2 - 2
src/Middleware/Authenticate.php

@@ -19,10 +19,10 @@ class Authenticate
      */
     public function handle($request, Closure $next)
     {
-        if (Admin::guard()->guest() && !$this->shouldPassThrough($request)) {
+        if (Admin::guard()->guest() && ! $this->shouldPassThrough($request)) {
             $loginPage = admin_base_path('auth/login');
 
-            if ($request->ajax() && !$request->pjax()) {
+            if ($request->ajax() && ! $request->pjax()) {
                 return response()->json(['message' => 'Unauthorized.', 'login' => $loginPage], 401);
             }
 

Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff