Browse Source

Apply fixes from StyleCI

Jiang Qinghua 4 years ago
parent
commit
5f113f834a
100 changed files with 1024 additions and 1564 deletions
  1. 6 11
      src/Actions/Action.php
  2. 20 33
      src/Admin.php
  3. 13 20
      src/Color.php
  4. 3 5
      src/Console/ActionCommand.php
  5. 1 3
      src/Console/AdminCommand.php
  6. 2 4
      src/Console/Development/LinkCommand.php
  7. 3 6
      src/Console/ExportSeedCommand.php
  8. 6 7
      src/Console/ExtensionMakeCommand.php
  9. 1 2
      src/Console/FormCommand.php
  10. 6 10
      src/Console/IdeHelperCommand.php
  11. 2 4
      src/Console/InstallCommand.php
  12. 4 6
      src/Console/MinifyCommand.php
  13. 3 5
      src/Contracts/ExceptionHandler.php
  14. 2 4
      src/Contracts/Grid/ColumnSelectorStore.php
  15. 9 17
      src/Contracts/Repository.php
  16. 3 4
      src/Contracts/TreeRepository.php
  17. 2 3
      src/Contracts/UploadField.php
  18. 4 7
      src/Exception/Handler.php
  19. 4 6
      src/Extend/CanImportMenu.php
  20. 25 40
      src/Extend/Manager.php
  21. 13 21
      src/Extend/ServiceProvider.php
  22. 5 8
      src/Extend/Setting.php
  23. 1 1
      src/Extend/UpdateManager.php
  24. 125 182
      src/Form.php
  25. 3 6
      src/Form/AbstractTool.php
  26. 2 4
      src/Form/BlockForm.php
  27. 19 38
      src/Form/Builder.php
  28. 2 3
      src/Form/Concerns/HandleCascadeFields.php
  29. 27 46
      src/Form/Concerns/HasEvents.php
  30. 23 42
      src/Form/Concerns/HasFieldValidator.php
  31. 10 15
      src/Form/Concerns/HasFiles.php
  32. 2 3
      src/Form/Concerns/HasLayout.php
  33. 1 2
      src/Form/Concerns/HasRows.php
  34. 2 3
      src/Form/Concerns/HasTabs.php
  35. 65 74
      src/Form/EmbeddedForm.php
  36. 62 108
      src/Form/Field.php
  37. 6 8
      src/Form/Field/CanCascadeFields.php
  38. 8 10
      src/Form/Field/CanLoadFields.php
  39. 2 3
      src/Form/Field/CascadeGroup.php
  40. 2 4
      src/Form/Field/Checkbox.php
  41. 3 6
      src/Form/Field/Currency.php
  42. 6 12
      src/Form/Field/Editor.php
  43. 10 14
      src/Form/Field/Embeds.php
  44. 7 10
      src/Form/Field/File.php
  45. 19 26
      src/Form/Field/HasMany.php
  46. 2 2
      src/Form/Field/Html.php
  47. 50 52
      src/Form/Field/Image.php
  48. 11 16
      src/Form/Field/ImageField.php
  49. 2 4
      src/Form/Field/ListField.php
  50. 7 14
      src/Form/Field/Markdown.php
  51. 3 6
      src/Form/Field/MultipleFile.php
  52. 3 6
      src/Form/Field/MultipleImage.php
  53. 2 4
      src/Form/Field/MultipleSelectTable.php
  54. 2 4
      src/Form/Field/Number.php
  55. 2 4
      src/Form/Field/Radio.php
  56. 14 21
      src/Form/Field/Select.php
  57. 7 13
      src/Form/Field/SelectTable.php
  58. 3 6
      src/Form/Field/SwitchField.php
  59. 5 10
      src/Form/Field/Tags.php
  60. 10 17
      src/Form/Field/Text.php
  61. 1 2
      src/Form/Field/Textarea.php
  62. 12 18
      src/Form/Field/Tree.php
  63. 15 28
      src/Form/Field/UploadField.php
  64. 16 31
      src/Form/Field/WebUploader.php
  65. 11 19
      src/Form/Footer.php
  66. 10 13
      src/Form/Layout.php
  67. 15 25
      src/Form/NestedForm.php
  68. 2 4
      src/Form/ResolveField.php
  69. 56 59
      src/Form/Row.php
  70. 8 9
      src/Form/Tab.php
  71. 5 9
      src/Form/Tools.php
  72. 40 73
      src/Grid.php
  73. 30 50
      src/Grid/Column.php
  74. 11 18
      src/Grid/Column/Filter.php
  75. 3 4
      src/Grid/Column/Filter/Between.php
  76. 4 5
      src/Grid/Column/Filter/Equal.php
  77. 2 2
      src/Grid/Column/Filter/Gt.php
  78. 3 3
      src/Grid/Column/Filter/In.php
  79. 2 4
      src/Grid/Column/Filter/Input.php
  80. 2 2
      src/Grid/Column/Filter/Like.php
  81. 2 2
      src/Grid/Column/Filter/Lt.php
  82. 2 2
      src/Grid/Column/Filter/Ngt.php
  83. 2 2
      src/Grid/Column/Filter/Nlt.php
  84. 2 2
      src/Grid/Column/Filter/StartWith.php
  85. 19 32
      src/Grid/Column/HasDisplayers.php
  86. 9 14
      src/Grid/Column/HasHeader.php
  87. 1 1
      src/Grid/Column/Help.php
  88. 3 3
      src/Grid/Column/Sorter.php
  89. 4 6
      src/Grid/ComplexHeader.php
  90. 2 3
      src/Grid/Concerns/CanFixColumns.php
  91. 2 4
      src/Grid/Concerns/CanHidesColumns.php
  92. 8 16
      src/Grid/Concerns/HasActions.php
  93. 3 4
      src/Grid/Concerns/HasComplexHeaders.php
  94. 4 5
      src/Grid/Concerns/HasEvents.php
  95. 5 9
      src/Grid/Concerns/HasExporter.php
  96. 5 10
      src/Grid/Concerns/HasFilter.php
  97. 3 6
      src/Grid/Concerns/HasNames.php
  98. 5 9
      src/Grid/Concerns/HasPaginator.php
  99. 1 2
      src/Grid/Concerns/HasQuickCreate.php
  100. 27 29
      src/Grid/Concerns/HasQuickSearch.php

+ 6 - 11
src/Actions/Action.php

@@ -61,7 +61,7 @@ abstract class Action implements Renderable
     /**
      * Action constructor.
      *
-     * @param string $title
+     * @param  string  $title
      */
     public function __construct($title = null)
     {
@@ -73,8 +73,7 @@ abstract class Action implements Renderable
     /**
      * 是否禁用动作.
      *
-     * @param bool $disable
-     *
+     * @param  bool  $disable
      * @return $this
      */
     public function disable(bool $disable = true)
@@ -105,8 +104,7 @@ abstract class Action implements Renderable
     /**
      * 设置主键.
      *
-     * @param mixed $key
-     *
+     * @param  mixed  $key
      * @return $this
      */
     public function setKey($key)
@@ -145,8 +143,7 @@ abstract class Action implements Renderable
     /**
      * 生成选择器.
      *
-     * @param string $prefix
-     *
+     * @param  string  $prefix
      * @return string
      */
     public function makeSelector()
@@ -155,8 +152,7 @@ abstract class Action implements Renderable
     }
 
     /**
-     * @param string|array $class
-     *
+     * @param  string|array  $class
      * @return $this
      */
     public function addHtmlClass($class)
@@ -260,8 +256,7 @@ HTML;
     }
 
     /**
-     * @param mixed ...$params
-     *
+     * @param  mixed  ...$params
      * @return $this
      */
     public static function make(...$params)

+ 20 - 33
src/Admin.php

@@ -86,8 +86,7 @@ class Admin
     /**
      * 菜单管理.
      *
-     * @param Closure|null $builder
-     *
+     * @param  Closure|null  $builder
      * @return Menu
      */
     public static function menu(Closure $builder = null)
@@ -114,8 +113,7 @@ class Admin
     }
 
     /**
-     * @param null|string $favicon
-     *
+     * @param  null|string  $favicon
      * @return string|void
      */
     public static function favicon($favicon = null)
@@ -130,7 +128,7 @@ class Admin
     /**
      * 设置翻译文件路径.
      *
-     * @param string|null $path
+     * @param  string|null  $path
      */
     public static function translation(?string $path)
     {
@@ -156,8 +154,7 @@ class Admin
     }
 
     /**
-     * @param Closure|null $builder
-     *
+     * @param  Closure|null  $builder
      * @return Navbar
      */
     public static function navbar(Closure $builder = null)
@@ -172,8 +169,7 @@ class Admin
     /**
      * 启用或禁用Pjax.
      *
-     * @param bool $value
-     *
+     * @param  bool  $value
      * @return void
      */
     public static function pjax(bool $value = true)
@@ -210,8 +206,7 @@ class Admin
     /**
      * section.
      *
-     * @param Closure|null $builder
-     *
+     * @param  Closure|null  $builder
      * @return SectionManager
      */
     public static function section(Closure $builder = null)
@@ -236,9 +231,8 @@ class Admin
     /**
      * 创建数据仓库实例.
      *
-     * @param string|Repository|Model|Builder $value
-     * @param array                   $args
-     *
+     * @param  string|Repository|Model|Builder  $value
+     * @param  array  $args
      * @return Repository
      */
     public static function repository($repository, array $args = [])
@@ -273,8 +267,7 @@ class Admin
     /**
      * 处理异常.
      *
-     * @param \Throwable $e
-     *
+     * @param  \Throwable  $e
      * @return mixed
      */
     public static function handleException(\Throwable $e)
@@ -285,8 +278,7 @@ class Admin
     /**
      * 上报异常.
      *
-     * @param \Throwable $e
-     *
+     * @param  \Throwable  $e
      * @return mixed
      */
     public static function reportException(\Throwable $e)
@@ -297,8 +289,7 @@ class Admin
     /**
      * 显示异常信息.
      *
-     * @param \Throwable $e
-     *
+     * @param  \Throwable  $e
      * @return mixed
      */
     public static function renderException(\Throwable $e)
@@ -307,7 +298,7 @@ class Admin
     }
 
     /**
-     * @param callable $callback
+     * @param  callable  $callback
      */
     public static function booting($callback)
     {
@@ -315,7 +306,7 @@ class Admin
     }
 
     /**
-     * @param callable $callback
+     * @param  callable  $callback
      */
     public static function booted($callback)
     {
@@ -359,8 +350,7 @@ class Admin
     }
 
     /**
-     * @param array|string $name
-     *
+     * @param  array|string  $name
      * @return void
      */
     public static function addIgnoreQueryName($name)
@@ -383,7 +373,7 @@ class Admin
     /**
      * 中断默认的渲染逻辑.
      *
-     * @param string|\Illuminate\Contracts\Support\Renderable|\Closure $value
+     * @param  string|\Illuminate\Contracts\Support\Renderable|\Closure  $value
      */
     public static function prevent($value)
     {
@@ -438,8 +428,7 @@ class Admin
     /**
      * 响应json数据.
      *
-     * @param array $data
-     *
+     * @param  array  $data
      * @return JsonResponse
      */
     public static function json(array $data = [])
@@ -450,8 +439,7 @@ class Admin
     /**
      * 插件管理.
      *
-     * @param string $name
-     *
+     * @param  string  $name
      * @return \Dcat\Admin\Extend\Manager|\Dcat\Admin\Extend\ServiceProvider|null
      */
     public static function extension(?string $name = null)
@@ -466,7 +454,7 @@ class Admin
     /**
      * 响应并中断后续逻辑.
      *
-     * @param Response|string|array $response
+     * @param  Response|string|array  $response
      *
      * @throws HttpResponseException
      */
@@ -494,7 +482,7 @@ class Admin
     /**
      * 往分组插入中间件.
      *
-     * @param array $mix
+     * @param  array  $mix
      */
     public static function mixMiddlewareGroup(array $mix = [])
     {
@@ -532,8 +520,7 @@ class Admin
     /**
      * 获取js配置.
      *
-     * @param array|null $variables
-     *
+     * @param  array|null  $variables
      * @return string
      */
     public static function jsVariables(array $variables = null)

+ 13 - 20
src/Color.php

@@ -221,8 +221,7 @@ class Color
     /**
      * 设置主题色名称.
      *
-     * @param string $name
-     *
+     * @param  string  $name
      * @return void
      */
     public function setName(string $name)
@@ -233,9 +232,8 @@ class Color
     /**
      * 获取颜色.
      *
-     * @param string $colorName
-     * @param string $default
-     *
+     * @param  string  $colorName
+     * @param  string  $default
      * @return string
      */
     public function get(?string $colorName, ?string $default = null)
@@ -278,9 +276,8 @@ class Color
     /**
      * 颜色转亮.
      *
-     * @param string $color
-     * @param int    $amt
-     *
+     * @param  string  $color
+     * @param  int  $amt
      * @return string
      */
     public function lighten(?string $color, int $amt)
@@ -291,9 +288,8 @@ class Color
     /**
      * 颜色转暗.
      *
-     * @param string $color
-     * @param int    $amt
-     *
+     * @param  string  $color
+     * @param  int  $amt
      * @return string
      */
     public function darken(string $color, int $amt)
@@ -304,9 +300,8 @@ class Color
     /**
      * 颜色透明度转化.
      *
-     * @param string       $color
-     * @param float|string $alpha
-     *
+     * @param  string  $color
+     * @param  float|string  $alpha
      * @return string
      */
     public function alpha(?string $color, $alpha)
@@ -332,9 +327,8 @@ class Color
     /**
      * 获取颜色.
      *
-     * @param string $method
-     * @param array $arguments
-     *
+     * @param  string  $method
+     * @param  array  $arguments
      * @return string
      */
     public function __call(string $method, array $arguments = [])
@@ -348,9 +342,8 @@ class Color
     /**
      * 扩展颜色.
      *
-     * @param string $name
-     * @param array  $colors
-     *
+     * @param  string  $name
+     * @param  array  $colors
      * @return void
      */
     public static function extend(string $name, array $colors)

+ 3 - 5
src/Console/ActionCommand.php

@@ -88,9 +88,8 @@ class ActionCommand extends GeneratorCommand
     /**
      * Replace the class name for the given stub.
      *
-     * @param string $stub
-     * @param string $name
-     *
+     * @param  string  $stub
+     * @param  string  $name
      * @return string
      */
     protected function replaceClass($stub, $name)
@@ -121,8 +120,7 @@ class ActionCommand extends GeneratorCommand
     /**
      * Get the default namespace for the class.
      *
-     * @param string $rootNamespace
-     *
+     * @param  string  $rootNamespace
      * @return string
      */
     protected function getDefaultNamespace($rootNamespace)

+ 1 - 3
src/Console/AdminCommand.php

@@ -75,7 +75,6 @@ LOGO;
 
     /**
      * @param (Command|string)[] $commands
-     *
      * @return int
      */
     private function getColumnWidth(array $commands)
@@ -95,8 +94,7 @@ LOGO;
     /**
      * Returns the length of a string, using mb_strwidth if it is available.
      *
-     * @param string $string The string to check its length
-     *
+     * @param  string  $string  The string to check its length
      * @return int The length of the string
      */
     public static function strlen($string)

+ 2 - 4
src/Console/Development/LinkCommand.php

@@ -29,8 +29,7 @@ class LinkCommand extends Command
     }
 
     /**
-     * @param Filesystem $files
-     *
+     * @param  Filesystem  $files
      * @return void
      */
     protected function linkTests($files)
@@ -60,8 +59,7 @@ class LinkCommand extends Command
     }
 
     /**
-     * @param Filesystem $files
-     *
+     * @param  Filesystem  $files
      * @return void
      */
     protected function linkAssets($files)

+ 3 - 6
src/Console/ExportSeedCommand.php

@@ -91,9 +91,8 @@ class ExportSeedCommand extends Command
     /**
      * Get data array from table as string result var_export.
      *
-     * @param string $table
-     * @param array  $exceptFields
-     *
+     * @param  string  $table
+     * @param  array  $exceptFields
      * @return string
      */
     protected function getTableDataArrayAsString($table, $exceptFields = [])
@@ -112,7 +111,6 @@ class ExportSeedCommand extends Command
      * Get stub contents.
      *
      * @param $name
-     *
      * @return string
      */
     protected function getStub($name)
@@ -124,8 +122,7 @@ class ExportSeedCommand extends Command
      * Custom var_export for correct work with \r\n.
      *
      * @param $var
-     * @param string $indent
-     *
+     * @param  string  $indent
      * @return string
      */
     protected function varExport($var, $indent = '')

+ 6 - 7
src/Console/ExtensionMakeCommand.php

@@ -329,8 +329,7 @@ TEXT;
     /**
      * Extension path.
      *
-     * @param string $path
-     *
+     * @param  string  $path
      * @return string
      */
     protected function extensionPath($path = '')
@@ -347,8 +346,8 @@ TEXT;
     /**
      * Put contents to file.
      *
-     * @param string $to
-     * @param string $content
+     * @param  string  $to
+     * @param  string  $content
      */
     protected function putFile($to, $content)
     {
@@ -360,8 +359,8 @@ TEXT;
     /**
      * Copy files to extension path.
      *
-     * @param string|array $from
-     * @param string|null  $to
+     * @param  string|array  $from
+     * @param  string|null  $to
      */
     protected function copy($from, $to = null)
     {
@@ -385,7 +384,7 @@ TEXT;
     /**
      * Make new directory.
      *
-     * @param array|string $paths
+     * @param  array|string  $paths
      */
     protected function makeDir($paths = '')
     {

+ 1 - 2
src/Console/FormCommand.php

@@ -45,8 +45,7 @@ class FormCommand extends GeneratorCommand
     /**
      * Get the default namespace for the class.
      *
-     * @param string $rootNamespace
-     *
+     * @param  string  $rootNamespace
      * @return string
      */
     protected function getDefaultNamespace($rootNamespace)

+ 6 - 10
src/Console/IdeHelperCommand.php

@@ -92,8 +92,7 @@ class IdeHelperCommand extends Command
     }
 
     /**
-     * @param array $reject
-     *
+     * @param  array  $reject
      * @return Collection
      */
     protected function getFieldsFromDatabase(array $reject = [])
@@ -136,8 +135,7 @@ class IdeHelperCommand extends Command
     }
 
     /**
-     * @param array $reject
-     *
+     * @param  array  $reject
      * @return Collection
      */
     protected function getFieldsFromControllerFiles(array $reject = [])
@@ -167,7 +165,7 @@ class IdeHelperCommand extends Command
     }
 
     /**
-     * @param Collection $fields
+     * @param  Collection  $fields
      */
     protected function write(Collection $fields)
     {
@@ -195,9 +193,8 @@ class IdeHelperCommand extends Command
     }
 
     /**
-     * @param string     $type
-     * @param Collection $fields
-     *
+     * @param  string  $type
+     * @param  Collection  $fields
      * @return string
      */
     public function generate(string $type, Collection $fields)
@@ -368,8 +365,7 @@ class IdeHelperCommand extends Command
     }
 
     /**
-     * @param string $class
-     *
+     * @param  string  $class
      * @return string
      */
     public function getFileNameByClass($class)

+ 2 - 4
src/Console/InstallCommand.php

@@ -168,8 +168,7 @@ class InstallCommand extends Command
     }
 
     /**
-     * @param string $name
-     *
+     * @param  string  $name
      * @return string
      */
     protected function namespace($name = null)
@@ -211,7 +210,6 @@ class InstallCommand extends Command
      * Get stub contents.
      *
      * @param $name
-     *
      * @return string
      */
     protected function getStub($name)
@@ -222,7 +220,7 @@ class InstallCommand extends Command
     /**
      * Make new directory.
      *
-     * @param string $path
+     * @param  string  $path
      */
     protected function makeDir($path = '')
     {

+ 4 - 6
src/Console/MinifyCommand.php

@@ -216,8 +216,7 @@ class MinifyCommand extends Command
     /**
      * 获取颜色.
      *
-     * @param string $name
-     *
+     * @param  string  $name
      * @return string
      */
     protected function getColor($name)
@@ -246,8 +245,7 @@ class MinifyCommand extends Command
     }
 
     /**
-     * @param string $color
-     *
+     * @param  string  $color
      * @return string
      */
     protected function formatColor($color)
@@ -262,8 +260,8 @@ class MinifyCommand extends Command
     /**
      * 执行命令.
      *
-     * @param string $command
-     * @param int    $timeout
+     * @param  string  $command
+     * @param  int  $timeout
      */
     protected function runProcess($command, $timeout = 1800)
     {

+ 3 - 5
src/Contracts/ExceptionHandler.php

@@ -7,8 +7,7 @@ interface ExceptionHandler
     /**
      * 处理异常.
      *
-     * @param \Throwable $e
-     *
+     * @param  \Throwable  $e
      * @return array|string|void
      */
     public function handle(\Throwable $e);
@@ -16,8 +15,7 @@ interface ExceptionHandler
     /**
      * 显示异常信息.
      *
-     * @param \Throwable $exception
-     *
+     * @param  \Throwable  $exception
      * @return array|string|void
      */
     public function render(\Throwable $exception);
@@ -25,7 +23,7 @@ interface ExceptionHandler
     /**
      * 上报异常信息.
      *
-     * @param \Throwable $e
+     * @param  \Throwable  $e
      */
     public function report(\Throwable $e);
 }

+ 2 - 4
src/Contracts/Grid/ColumnSelectorStore.php

@@ -7,8 +7,7 @@ use Dcat\Admin\Grid;
 interface ColumnSelectorStore
 {
     /**
-     * @param Grid $grid
-     *
+     * @param  Grid  $grid
      * @return mixed
      */
     public function setGrid(Grid $grid);
@@ -16,8 +15,7 @@ interface ColumnSelectorStore
     /**
      * 存储数据.
      *
-     * @param array $input
-     *
+     * @param  array  $input
      * @return void
      */
     public function store(array $input);

+ 9 - 17
src/Contracts/Repository.php

@@ -48,8 +48,7 @@ interface Repository
     /**
      * 获取Grid表格数据.
      *
-     * @param Grid\Model $model
-     *
+     * @param  Grid\Model  $model
      * @return \Illuminate\Contracts\Pagination\LengthAwarePaginator|Collection|array
      */
     public function get(Grid\Model $model);
@@ -57,8 +56,7 @@ interface Repository
     /**
      * 获取编辑页面数据.
      *
-     * @param Form $form
-     *
+     * @param  Form  $form
      * @return array|\Illuminate\Contracts\Support\Arrayable
      */
     public function edit(Form $form);
@@ -66,8 +64,7 @@ interface Repository
     /**
      * 获取详情页面数据.
      *
-     * @param Show $show
-     *
+     * @param  Show  $show
      * @return array|\Illuminate\Contracts\Support\Arrayable
      */
     public function detail(Show $show);
@@ -75,8 +72,7 @@ interface Repository
     /**
      * 新增记录.
      *
-     * @param Form $form
-     *
+     * @param  Form  $form
      * @return int|bool|\Dcat\Admin\Http\JsonResponse
      */
     public function store(Form $form);
@@ -84,8 +80,7 @@ interface Repository
     /**
      * 查询更新前的行数据.
      *
-     * @param Form $form
-     *
+     * @param  Form  $form
      * @return array|\Illuminate\Contracts\Support\Arrayable
      */
     public function updating(Form $form);
@@ -93,8 +88,7 @@ interface Repository
     /**
      * 更新数据.
      *
-     * @param Form $form
-     *
+     * @param  Form  $form
      * @return bool|\Dcat\Admin\Http\JsonResponse
      */
     public function update(Form $form);
@@ -102,9 +96,8 @@ interface Repository
     /**
      * 删除数据.
      *
-     * @param Form  $form
-     * @param array $deletingData
-     *
+     * @param  Form  $form
+     * @param  array  $deletingData
      * @return mixed|\Dcat\Admin\Http\JsonResponse
      */
     public function delete(Form $form, array $deletingData);
@@ -112,8 +105,7 @@ interface Repository
     /**
      * 查询删除前的行数据.
      *
-     * @param Form $form
-     *
+     * @param  Form  $form
      * @return array|\Illuminate\Contracts\Support\Arrayable
      */
     public function deleting(Form $form);

+ 3 - 4
src/Contracts/TreeRepository.php

@@ -43,16 +43,15 @@ interface TreeRepository
     /**
      * 保存层级数据排序.
      *
-     * @param array $tree
-     * @param int   $parentId
+     * @param  array  $tree
+     * @param  int  $parentId
      */
     public function saveOrder($tree = [], $parentId = 0);
 
     /**
      * 设置数据查询回调.
      *
-     * @param \Closure|null $query
-     *
+     * @param  \Closure|null  $query
      * @return $this
      */
     public function withQuery($queryCallback);

+ 2 - 3
src/Contracts/UploadField.php

@@ -10,8 +10,7 @@ interface UploadField
     /**
      * Upload File.
      *
-     * @param UploadedFile $file
-     *
+     * @param  UploadedFile  $file
      * @return Response
      */
     public function upload(UploadedFile $file);
@@ -26,7 +25,7 @@ interface UploadField
     /**
      * Destroy files.
      *
-     * @param string|array $path
+     * @param  string|array  $path
      */
     public function deleteFile($path);
 }

+ 4 - 7
src/Exception/Handler.php

@@ -13,8 +13,7 @@ class Handler implements ExceptionHandler
     /**
      * 处理异常.
      *
-     * @param \Throwable $e
-     *
+     * @param  \Throwable  $e
      * @return array|string|void
      */
     public function handle(\Throwable $e)
@@ -31,8 +30,7 @@ class Handler implements ExceptionHandler
     /**
      * 显示异常信息.
      *
-     * @param \Throwable $exception
-     *
+     * @param  \Throwable  $exception
      * @return array|string|void
      *
      * @throws \Throwable
@@ -64,7 +62,7 @@ class Handler implements ExceptionHandler
     /**
      * 上报异常信息.
      *
-     * @param \Throwable $e
+     * @param  \Throwable  $e
      */
     public function report(\Throwable $e)
     {
@@ -72,8 +70,7 @@ class Handler implements ExceptionHandler
     }
 
     /**
-     * @param string $path
-     *
+     * @param  string  $path
      * @return mixed
      */
     protected function replaceBasePath(string $path)

+ 4 - 6
src/Extend/CanImportMenu.php

@@ -32,7 +32,7 @@ trait CanImportMenu
     /**
      * 添加菜单.
      *
-     * @param array $menu
+     * @param  array  $menu
      *
      * @throws \Exception
      */
@@ -81,8 +81,7 @@ trait CanImportMenu
     /**
      * 根据名称获取菜单ID.
      *
-     * @param int|string $parent
-     *
+     * @param  int|string  $parent
      * @return int
      */
     protected function getParentMenuId($parent)
@@ -118,11 +117,10 @@ trait CanImportMenu
     /**
      * 验证菜单字段格式是否正确.
      *
-     * @param array $menu
+     * @param  array  $menu
+     * @return bool
      *
      * @throws \Exception
-     *
-     * @return bool
      */
     public function validateMenu(array $menu)
     {

+ 25 - 40
src/Extend/Manager.php

@@ -78,8 +78,7 @@ class Manager
     /**
      * 判断扩展是否启用.
      *
-     * @param string|null $name
-     *
+     * @param  string|null  $name
      * @return bool
      */
     public function enabled(?string $name)
@@ -90,9 +89,8 @@ class Manager
     /**
      * 启用或禁用扩展.
      *
-     * @param string|null $name
-     * @param bool        $enable
-     *
+     * @param  string|null  $name
+     * @param  bool  $enable
      * @return void
      */
     public function enable(?string $name, bool $enable = true)
@@ -131,9 +129,8 @@ class Manager
     /**
      * 获取扩展路径.
      *
-     * @param string|ServiceProvider $name
-     * @param string|null            $path
-     *
+     * @param  string|ServiceProvider  $name
+     * @param  string|null  $path
      * @return string|void
      *
      * @throws \ReflectionException
@@ -150,8 +147,7 @@ class Manager
     /**
      * 获取扩展对象.
      *
-     * @param string|ServiceProvider $name
-     *
+     * @param  string|ServiceProvider  $name
      * @return ServiceProvider|null
      */
     public function get($name)
@@ -166,8 +162,7 @@ class Manager
     /**
      * 判断插件是否存在.
      *
-     * @param string $name
-     *
+     * @param  string  $name
      * @return bool
      */
     public function has($name)
@@ -176,8 +171,7 @@ class Manager
     }
 
     /**
-     * @param string $name
-     *
+     * @param  string  $name
      * @return mixed
      */
     protected function formatName($name)
@@ -212,9 +206,8 @@ class Manager
     /**
      * 加载扩展.
      *
-     * @param string $directory
-     * @param bool   $addPsr4
-     *
+     * @param  string  $directory
+     * @param  bool  $addPsr4
      * @return ServiceProvider|null
      */
     public function loadExtension(string $directory, bool $addPsr4 = true)
@@ -235,9 +228,8 @@ class Manager
     /**
      * 获取扩展类实例.
      *
-     * @param string $directory
-     * @param bool   $addPsr4
-     *
+     * @param  string  $directory
+     * @param  bool  $addPsr4
      * @return ServiceProvider
      */
     public function resolveExtension(string $directory, bool $addPsr4 = true)
@@ -263,8 +255,7 @@ class Manager
     /**
      * 获取扩展目录.
      *
-     * @param string $dirPath
-     *
+     * @param  string  $dirPath
      * @return array
      */
     public function getExtensionDirectories($dirPath = null)
@@ -297,7 +288,7 @@ class Manager
     /**
      * 添加扩展.
      *
-     * @param \Dcat\Admin\Extend\ServiceProvider $serviceProvider
+     * @param  \Dcat\Admin\Extend\ServiceProvider  $serviceProvider
      */
     public function addExtension(ServiceProvider $serviceProvider)
     {
@@ -321,7 +312,6 @@ class Manager
      * 获取扩展名称.
      *
      * @param $extension
-     *
      * @return string
      */
     public function getName($extension)
@@ -336,9 +326,8 @@ class Manager
     /**
      * 解压缩扩展包.
      *
-     * @param string $filePath
-     * @param bool   $force
-     *
+     * @param  string  $filePath
+     * @param  bool  $force
      * @return string
      */
     public function extract($filePath, bool $force = false)
@@ -353,9 +342,8 @@ class Manager
     }
 
     /**
-     * @param string $filePath
-     * @param bool   $force
-     *
+     * @param  string  $filePath
+     * @param  bool  $force
      * @return bool
      */
     public function extractZip($filePath, bool $force = false)
@@ -412,7 +400,6 @@ class Manager
      * 校验扩展包内容是否正确.
      *
      * @param $directory
-     *
      * @return bool
      */
     protected function checkFiles($directory)
@@ -437,8 +424,8 @@ class Manager
     /**
      * 生成临时文件.
      *
-     * @param string $fileCode A unique file code
-     * @return string           Full path on the disk
+     * @param  string  $fileCode  A unique file code
+     * @return string Full path on the disk
      */
     protected function getFilePath($fileCode)
     {
@@ -486,8 +473,7 @@ class Manager
     /**
      * 创建临时目录.
      *
-     * @param string $dir
-     *
+     * @param  string  $dir
      * @return string
      */
     protected function makeTempDirectory($dir = null)
@@ -506,8 +492,8 @@ class Manager
     /**
      * 注册 PSR4 验证规则.
      *
-     * @param string $directory
-     * @param array  $psr4
+     * @param  string  $directory
+     * @param  array  $psr4
      */
     protected function registerPsr4($directory, array $psr4)
     {
@@ -523,7 +509,7 @@ class Manager
     /**
      * 上报异常.
      *
-     * @param \Throwable $e
+     * @param  \Throwable  $e
      */
     protected function reportException(\Throwable $e)
     {
@@ -531,8 +517,7 @@ class Manager
     }
 
     /**
-     * @param string $dir
-     *
+     * @param  string  $dir
      * @return array
      */
     protected function scandir($dir)

+ 13 - 21
src/Extend/ServiceProvider.php

@@ -220,8 +220,7 @@ abstract class ServiceProvider extends LaravelServiceProvider
     /**
      * 获取扩展包路径.
      *
-     * @param string $path
-     *
+     * @param  string  $path
      * @return string
      *
      * @throws \ReflectionException
@@ -295,9 +294,8 @@ abstract class ServiceProvider extends LaravelServiceProvider
     /**
      * 获取或保存配置.
      *
-     * @param string $key
-     * @param null   $default
-     *
+     * @param  string  $key
+     * @param  null  $default
      * @return mixed
      */
     public function config($key = null, $default = null)
@@ -322,7 +320,7 @@ abstract class ServiceProvider extends LaravelServiceProvider
     /**
      * 保存配置.
      *
-     * @param array $config
+     * @param  array  $config
      */
     public function saveConfig(array $config)
     {
@@ -343,8 +341,8 @@ abstract class ServiceProvider extends LaravelServiceProvider
     /**
      * 更新扩展.
      *
-     * @param string $currentVersion
-     * @param string $stopOnVersion
+     * @param  string  $currentVersion
+     * @param  string  $stopOnVersion
      *
      * @throws \Exception
      */
@@ -493,8 +491,7 @@ abstract class ServiceProvider extends LaravelServiceProvider
     }
 
     /**
-     * @param ComposerProperty $composerProperty
-     *
+     * @param  ComposerProperty  $composerProperty
      * @return $this
      */
     public function withComposerProperty(ComposerProperty $composerProperty)
@@ -507,9 +504,8 @@ abstract class ServiceProvider extends LaravelServiceProvider
     /**
      * 获取或保存配置.
      *
-     * @param string $key
-     * @param string $value
-     *
+     * @param  string  $key
+     * @param  string  $value
      * @return mixed
      */
     public static function setting($key = null, $value = null)
@@ -524,10 +520,9 @@ abstract class ServiceProvider extends LaravelServiceProvider
     /**
      * 翻译.
      *
-     * @param string $key
-     * @param array  $replace
-     * @param null   $locale
-     *
+     * @param  string  $key
+     * @param  array  $replace
+     * @param  null  $locale
      * @return array|string|null
      */
     public static function trans($key, $replace = [], $locale = null)
@@ -564,8 +559,7 @@ abstract class ServiceProvider extends LaravelServiceProvider
     }
 
     /**
-     * @param string|array $files
-     *
+     * @param  string|array  $files
      * @return mixed
      */
     protected function formatAssetFiles($files)
@@ -589,7 +583,6 @@ abstract class ServiceProvider extends LaravelServiceProvider
 
     /**
      * @param $config
-     *
      * @return false|string
      */
     protected function serializeConfig($config)
@@ -599,7 +592,6 @@ abstract class ServiceProvider extends LaravelServiceProvider
 
     /**
      * @param $config
-     *
      * @return array
      */
     protected function unserializeConfig($config)

+ 5 - 8
src/Extend/Setting.php

@@ -35,8 +35,7 @@ abstract class Setting extends Form implements LazyRenderable
     /**
      * 处理请求.
      *
-     * @param array $input
-     *
+     * @param  array  $input
      * @return \Dcat\Admin\Http\JsonResponse
      */
     public function handle(array $input)
@@ -49,8 +48,7 @@ abstract class Setting extends Form implements LazyRenderable
     /**
      * 格式化配置信息.
      *
-     * @param array $input
-     *
+     * @param  array  $input
      * @return array
      */
     protected function formatInput(array $input)
@@ -77,10 +75,9 @@ abstract class Setting extends Form implements LazyRenderable
     /**
      * 翻译.
      *
-     * @param string $key
-     * @param array  $replace
-     * @param null   $locale
-     *
+     * @param  string  $key
+     * @param  array  $replace
+     * @param  null  $locale
      * @return array|string|null
      */
     protected function trans($key, $replace = [], $locale = null)

+ 1 - 1
src/Extend/UpdateManager.php

@@ -96,7 +96,7 @@ class UpdateManager
     /**
      * 发布扩展资源.
      *
-     * @param string $name
+     * @param  string  $name
      */
     public function publish($name)
     {

+ 125 - 182
src/Form.php

@@ -32,61 +32,61 @@ use Symfony\Component\HttpFoundation\Response;
 /**
  * Class Form.
  *
- * @method Field\Text                   text($column, $label = '')
- * @method Field\Checkbox               checkbox($column, $label = '')
- * @method Field\Radio                  radio($column, $label = '')
- * @method Field\Select                 select($column, $label = '')
- * @method Field\MultipleSelect         multipleSelect($column, $label = '')
- * @method Field\Textarea               textarea($column, $label = '')
- * @method Field\Hidden                 hidden($column, $label = '')
- * @method Field\Id                     id($column, $label = '')
- * @method Field\Ip                     ip($column, $label = '')
- * @method Field\Url                    url($column, $label = '')
- * @method Field\Email                  email($column, $label = '')
- * @method Field\Mobile                 mobile($column, $label = '')
- * @method Field\Slider                 slider($column, $label = '')
- * @method Field\Map                    map($latitude, $longitude, $label = '')
- * @method Field\Editor                 editor($column, $label = '')
- * @method Field\Date                   date($column, $label = '')
- * @method Field\Datetime               datetime($column, $label = '')
- * @method Field\Time                   time($column, $label = '')
- * @method Field\Year                   year($column, $label = '')
- * @method Field\Month                  month($column, $label = '')
- * @method Field\DateRange              dateRange($start, $end, $label = '')
- * @method Field\DateTimeRange          datetimeRange($start, $end, $label = '')
- * @method Field\TimeRange              timeRange($start, $end, $label = '')
- * @method Field\Number                 number($column, $label = '')
- * @method Field\Currency               currency($column, $label = '')
- * @method Field\SwitchField            switch($column, $label = '')
- * @method Field\Display                display($column, $label = '')
- * @method Field\Rate                   rate($column, $label = '')
- * @method Field\Divide                 divider(string $title = null)
- * @method Field\Password               password($column, $label = '')
- * @method Field\Decimal                decimal($column, $label = '')
- * @method Field\Html                   html($html, $label = '')
- * @method Field\Tags                   tags($column, $label = '')
- * @method Field\Icon                   icon($column, $label = '')
- * @method Field\Embeds                 embeds($column, $label = '', Closure $callback = null)
- * @method Field\Captcha                captcha()
- * @method Field\Listbox                listbox($column, $label = '')
- * @method Field\File                   file($column, $label = '')
- * @method Field\Image                  image($column, $label = '')
- * @method Field\MultipleFile           multipleFile($column, $label = '')
- * @method Field\MultipleImage          multipleImage($column, $label = '')
- * @method Field\HasMany                hasMany($column, $labelOrCallback, $callback = null)
- * @method Field\Tree                   tree($column, $label = '')
- * @method Field\Table                  table($column, $labelOrCallback, $callback = null)
- * @method Field\ListField              list($column, $label = '')
- * @method Field\Timezone               timezone($column, $label = '')
- * @method Field\KeyValue               keyValue($column, $label = '')
- * @method Field\Tel                    tel($column, $label = '')
- * @method Field\Markdown               markdown($column, $label = '')
- * @method Field\Range                  range($start, $end, $label = '')
- * @method Field\Color                  color($column, $label = '')
- * @method Field\ArrayField             array($column, $labelOrCallback, $callback = null)
- * @method Field\SelectTable            selectTable($column, $label = '')
- * @method Field\MultipleSelectTable    multipleSelectTable($column, $label = '')
- * @method Field\Button                 button(string $html = null)
+ * @method Field\Text text($column, $label = '')
+ * @method Field\Checkbox checkbox($column, $label = '')
+ * @method Field\Radio radio($column, $label = '')
+ * @method Field\Select select($column, $label = '')
+ * @method Field\MultipleSelect multipleSelect($column, $label = '')
+ * @method Field\Textarea textarea($column, $label = '')
+ * @method Field\Hidden hidden($column, $label = '')
+ * @method Field\Id id($column, $label = '')
+ * @method Field\Ip ip($column, $label = '')
+ * @method Field\Url url($column, $label = '')
+ * @method Field\Email email($column, $label = '')
+ * @method Field\Mobile mobile($column, $label = '')
+ * @method Field\Slider slider($column, $label = '')
+ * @method Field\Map map($latitude, $longitude, $label = '')
+ * @method Field\Editor editor($column, $label = '')
+ * @method Field\Date date($column, $label = '')
+ * @method Field\Datetime datetime($column, $label = '')
+ * @method Field\Time time($column, $label = '')
+ * @method Field\Year year($column, $label = '')
+ * @method Field\Month month($column, $label = '')
+ * @method Field\DateRange dateRange($start, $end, $label = '')
+ * @method Field\DateTimeRange datetimeRange($start, $end, $label = '')
+ * @method Field\TimeRange timeRange($start, $end, $label = '')
+ * @method Field\Number number($column, $label = '')
+ * @method Field\Currency currency($column, $label = '')
+ * @method Field\SwitchField switch($column, $label = '')
+ * @method Field\Display display($column, $label = '')
+ * @method Field\Rate rate($column, $label = '')
+ * @method Field\Divide divider(string $title = null)
+ * @method Field\Password password($column, $label = '')
+ * @method Field\Decimal decimal($column, $label = '')
+ * @method Field\Html html($html, $label = '')
+ * @method Field\Tags tags($column, $label = '')
+ * @method Field\Icon icon($column, $label = '')
+ * @method Field\Embeds embeds($column, $label = '', Closure $callback = null)
+ * @method Field\Captcha captcha()
+ * @method Field\Listbox listbox($column, $label = '')
+ * @method Field\File file($column, $label = '')
+ * @method Field\Image image($column, $label = '')
+ * @method Field\MultipleFile multipleFile($column, $label = '')
+ * @method Field\MultipleImage multipleImage($column, $label = '')
+ * @method Field\HasMany hasMany($column, $labelOrCallback, $callback = null)
+ * @method Field\Tree tree($column, $label = '')
+ * @method Field\Table table($column, $labelOrCallback, $callback = null)
+ * @method Field\ListField list($column, $label = '')
+ * @method Field\Timezone timezone($column, $label = '')
+ * @method Field\KeyValue keyValue($column, $label = '')
+ * @method Field\Tel tel($column, $label = '')
+ * @method Field\Markdown markdown($column, $label = '')
+ * @method Field\Range range($start, $end, $label = '')
+ * @method Field\Color color($column, $label = '')
+ * @method Field\ArrayField array($column, $labelOrCallback, $callback = null)
+ * @method Field\SelectTable selectTable($column, $label = '')
+ * @method Field\MultipleSelectTable multipleSelectTable($column, $label = '')
+ * @method Field\Button button(string $html = null)
  */
 class Form implements Renderable
 {
@@ -279,9 +279,9 @@ class Form implements Renderable
     /**
      * Create a new form instance.
      *
-     * @param Repository|Model|\Illuminate\Database\Eloquent\Builder|string $model
-     * @param \Closure                                                      $callback
-     * @param Request                                                       $request
+     * @param  Repository|Model|\Illuminate\Database\Eloquent\Builder|string  $model
+     * @param  \Closure  $callback
+     * @param  Request  $request
      */
     public function __construct($repository = null, ?Closure $callback = null, Request $request = null)
     {
@@ -299,8 +299,7 @@ class Form implements Renderable
     /**
      * Create a form instance.
      *
-     * @param mixed ...$params
-     *
+     * @param  mixed  ...$params
      * @return $this
      */
     public static function make(...$params)
@@ -309,8 +308,7 @@ class Form implements Renderable
     }
 
     /**
-     * @param Field $field
-     *
+     * @param  Field  $field
      * @return $this
      */
     public function pushField(Field $field)
@@ -334,8 +332,7 @@ class Form implements Renderable
     /**
      * Get specify field.
      *
-     * @param string|null $name
-     *
+     * @param  string|null  $name
      * @return Field|Collection|Field[]|null
      */
     public function field($name = null)
@@ -353,7 +350,6 @@ class Form implements Renderable
 
     /**
      * @param $column
-     *
      * @return $this
      */
     public function removeField($column)
@@ -364,9 +360,8 @@ class Form implements Renderable
     }
 
     /**
-     * @param string $title
-     * @param string $content
-     *
+     * @param  string  $title
+     * @param  string  $content
      * @return $this
      */
     public function confirm(?string $title = null, ?string $content = null)
@@ -401,8 +396,7 @@ class Form implements Renderable
     }
 
     /**
-     * @param Fluent|array|\Illuminate\Database\Eloquent\Model $model
-     *
+     * @param  Fluent|array|\Illuminate\Database\Eloquent\Model  $model
      * @return Fluent|\Illuminate\Database\Eloquent\Model|void
      */
     public function model($model = null)
@@ -431,8 +425,7 @@ class Form implements Renderable
     /**
      * 启用或禁用ajax表单提交.
      *
-     * @param bool $value
-     *
+     * @param  bool  $value
      * @return $this
      */
     public function ajax(bool $value = true)
@@ -453,8 +446,7 @@ class Form implements Renderable
     /**
      * 设置使用 Toastr 展示字段验证信息.
      *
-     * @param bool $value
-     *
+     * @param  bool  $value
      * @return $this
      */
     public function validationErrorToastr(bool $value = true)
@@ -465,8 +457,7 @@ class Form implements Renderable
     }
 
     /**
-     * @param \Closure $closure
-     *
+     * @param  \Closure  $closure
      * @return $this;
      */
     public function wrap(\Closure $closure)
@@ -512,7 +503,6 @@ class Form implements Renderable
      * Generate a edit form.
      *
      * @param $id
-     *
      * @return $this
      */
     public function edit($id)
@@ -528,9 +518,8 @@ class Form implements Renderable
     /**
      * Add a fieldset to form.
      *
-     * @param string  $title
-     * @param Closure $setCallback
-     *
+     * @param  string  $title
+     * @param  Closure  $setCallback
      * @return Field\Fieldset
      */
     public function fieldset(string $title, Closure $setCallback)
@@ -550,7 +539,6 @@ class Form implements Renderable
      * Destroy data entity and remove files.
      *
      * @param $id
-     *
      * @return mixed
      */
     public function destroy($id)
@@ -604,8 +592,7 @@ class Form implements Renderable
     }
 
     /**
-     * @param \Throwable $e
-     *
+     * @param  \Throwable  $e
      * @return mixed
      */
     protected function handleException(\Throwable $e)
@@ -616,9 +603,8 @@ class Form implements Renderable
     /**
      * Store a new record.
      *
-     * @param array|null    $data
-     * @param string|string $redirectTo
-     *
+     * @param  array|null  $data
+     * @param  string|string  $redirectTo
      * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|\Illuminate\Http\JsonResponse|Response
      */
     public function store(?array $data = null, $redirectTo = null)
@@ -681,8 +667,7 @@ class Form implements Renderable
     /**
      * Before store.
      *
-     * @param array $data
-     *
+     * @param  array  $data
      * @return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse|Response|void
      */
     protected function beforeStore(array $data)
@@ -716,8 +701,7 @@ class Form implements Renderable
     /**
      * Prepare input data for insert or update.
      *
-     * @param array $data
-     *
+     * @param  array  $data
      * @return Response|null
      */
     protected function prepare($data = [])
@@ -734,8 +718,7 @@ class Form implements Renderable
     /**
      * Remove ignored fields from input.
      *
-     * @param array $input
-     *
+     * @param  array  $input
      * @return array
      */
     public function removeIgnoredFields($input)
@@ -748,8 +731,7 @@ class Form implements Renderable
     /**
      * Get or set data for insert or update.
      *
-     * @param array $updates
-     *
+     * @param  array  $updates
      * @return $this|array
      */
     public function updates(array $updates = null)
@@ -766,9 +748,8 @@ class Form implements Renderable
     /**
      * Handle orderable update.
      *
-     * @param int   $id
-     * @param array $input
-     *
+     * @param  int  $id
+     * @param  array  $input
      * @return Response
      */
     protected function handleOrderable(array $input = [])
@@ -794,9 +775,8 @@ class Form implements Renderable
      * Handle update.
      *
      * @param $id
-     * @param array|null  $data
-     * @param string|null $redirectTo
-     *
+     * @param  array|null  $data
+     * @param  string|null  $redirectTo
      * @return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse||Response
      */
     public function update(
@@ -861,8 +841,7 @@ class Form implements Renderable
     /**
      * Before update.
      *
-     * @param array $data
-     *
+     * @param  array  $data
      * @return Response|void
      */
     protected function beforeUpdate($id, array &$data)
@@ -911,8 +890,7 @@ class Form implements Renderable
     }
 
     /**
-     * @param array $inputs
-     *
+     * @param  array  $inputs
      * @return array
      */
     protected function handleHasManyValues(array $inputs)
@@ -941,7 +919,6 @@ class Form implements Renderable
     /**
      * @param $key
      * @param $redirectTo
-     *
      * @return string|null
      */
     public function getRedirectUrl($key, $redirectTo = null)
@@ -977,8 +954,7 @@ class Form implements Renderable
     /**
      * Check if request is from editable.
      *
-     * @param array $input
-     *
+     * @param  array  $input
      * @return bool
      */
     protected function isEditable(array $input = [])
@@ -989,8 +965,7 @@ class Form implements Renderable
     /**
      * Handle editable update.
      *
-     * @param array $input
-     *
+     * @param  array  $input
      * @return array
      */
     protected function handleEditable(array $input = [])
@@ -1009,8 +984,7 @@ class Form implements Renderable
     /**
      * Prepare input data for update.
      *
-     * @param array $updates
-     *
+     * @param  array  $updates
      * @return array
      */
     public function prepareUpdate(array $updates)
@@ -1046,7 +1020,6 @@ class Form implements Renderable
      * Prepare input data for insert.
      *
      * @param $inserts
-     *
      * @return array
      */
     public function prepareInsert($inserts)
@@ -1074,8 +1047,7 @@ class Form implements Renderable
     /**
      * Ignore fields to save.
      *
-     * @param string|array $fields
-     *
+     * @param  string|array  $fields
      * @return $this
      */
     public function ignore($fields)
@@ -1089,7 +1061,6 @@ class Form implements Renderable
 
     /**
      * @param $keys
-     *
      * @return $this
      */
     public function forgetIgnored($keys)
@@ -1138,9 +1109,8 @@ class Form implements Renderable
     }
 
     /**
-     * @param array        $data
-     * @param string|array $columns
-     *
+     * @param  array  $data
+     * @param  string|array  $columns
      * @return array|mixed
      */
     protected function getDataByColumn($data, $columns)
@@ -1196,8 +1166,7 @@ class Form implements Renderable
      *
      *     $form->if(true)->removeField('name');
      *
-     * @param bool|\Closure $condition
-     *
+     * @param  bool|\Closure  $condition
      * @return Condition
      */
     public function if($condition)
@@ -1223,8 +1192,7 @@ class Form implements Renderable
     }
 
     /**
-     * @param array $data
-     *
+     * @param  array  $data
      * @return void
      */
     public function fillFields(array $data)
@@ -1253,8 +1221,7 @@ class Form implements Renderable
     /**
      * Get validation messages.
      *
-     * @param array $input
-     *
+     * @param  array  $input
      * @return MessageBag|bool
      */
     public function validationMessages($input)
@@ -1282,9 +1249,8 @@ class Form implements Renderable
     }
 
     /**
-     * @param string|array|MessageProvider $column
-     * @param string|array                 $messages
-     *
+     * @param  string|array|MessageProvider  $column
+     * @param  string|array  $messages
      * @return $this
      */
     public function responseValidationMessages($column, $messages = null)
@@ -1316,8 +1282,7 @@ class Form implements Renderable
     /**
      * Merge validation messages from input validators.
      *
-     * @param array $validators
-     *
+     * @param  array  $validators
      * @return MessageBag
      */
     protected function mergeValidationMessages($validators)
@@ -1340,8 +1305,7 @@ class Form implements Renderable
     /**
      * Get or set action for form.
      *
-     * @param string|null $action
-     *
+     * @param  string|null  $action
      * @return $this|string
      */
     public function action($action = null)
@@ -1358,9 +1322,8 @@ class Form implements Renderable
     /**
      * Set field and label width in current form.
      *
-     * @param int $fieldWidth
-     * @param int $labelWidth
-     *
+     * @param  int  $fieldWidth
+     * @param  int  $labelWidth
      * @return $this
      */
     public function width($fieldWidth = 8, $labelWidth = 2)
@@ -1378,8 +1341,7 @@ class Form implements Renderable
     /**
      * Set view for form.
      *
-     * @param string $view
-     *
+     * @param  string  $view
      * @return $this
      */
     public function view($view)
@@ -1390,8 +1352,7 @@ class Form implements Renderable
     }
 
     /**
-     * @param array $vars
-     *
+     * @param  array  $vars
      * @return $this
      */
     public function addVariables(array $vars)
@@ -1404,8 +1365,7 @@ class Form implements Renderable
     /**
      * Get or set title for form.
      *
-     * @param string $title
-     *
+     * @param  string  $title
      * @return $this
      */
     public function title($title = null)
@@ -1418,8 +1378,7 @@ class Form implements Renderable
     /**
      * Tools setting for form.
      *
-     * @param Closure|string|AbstractTool|Renderable|Action|array $callback
-     *
+     * @param  Closure|string|AbstractTool|Renderable|Action|array  $callback
      * @return $this;
      */
     public function tools($callback)
@@ -1442,8 +1401,7 @@ class Form implements Renderable
     }
 
     /**
-     * @param bool $disable
-     *
+     * @param  bool  $disable
      * @return $this
      */
     public function disableHeader(bool $disable = true)
@@ -1454,8 +1412,7 @@ class Form implements Renderable
     }
 
     /**
-     * @param bool $disable
-     *
+     * @param  bool  $disable
      * @return $this
      */
     public function disableFooter(bool $disable = true)
@@ -1600,8 +1557,7 @@ class Form implements Renderable
     /**
      * Footer setting for form.
      *
-     * @param Closure $callback
-     *
+     * @param  Closure  $callback
      * @return $this
      */
     public function footer(Closure $callback)
@@ -1614,8 +1570,7 @@ class Form implements Renderable
     /**
      * Get current resource route url.
      *
-     * @param int $slice
-     *
+     * @param  int  $slice
      * @return string
      */
     public function resource($slice = -2)
@@ -1634,8 +1589,7 @@ class Form implements Renderable
     /**
      * Set resource path.
      *
-     * @param string $resource
-     *
+     * @param  string  $resource
      * @return $this
      */
     public function setResource(string $resource)
@@ -1664,9 +1618,8 @@ class Form implements Renderable
     /**
      * Get or set input data.
      *
-     * @param string|array $key
-     * @param mixed        $value
-     *
+     * @param  string|array  $key
+     * @param  mixed  $value
      * @return array|mixed
      */
     public function input($key = null, $value = null)
@@ -1689,8 +1642,7 @@ class Form implements Renderable
     }
 
     /**
-     * @param string|array $keys
-     *
+     * @param  string|array  $keys
      * @return void
      */
     public function deleteInput($keys)
@@ -1699,9 +1651,8 @@ class Form implements Renderable
     }
 
     /**
-     * @param int     $width
-     * @param Closure $callback
-     *
+     * @param  int  $width
+     * @param  Closure  $callback
      * @return $this
      */
     public function block(int $width, \Closure $callback)
@@ -1715,9 +1666,8 @@ class Form implements Renderable
     }
 
     /**
-     * @param int|float $width
-     * @param Closure   $callback
-     *
+     * @param  int|float  $width
+     * @param  Closure  $callback
      * @return $this
      */
     public function column($width, \Closure $callback)
@@ -1740,8 +1690,7 @@ class Form implements Renderable
     }
 
     /**
-     * @param Closure $callback
-     *
+     * @param  Closure  $callback
      * @return bool|void
      */
     public function inDialog(\Closure $callback = null)
@@ -1758,8 +1707,7 @@ class Form implements Renderable
     /**
      * Create a dialog form.
      *
-     * @param string|null $title
-     *
+     * @param  string|null  $title
      * @return DialogForm
      */
     public static function dialog(?string $title = null)
@@ -1770,9 +1718,8 @@ class Form implements Renderable
     /**
      * Register custom field.
      *
-     * @param string $abstract
-     * @param string $class
-     *
+     * @param  string  $abstract
+     * @param  string  $class
      * @return void
      */
     public static function extend($abstract, $class)
@@ -1791,9 +1738,8 @@ class Form implements Renderable
     /**
      * Set form field alias.
      *
-     * @param string $field
-     * @param string $alias
-     *
+     * @param  string  $field
+     * @param  string  $alias
      * @return void
      */
     public static function alias($field, $alias)
@@ -1804,8 +1750,7 @@ class Form implements Renderable
     /**
      * Find field class.
      *
-     * @param string $method
-     *
+     * @param  string  $method
      * @return bool|mixed
      */
     public static function findFieldClass($method)
@@ -1827,8 +1772,7 @@ class Form implements Renderable
     /**
      * Getter.
      *
-     * @param string $name
-     *
+     * @param  string  $name
      * @return array|mixed
      */
     public function __get($name)
@@ -1839,8 +1783,8 @@ class Form implements Renderable
     /**
      * Setter.
      *
-     * @param string $name
-     * @param mixed  $value
+     * @param  string  $name
+     * @param  mixed  $value
      */
     public function __set($name, $value)
     {
@@ -1850,9 +1794,8 @@ class Form implements Renderable
     /**
      * Generate a Field object and add to form builder if Field exists.
      *
-     * @param string $method
-     * @param array  $arguments
-     *
+     * @param  string  $method
+     * @param  array  $arguments
      * @return Field
      */
     public function __call($method, $arguments)

+ 3 - 6
src/Form/AbstractTool.php

@@ -32,8 +32,7 @@ abstract class AbstractTool extends Action
     public $allowOnlyEditing = false;
 
     /**
-     * @param Form $form
-     *
+     * @param  Form  $form
      * @return void
      */
     public function setForm(Form $form)
@@ -80,8 +79,7 @@ abstract class AbstractTool extends Action
     }
 
     /**
-     * @param mixed ...$params
-     *
+     * @param  mixed  ...$params
      * @return $this
      */
     public static function allowOnlyCreating(...$params)
@@ -95,8 +93,7 @@ abstract class AbstractTool extends Action
     }
 
     /**
-     * @param mixed ...$params
-     *
+     * @param  mixed  ...$params
      * @return $this
      */
     public static function allowOnlyEditing(...$params)

+ 2 - 4
src/Form/BlockForm.php

@@ -47,8 +47,7 @@ class BlockForm extends WidgetForm
     /**
      * 设置标题.
      *
-     * @param string $title
-     *
+     * @param  string  $title
      * @return $this
      */
     public function title($title)
@@ -75,8 +74,7 @@ class BlockForm extends WidgetForm
     /**
      * 在当前列增加一块表单.
      *
-     * @param \Closure $callback
-     *
+     * @param  \Closure  $callback
      * @return $this
      */
     public function next(\Closure $callback)

+ 19 - 38
src/Form/Builder.php

@@ -139,7 +139,7 @@ class Builder
     /**
      * Builder constructor.
      *
-     * @param Form $form
+     * @param  Form  $form
      */
     public function __construct(Form $form)
     {
@@ -151,8 +151,7 @@ class Builder
     }
 
     /**
-     * @param \Closure $closure
-     *
+     * @param  \Closure  $closure
      * @return Layout
      */
     public function layout($closure = null)
@@ -165,8 +164,7 @@ class Builder
     }
 
     /**
-     * @param Closure $closure
-     *
+     * @param  Closure  $closure
      * @return $this;
      */
     public function wrap(Closure $closure)
@@ -205,9 +203,8 @@ class Builder
     }
 
     /**
-     * @param string $title
-     * @param string $content
-     *
+     * @param  string  $title
+     * @param  string  $content
      * @return $this
      */
     public function confirm(?string $title = null, ?string $content = null)
@@ -221,8 +218,7 @@ class Builder
     /**
      * Set the builder mode.
      *
-     * @param string $mode
-     *
+     * @param  string  $mode
      * @return void|string
      */
     public function mode(string $mode = null)
@@ -238,7 +234,6 @@ class Builder
      * Returns builder is $mode.
      *
      * @param $mode
-     *
      * @return bool
      */
     public function isMode($mode)
@@ -280,7 +275,6 @@ class Builder
      * Set resource Id.
      *
      * @param $id
-     *
      * @return mixed|void
      */
     public function setResourceId($id)
@@ -312,9 +306,8 @@ class Builder
     }
 
     /**
-     * @param int $field
-     * @param int $label
-     *
+     * @param  int  $field
+     * @param  int  $label
      * @return $this
      */
     public function width($field = 8, $label = 2)
@@ -368,8 +361,7 @@ class Builder
     /**
      * Set view for this form.
      *
-     * @param string $view
-     *
+     * @param  string  $view
      * @return $this
      */
     public function view($view)
@@ -382,8 +374,7 @@ class Builder
     /**
      * Get or set title for form.
      *
-     * @param string $title
-     *
+     * @param  string  $title
      * @return $this|string
      */
     public function title($title = null)
@@ -422,8 +413,7 @@ class Builder
     /**
      * Get specify field.
      *
-     * @param string|Field $name
-     *
+     * @param  string|Field  $name
      * @return Field|null
      */
     public function field($name)
@@ -443,7 +433,6 @@ class Builder
 
     /**
      * @param $column
-     *
      * @return void
      */
     public function removeField($column)
@@ -490,8 +479,7 @@ class Builder
     }
 
     /**
-     * @param Field $field
-     *
+     * @param  Field  $field
      * @return void
      */
     public function addHiddenField(Field $field)
@@ -502,8 +490,7 @@ class Builder
     /**
      * Add or get options.
      *
-     * @param array $options
-     *
+     * @param  array  $options
      * @return array|null
      */
     public function options($options = [])
@@ -518,9 +505,8 @@ class Builder
     /**
      * Get or set option.
      *
-     * @param string $option
-     * @param mixed  $value
-     *
+     * @param  string  $option
+     * @param  mixed  $value
      * @return void
      */
     public function option($option, $value = null)
@@ -533,8 +519,7 @@ class Builder
     }
 
     /**
-     * @param bool $disable
-     *
+     * @param  bool  $disable
      * @return void
      */
     public function disableHeader(bool $disable = true)
@@ -543,8 +528,7 @@ class Builder
     }
 
     /**
-     * @param bool $disable
-     *
+     * @param  bool  $disable
      * @return void
      */
     public function disableFooter(bool $disable = true)
@@ -554,7 +538,6 @@ class Builder
 
     /**
      * @param $id
-     *
      * @return void
      */
     public function setElementId($id)
@@ -619,8 +602,7 @@ class Builder
     /**
      * Open up a new HTML form.
      *
-     * @param array $options
-     *
+     * @param  array  $options
      * @return string
      */
     public function open($options = [])
@@ -802,8 +784,7 @@ class Builder
     }
 
     /**
-     * @param Renderable $view
-     *
+     * @param  Renderable  $view
      * @return string
      */
     protected function doWrap(Renderable $view)

+ 2 - 3
src/Form/Concerns/HandleCascadeFields.php

@@ -7,9 +7,8 @@ use Dcat\Admin\Form\Field;
 trait HandleCascadeFields
 {
     /**
-     * @param array    $dependency
-     * @param \Closure $closure
-     *
+     * @param  array  $dependency
+     * @param  \Closure  $closure
      * @return Field\CascadeGroup
      */
     public function cascadeGroup(\Closure $closure, array $dependency)

+ 27 - 46
src/Form/Concerns/HasEvents.php

@@ -18,8 +18,7 @@ trait HasEvents
     /**
      * 监听创建页面访问事件.
      *
-     * @param Closure $callback
-     *
+     * @param  Closure  $callback
      * @return $this
      */
     public function creating(Closure $callback)
@@ -32,8 +31,7 @@ trait HasEvents
     /**
      * 监听编辑页面访问时间.
      *
-     * @param Closure $callback
-     *
+     * @param  Closure  $callback
      * @return $this
      */
     public function editing(Closure $callback)
@@ -46,8 +44,7 @@ trait HasEvents
     /**
      * 监听提交事件.
      *
-     * @param Closure $callback
-     *
+     * @param  Closure  $callback
      * @return $this
      */
     public function submitted(Closure $callback)
@@ -60,8 +57,7 @@ trait HasEvents
     /**
      * 保存.
      *
-     * @param Closure $callback
-     *
+     * @param  Closure  $callback
      * @return $this
      */
     public function saving(Closure $callback)
@@ -74,8 +70,7 @@ trait HasEvents
     /**
      * 保存完成.
      *
-     * @param Closure $callback
-     *
+     * @param  Closure  $callback
      * @return $this
      */
     public function saved(Closure $callback)
@@ -88,8 +83,7 @@ trait HasEvents
     /**
      * 删除.
      *
-     * @param Closure $callback
-     *
+     * @param  Closure  $callback
      * @return $this
      */
     public function deleting(Closure $callback)
@@ -102,8 +96,7 @@ trait HasEvents
     /**
      * 删除完成.
      *
-     * @param Closure $callback
-     *
+     * @param  Closure  $callback
      * @return $this
      */
     public function deleted(Closure $callback)
@@ -116,8 +109,7 @@ trait HasEvents
     /**
      * 文件上传.
      *
-     * @param \Closure $callback
-     *
+     * @param  \Closure  $callback
      * @return $this
      */
     public function uploading(Closure $callback)
@@ -130,8 +122,7 @@ trait HasEvents
     /**
      * 上传完成.
      *
-     * @param \Closure $callback
-     *
+     * @param  \Closure  $callback
      * @return $this
      */
     public function uploaded(Closure $callback)
@@ -144,8 +135,7 @@ trait HasEvents
     /**
      * 删除文件.
      *
-     * @param \Closure $callback
-     *
+     * @param  \Closure  $callback
      * @return $this
      */
     public function fileDeleting(Closure $callback)
@@ -158,8 +148,7 @@ trait HasEvents
     /**
      * 删除文件完成.
      *
-     * @param \Closure $callback
-     *
+     * @param  \Closure  $callback
      * @return $this
      */
     public function fileDeleted(Closure $callback)
@@ -170,8 +159,7 @@ trait HasEvents
     }
 
     /**
-     * @param \Closure $callback
-     *
+     * @param  \Closure  $callback
      * @return \Closure
      */
     protected function makeListener(Closure $callback)
@@ -238,8 +226,7 @@ trait HasEvents
     /**
      * 触发表单保存完成事件.
      *
-     * @param mixed $result
-     *
+     * @param  mixed  $result
      * @return mixed|null
      */
     protected function callSaved($result)
@@ -260,8 +247,7 @@ trait HasEvents
     /**
      * 触发数据删除完成事件.
      *
-     * @param mixed $result
-     *
+     * @param  mixed  $result
      * @return mixed|null
      */
     protected function callDeleted($result)
@@ -272,9 +258,8 @@ trait HasEvents
     /**
      * 触发文件上传事件.
      *
-     * @param UploadFieldInterface|\Dcat\Admin\Form\Field $field
-     * @param UploadedFile                                $file
-     *
+     * @param  UploadFieldInterface|\Dcat\Admin\Form\Field  $field
+     * @param  UploadedFile  $file
      * @return mixed|null
      */
     protected function callUploading($field, $file)
@@ -285,10 +270,9 @@ trait HasEvents
     /**
      * 触发文件上传完成事件.
      *
-     * @param UploadFieldInterface|\Dcat\Admin\Form\Field $field
-     * @param UploadedFile                                $file
-     * @param Response                                    $response
-     *
+     * @param  UploadFieldInterface|\Dcat\Admin\Form\Field  $field
+     * @param  UploadedFile  $file
+     * @param  Response  $response
      * @return \Illuminate\Http\Response|\Symfony\Component\HttpFoundation\RedirectResponse|void
      */
     protected function callUploaded($field, $file, $response)
@@ -299,10 +283,9 @@ trait HasEvents
     /**
      * 触发文件删除事件.
      *
-     * @param UploadFieldInterface|\Dcat\Admin\Form\Field $field
-     * @param UploadedFile                                $file
-     * @param Response                                    $response
-     *
+     * @param  UploadFieldInterface|\Dcat\Admin\Form\Field  $field
+     * @param  UploadedFile  $file
+     * @param  Response  $response
      * @return \Illuminate\Http\Response|\Symfony\Component\HttpFoundation\RedirectResponse|void
      */
     protected function callFileDeleting($field)
@@ -313,10 +296,9 @@ trait HasEvents
     /**
      * 触发文件删除完成事件.
      *
-     * @param UploadFieldInterface|\Dcat\Admin\Form\Field $field
-     * @param UploadedFile                                $file
-     * @param Response                                    $response
-     *
+     * @param  UploadFieldInterface|\Dcat\Admin\Form\Field  $field
+     * @param  UploadedFile  $file
+     * @param  Response  $response
      * @return \Illuminate\Http\Response|\Symfony\Component\HttpFoundation\RedirectResponse|void
      */
     protected function callFileDeleted($field)
@@ -325,9 +307,8 @@ trait HasEvents
     }
 
     /**
-     * @param string $name
-     * @param array  $payload
-     *
+     * @param  string  $name
+     * @param  array  $payload
      * @return RedirectResponse|\Illuminate\Http\Response|void
      */
     protected function fire($name, array $payload = [])

+ 23 - 42
src/Form/Concerns/HasFieldValidator.php

@@ -50,9 +50,8 @@ trait HasFieldValidator
     /**
      * Set the update validation rules for the field.
      *
-     * @param array|callable|string $rules
-     * @param array                 $messages
-     *
+     * @param  array|callable|string  $rules
+     * @param  array  $messages
      * @return $this
      */
     public function updateRules($rules = null, $messages = [])
@@ -69,9 +68,8 @@ trait HasFieldValidator
     /**
      * Set the creation validation rules for the field.
      *
-     * @param array|callable|string $rules
-     * @param array                 $messages
-     *
+     * @param  array|callable|string  $rules
+     * @param  array  $messages
      * @return $this
      */
     public function creationRules($rules = null, $messages = [])
@@ -88,9 +86,8 @@ trait HasFieldValidator
     /**
      * Get or set rules.
      *
-     * @param null  $rules
-     * @param array $messages
-     *
+     * @param  null  $rules
+     * @param  array  $messages
      * @return $this
      */
     public function rules($rules = null, $messages = [])
@@ -159,8 +156,7 @@ trait HasFieldValidator
     /**
      * Format validation rules.
      *
-     * @param array|string $rules
-     *
+     * @param  array|string  $rules
      * @return array
      */
     protected function formatRules($rules)
@@ -173,9 +169,8 @@ trait HasFieldValidator
     }
 
     /**
-     * @param string|array|\Closure $input
-     * @param string|array          $original
-     *
+     * @param  string|array|\Closure  $input
+     * @param  string|array  $original
      * @return array|\Closure
      */
     protected function mergeRules($input, $original)
@@ -193,8 +188,7 @@ trait HasFieldValidator
     }
 
     /**
-     * @param string $rule
-     *
+     * @param  string  $rule
      * @return $this
      */
     public function removeUpdateRule($rule)
@@ -205,8 +199,7 @@ trait HasFieldValidator
     }
 
     /**
-     * @param string $rule
-     *
+     * @param  string  $rule
      * @return $this
      */
     public function removeCreationRule($rule)
@@ -219,8 +212,7 @@ trait HasFieldValidator
     /**
      * Remove a specific rule by keyword.
      *
-     * @param string $rule
-     *
+     * @param  string  $rule
      * @return $this
      */
     public function removeRule($rule)
@@ -233,7 +225,6 @@ trait HasFieldValidator
     /**
      * @param $rules
      * @param $rule
-     *
      * @return void
      */
     protected function deleteRuleByKeyword(&$rules, $rule)
@@ -254,8 +245,7 @@ trait HasFieldValidator
     }
 
     /**
-     * @param string $rule
-     *
+     * @param  string  $rule
      * @return bool
      */
     public function hasUpdateRule($rule)
@@ -264,8 +254,7 @@ trait HasFieldValidator
     }
 
     /**
-     * @param string $rule
-     *
+     * @param  string  $rule
      * @return bool
      */
     public function hasCreationRule($rule)
@@ -274,8 +263,7 @@ trait HasFieldValidator
     }
 
     /**
-     * @param string $rule
-     *
+     * @param  string  $rule
      * @return bool
      */
     public function hasRule($rule)
@@ -284,8 +272,7 @@ trait HasFieldValidator
     }
 
     /**
-     * @param string $rule
-     *
+     * @param  string  $rule
      * @return bool|mixed
      */
     protected function getRule($rule)
@@ -318,7 +305,6 @@ trait HasFieldValidator
     /**
      * @param $rules
      * @param $rule
-     *
      * @return bool
      */
     protected function isRuleExists($rules, $rule)
@@ -347,8 +333,7 @@ trait HasFieldValidator
     /**
      * Set field validator.
      *
-     * @param callable $validator
-     *
+     * @param  callable  $validator
      * @return $this
      */
     public function validator(callable $validator)
@@ -361,8 +346,7 @@ trait HasFieldValidator
     /**
      * Get validator for this field.
      *
-     * @param array $input
-     *
+     * @param  array  $input
      * @return bool|Validator
      */
     public function getValidator(array $input)
@@ -406,9 +390,8 @@ trait HasFieldValidator
     /**
      * Set validation messages for column.
      *
-     * @param string $key
-     * @param array  $messages
-     *
+     * @param  string  $key
+     * @param  array  $messages
      * @return $this
      */
     public function setValidationMessages($key, array $messages)
@@ -462,9 +445,8 @@ trait HasFieldValidator
      *
      * @see http://1000hz.github.io/bootstrap-validator/
      *
-     * @param string $error
-     * @param string $key
-     *
+     * @param  string  $error
+     * @param  string  $key
      * @return $this
      */
     public function setClientValidationError(string $error, string $key = null)
@@ -475,8 +457,7 @@ trait HasFieldValidator
     }
 
     /**
-     * @param MessageBag $messageBag
-     *
+     * @param  MessageBag  $messageBag
      * @return MessageBag
      */
     public function formatValidatorMessages($messageBag)

+ 10 - 15
src/Form/Concerns/HasFiles.php

@@ -19,8 +19,7 @@ trait HasFiles
     /**
      * 文件上传操作.
      *
-     * @param array $data
-     *
+     * @param  array  $data
      * @return Response|void
      */
     protected function handleUploadFile($data)
@@ -61,8 +60,7 @@ trait HasFiles
     /**
      * 根据字段名称查找字段.
      *
-     * @param string|null $column
-     *
+     * @param  string|null  $column
      * @return Field|null
      */
     public function findFieldByName(?string $column)
@@ -73,8 +71,7 @@ trait HasFiles
     /**
      * 新增页面删除文件.
      *
-     * @param array $input
-     *
+     * @param  array  $input
      * @return \Illuminate\Http\JsonResponse
      */
     protected function deleteFileWhenCreating(array $input)
@@ -110,8 +107,8 @@ trait HasFiles
     /**
      * 删除文件.
      *
-     * @param UploadFieldInterface|Field $field
-     * @param array                      $input
+     * @param  UploadFieldInterface|Field  $field
+     * @param  array  $input
      */
     protected function deleteFile(UploadFieldInterface $field, $input = null)
     {
@@ -138,9 +135,8 @@ trait HasFiles
     /**
      * 获取hasMany的子表单字段.
      *
-     * @param string $relation
-     * @param string $column
-     *
+     * @param  string  $relation
+     * @param  string  $column
      * @return mixed
      */
     public function getFieldByRelationName($relation, $column)
@@ -157,8 +153,8 @@ trait HasFiles
     /**
      * 根据传入数据删除文件.
      *
-     * @param array $input
-     * @param bool  $forceDelete
+     * @param  array  $input
+     * @param  bool  $forceDelete
      */
     public function deleteFiles($input, $forceDelete = false)
     {
@@ -178,8 +174,7 @@ trait HasFiles
     }
 
     /**
-     * @param array $input
-     *
+     * @param  array  $input
      * @return array
      */
     protected function handleFileDelete(array $input = [])

+ 2 - 3
src/Form/Concerns/HasLayout.php

@@ -13,9 +13,8 @@ trait HasLayout
     protected $layout;
 
     /**
-     * @param int|float $width
-     * @param Closure   $callback
-     *
+     * @param  int|float  $width
+     * @param  Closure  $callback
      * @return $this
      */
     public function column($width, Closure $callback)

+ 1 - 2
src/Form/Concerns/HasRows.php

@@ -17,8 +17,7 @@ trait HasRows
     /**
      * Add a row in form.
      *
-     * @param Closure $callback
-     *
+     * @param  Closure  $callback
      * @return $this
      */
     public function row(Closure $callback)

+ 2 - 3
src/Form/Concerns/HasTabs.php

@@ -15,9 +15,8 @@ trait HasTabs
     /**
      * Use tab to split form.
      *
-     * @param string  $title
-     * @param Closure $content
-     *
+     * @param  string  $title
+     * @param  Closure  $content
      * @return $this
      */
     public function tab($title, Closure $content, $active = false)

+ 65 - 74
src/Form/EmbeddedForm.php

@@ -10,59 +10,59 @@ use Illuminate\Support\Collection;
 /**
  * Class EmbeddedForm.
  *
- * @method Field\Text                   text($column, $label = '')
- * @method Field\Checkbox               checkbox($column, $label = '')
- * @method Field\Radio                  radio($column, $label = '')
- * @method Field\Select                 select($column, $label = '')
- * @method Field\MultipleSelect         multipleSelect($column, $label = '')
- * @method Field\Textarea               textarea($column, $label = '')
- * @method Field\Hidden                 hidden($column, $label = '')
- * @method Field\Id                     id($column, $label = '')
- * @method Field\Ip                     ip($column, $label = '')
- * @method Field\Url                    url($column, $label = '')
- * @method Field\Email                  email($column, $label = '')
- * @method Field\Mobile                 mobile($column, $label = '')
- * @method Field\Slider                 slider($column, $label = '')
- * @method Field\Map                    map($latitude, $longitude, $label = '')
- * @method Field\Editor                 editor($column, $label = '')
- * @method Field\Date                   date($column, $label = '')
- * @method Field\Datetime               datetime($column, $label = '')
- * @method Field\Time                   time($column, $label = '')
- * @method Field\Year                   year($column, $label = '')
- * @method Field\Month                  month($column, $label = '')
- * @method Field\DateRange              dateRange($start, $end, $label = '')
- * @method Field\DateTimeRange          datetimeRange($start, $end, $label = '')
- * @method Field\TimeRange              timeRange($start, $end, $label = '')
- * @method Field\Number                 number($column, $label = '')
- * @method Field\Currency               currency($column, $label = '')
- * @method Field\SwitchField            switch($column, $label = '')
- * @method Field\Display                display($column, $label = '')
- * @method Field\Rate                   rate($column, $label = '')
- * @method Field\Divide                 divider(string $title = null)
- * @method Field\Password               password($column, $label = '')
- * @method Field\Decimal                decimal($column, $label = '')
- * @method Field\Html                   html($html, $label = '')
- * @method Field\Tags                   tags($column, $label = '')
- * @method Field\Icon                   icon($column, $label = '')
- * @method Field\Embeds                 embeds($column, $label = '')
- * @method Field\Captcha                captcha()
- * @method Field\Listbox                listbox($column, $label = '')
- * @method Field\File                   file($column, $label = '')
- * @method Field\Image                  image($column, $label = '')
- * @method Field\MultipleFile           multipleFile($column, $label = '')
- * @method Field\MultipleImage          multipleImage($column, $label = '')
- * @method Field\Tree                   tree($column, $label = '')
- * @method Field\Table                  table($column, $labelOrCallback, $callback = null)
- * @method Field\ListField              list($column, $label = '')
- * @method Field\Timezone               timezone($column, $label = '')
- * @method Field\KeyValue               keyValue($column, $label = '')
- * @method Field\Tel                    tel($column, $label = '')
- * @method Field\Markdown               markdown($column, $label = '')
- * @method Field\Range                  range($start, $end, $label = '')
- * @method Field\Color                  color($column, $label = '')
- * @method Field\ArrayField             array($column, $labelOrCallback, $callback = null)
- * @method Field\SelectTable            selectTable($column, $label = '')
- * @method Field\MultipleSelectTable    multipleSelectTable($column, $label = '')
+ * @method Field\Text text($column, $label = '')
+ * @method Field\Checkbox checkbox($column, $label = '')
+ * @method Field\Radio radio($column, $label = '')
+ * @method Field\Select select($column, $label = '')
+ * @method Field\MultipleSelect multipleSelect($column, $label = '')
+ * @method Field\Textarea textarea($column, $label = '')
+ * @method Field\Hidden hidden($column, $label = '')
+ * @method Field\Id id($column, $label = '')
+ * @method Field\Ip ip($column, $label = '')
+ * @method Field\Url url($column, $label = '')
+ * @method Field\Email email($column, $label = '')
+ * @method Field\Mobile mobile($column, $label = '')
+ * @method Field\Slider slider($column, $label = '')
+ * @method Field\Map map($latitude, $longitude, $label = '')
+ * @method Field\Editor editor($column, $label = '')
+ * @method Field\Date date($column, $label = '')
+ * @method Field\Datetime datetime($column, $label = '')
+ * @method Field\Time time($column, $label = '')
+ * @method Field\Year year($column, $label = '')
+ * @method Field\Month month($column, $label = '')
+ * @method Field\DateRange dateRange($start, $end, $label = '')
+ * @method Field\DateTimeRange datetimeRange($start, $end, $label = '')
+ * @method Field\TimeRange timeRange($start, $end, $label = '')
+ * @method Field\Number number($column, $label = '')
+ * @method Field\Currency currency($column, $label = '')
+ * @method Field\SwitchField switch($column, $label = '')
+ * @method Field\Display display($column, $label = '')
+ * @method Field\Rate rate($column, $label = '')
+ * @method Field\Divide divider(string $title = null)
+ * @method Field\Password password($column, $label = '')
+ * @method Field\Decimal decimal($column, $label = '')
+ * @method Field\Html html($html, $label = '')
+ * @method Field\Tags tags($column, $label = '')
+ * @method Field\Icon icon($column, $label = '')
+ * @method Field\Embeds embeds($column, $label = '')
+ * @method Field\Captcha captcha()
+ * @method Field\Listbox listbox($column, $label = '')
+ * @method Field\File file($column, $label = '')
+ * @method Field\Image image($column, $label = '')
+ * @method Field\MultipleFile multipleFile($column, $label = '')
+ * @method Field\MultipleImage multipleImage($column, $label = '')
+ * @method Field\Tree tree($column, $label = '')
+ * @method Field\Table table($column, $labelOrCallback, $callback = null)
+ * @method Field\ListField list($column, $label = '')
+ * @method Field\Timezone timezone($column, $label = '')
+ * @method Field\KeyValue keyValue($column, $label = '')
+ * @method Field\Tel tel($column, $label = '')
+ * @method Field\Markdown markdown($column, $label = '')
+ * @method Field\Range range($start, $end, $label = '')
+ * @method Field\Color color($column, $label = '')
+ * @method Field\ArrayField array($column, $labelOrCallback, $callback = null)
+ * @method Field\SelectTable selectTable($column, $label = '')
+ * @method Field\MultipleSelectTable multipleSelectTable($column, $label = '')
  */
 class EmbeddedForm
 {
@@ -97,7 +97,7 @@ class EmbeddedForm
     /**
      * EmbeddedForm constructor.
      *
-     * @param string $column
+     * @param  string  $column
      */
     public function __construct($column)
     {
@@ -119,8 +119,7 @@ class EmbeddedForm
     /**
      * Set parent form for this form.
      *
-     * @param Form $parent
-     *
+     * @param  Form  $parent
      * @return $this
      */
     public function setParent($parent)
@@ -143,8 +142,7 @@ class EmbeddedForm
     /**
      * Set original values for fields.
      *
-     * @param array $data
-     *
+     * @param  array  $data
      * @return $this
      */
     public function setOriginal($data)
@@ -165,8 +163,7 @@ class EmbeddedForm
     /**
      * Prepare for insert or update.
      *
-     * @param array $input
-     *
+     * @param  array  $input
      * @return mixed
      */
     public function prepare($input)
@@ -182,9 +179,8 @@ class EmbeddedForm
     /**
      * Do prepare work for each field.
      *
-     * @param string $key
-     * @param string $record
-     *
+     * @param  string  $key
+     * @param  string  $record
      * @return mixed
      */
     protected function prepareValue($key, $record)
@@ -203,8 +199,7 @@ class EmbeddedForm
     /**
      * Set original data for each field.
      *
-     * @param string $key
-     *
+     * @param  string  $key
      * @return void
      */
     protected function setFieldOriginalValue($key)
@@ -221,8 +216,7 @@ class EmbeddedForm
     /**
      * Fill data to all fields in form.
      *
-     * @param array $data
-     *
+     * @param  array  $data
      * @return $this
      */
     public function fill(array $data)
@@ -237,8 +231,7 @@ class EmbeddedForm
     /**
      * Format form, set `element name` `error key` and `element class`.
      *
-     * @param Field $field
-     *
+     * @param  Field  $field
      * @return Field
      */
     protected function formatField(Field $field)
@@ -279,8 +272,7 @@ class EmbeddedForm
     /**
      * Add a field to form.
      *
-     * @param Field $field
-     *
+     * @param  Field  $field
      * @return $this
      */
     public function pushField(Field $field)
@@ -299,9 +291,8 @@ class EmbeddedForm
     /**
      * Add nested-form fields dynamically.
      *
-     * @param string $method
-     * @param array  $arguments
-     *
+     * @param  string  $method
+     * @param  array  $arguments
      * @return Field|$this
      */
     public function __call($method, $arguments)

+ 62 - 108
src/Form/Field.php

@@ -228,8 +228,8 @@ class Field implements Renderable
     /**
      * Field constructor.
      *
-     * @param string|array $column
-     * @param array        $arguments
+     * @param  string|array  $column
+     * @param  array  $arguments
      */
     public function __construct($column, $arguments = [])
     {
@@ -240,8 +240,7 @@ class Field implements Renderable
     }
 
     /**
-     * @param array $options
-     *
+     * @param  array  $options
      * @return $this
      */
     public function setRelation(array $options = [])
@@ -252,8 +251,7 @@ class Field implements Renderable
     /**
      * Format the label value.
      *
-     * @param array $arguments
-     *
+     * @param  array  $arguments
      * @return string
      */
     protected function formatLabel($arguments = [])
@@ -270,8 +268,7 @@ class Field implements Renderable
     /**
      * Format the name of the field.
      *
-     * @param string $column
-     *
+     * @param  string  $column
      * @return array|mixed|string
      */
     protected function formatName($column)
@@ -282,8 +279,7 @@ class Field implements Renderable
     /**
      * Set form element name.
      *
-     * @param string|array $name
-     *
+     * @param  string|array  $name
      * @return $this
      *
      * @author Edwin Hui
@@ -308,8 +304,7 @@ class Field implements Renderable
     /**
      * Fill data to the field.
      *
-     * @param array $data
-     *
+     * @param  array  $data
      * @return void
      */
     final public function fill($data)
@@ -326,8 +321,7 @@ class Field implements Renderable
     /**
      * Format field data.
      *
-     * @param array $data
-     *
+     * @param  array  $data
      * @return mixed
      */
     protected function formatFieldData($data)
@@ -346,10 +340,9 @@ class Field implements Renderable
     }
 
     /**
-     * @param array $data
-     * @param string $column
-     * @param mixed $default
-     *
+     * @param  array  $data
+     * @param  string  $column
+     * @param  mixed  $default
      * @return mixed
      */
     protected function getValueFromData($data, $column = null, $default = null)
@@ -371,8 +364,7 @@ class Field implements Renderable
     /**
      * custom format form column data when edit.
      *
-     * @param \Closure $call
-     *
+     * @param  \Closure  $call
      * @return $this
      */
     public function customFormat(\Closure $call)
@@ -385,8 +377,7 @@ class Field implements Renderable
     /**
      * Set original value to the field.
      *
-     * @param array $data
-     *
+     * @param  array  $data
      * @return void
      */
     final public function setOriginal($data)
@@ -399,8 +390,8 @@ class Field implements Renderable
     }
 
     /**
-     * @param string      $key
-     * @param Fluent|null $dataremoveField
+     * @param  string  $key
+     * @param  Fluent|null  $dataremoveField
      */
     protected function callCustomFormatter($key = 'value', Fluent $data = null)
     {
@@ -416,8 +407,7 @@ class Field implements Renderable
     }
 
     /**
-     * @param Form|WidgetForm $form
-     *
+     * @param  Form|WidgetForm  $form
      * @return $this
      */
     public function setForm($form = null)
@@ -428,8 +418,7 @@ class Field implements Renderable
     }
 
     /**
-     * @param WidgetForm $form
-     *
+     * @param  WidgetForm  $form
      * @return $this
      */
     public function setParent($form = null)
@@ -450,9 +439,8 @@ class Field implements Renderable
     /**
      * Set width for field and label.
      *
-     * @param int $field
-     * @param int $label
-     *
+     * @param  int  $field
+     * @param  int  $label
      * @return $this
      */
     public function width($field = 8, $label = 2)
@@ -468,8 +456,7 @@ class Field implements Renderable
     /**
      * Set the field options.
      *
-     * @param array $options
-     *
+     * @param  array  $options
      * @return $this
      */
     public function options($options = [])
@@ -484,8 +471,7 @@ class Field implements Renderable
     }
 
     /**
-     * @param array $options
-     *
+     * @param  array  $options
      * @return $this
      */
     public function replaceOptions($options)
@@ -500,8 +486,7 @@ class Field implements Renderable
     }
 
     /**
-     * @param array|Arrayable $options
-     *
+     * @param  array|Arrayable  $options
      * @return $this
      */
     public function mergeOptions($options)
@@ -512,8 +497,7 @@ class Field implements Renderable
     /**
      * Set the field option checked.
      *
-     * @param array $checked
-     *
+     * @param  array  $checked
      * @return $this
      */
     public function checked($checked = [])
@@ -530,8 +514,7 @@ class Field implements Renderable
     /**
      * Set key for error message.
      *
-     * @param string|array $key
-     *
+     * @param  string|array  $key
      * @return $this
      */
     public function setErrorKey($key)
@@ -554,8 +537,7 @@ class Field implements Renderable
     /**
      * Set or get value of the field.
      *
-     * @param null $value
-     *
+     * @param  null  $value
      * @return mixed|$this
      */
     public function value($value = null)
@@ -579,8 +561,7 @@ class Field implements Renderable
     /**
      * Set or get data.
      *
-     * @param array $data
-     *
+     * @param  array  $data
      * @return $this|Fluent
      */
     public function data(array $data = null)
@@ -601,9 +582,8 @@ class Field implements Renderable
     /**
      * Get or set default value for field.
      *
-     * @param mixed $default
-     * @param bool  $edit
-     *
+     * @param  mixed  $default
+     * @param  bool  $edit
      * @return $this|mixed
      */
     public function default($default = null, bool $edit = false)
@@ -636,9 +616,8 @@ class Field implements Renderable
     /**
      * Set help block for current field.
      *
-     * @param string $text
-     * @param string $icon
-     *
+     * @param  string  $text
+     * @param  string  $icon
      * @return $this
      */
     public function help($text = '', $icon = 'feather icon-help-circle')
@@ -661,8 +640,7 @@ class Field implements Renderable
     /**
      * Get or set label of the field.
      *
-     * @param null $label
-     *
+     * @param  null  $label
      * @return $this|string
      */
     public function label($label = null)
@@ -693,9 +671,8 @@ class Field implements Renderable
     /**
      * Sanitize input data.
      *
-     * @param array  $input
-     * @param string $column
-     *
+     * @param  array  $input
+     * @param  string  $column
      * @return array
      */
     protected function sanitizeInput($input, $column)
@@ -711,9 +688,8 @@ class Field implements Renderable
     /**
      * Add html attributes to elements.
      *
-     * @param array|string $attribute
-     * @param mixed        $value
-     *
+     * @param  array|string  $attribute
+     * @param  mixed  $value
      * @return $this
      */
     public function attribute($attribute, $value = null)
@@ -728,8 +704,7 @@ class Field implements Renderable
     }
 
     /**
-     * @param string $key
-     *
+     * @param  string  $key
      * @return bool
      */
     public function hasAttribute(string $key)
@@ -738,8 +713,7 @@ class Field implements Renderable
     }
 
     /**
-     * @param string $key
-     *
+     * @param  string  $key
      * @return mixed|null
      */
     public function getAttribute(string $key)
@@ -750,9 +724,8 @@ class Field implements Renderable
     /**
      * Specifies a regular expression against which to validate the value of the input.
      *
-     * @param string $error
-     * @param string $regexp
-     *
+     * @param  string  $error
+     * @param  string  $regexp
      * @return $this
      */
     public function pattern($regexp, $error = null)
@@ -767,8 +740,7 @@ class Field implements Renderable
     /**
      * set the input filed required.
      *
-     * @param bool $isLabelAsterisked
-     *
+     * @param  bool  $isLabelAsterisked
      * @return $this
      */
     public function required($isLabelAsterisked = true)
@@ -785,8 +757,7 @@ class Field implements Renderable
     /**
      * Set the field automatically get focus.
      *
-     * @param bool $value
-     *
+     * @param  bool  $value
      * @return $this
      */
     public function autofocus(bool $value = true)
@@ -797,8 +768,7 @@ class Field implements Renderable
     /**
      * Set the field as readonly mode.
      *
-     * @param bool $value
-     *
+     * @param  bool  $value
      * @return $this
      */
     public function readOnly(bool $value = true)
@@ -815,8 +785,7 @@ class Field implements Renderable
     /**
      * Set field as disabled.
      *
-     * @param bool $value
-     *
+     * @param  bool  $value
      * @return $this
      */
     public function disable(bool $value = true)
@@ -833,8 +802,7 @@ class Field implements Renderable
     /**
      * Get or set field placeholder.
      *
-     * @param string $placeholder
-     *
+     * @param  string  $placeholder
      * @return $this|string
      */
     public function placeholder($placeholder = null)
@@ -857,8 +825,7 @@ class Field implements Renderable
     }
 
     /**
-     * @param mixed $value
-     *
+     * @param  mixed  $value
      * @return mixed
      */
     protected function prepareInputValue($value)
@@ -867,8 +834,7 @@ class Field implements Renderable
     }
 
     /**
-     * @param \Closure $closure
-     *
+     * @param  \Closure  $closure
      * @return $this
      */
     public function saving(\Closure $closure)
@@ -881,8 +847,7 @@ class Field implements Renderable
     /**
      * Prepare for a field value before update or insert.
      *
-     * @param mixed $value
-     *
+     * @param  mixed  $value
      * @return mixed
      */
     final public function prepare($value)
@@ -915,8 +880,7 @@ class Field implements Renderable
     }
 
     /**
-     * @param bool $value
-     *
+     * @param  bool  $value
      * @return $this
      */
     public function horizontal(bool $value = true)
@@ -949,9 +913,8 @@ class Field implements Renderable
     /**
      * Set element class.
      *
-     * @param string|array $class
-     * @param bool $normalize
-     *
+     * @param  string|array  $class
+     * @param  bool  $normalize
      * @return $this
      */
     public function setElementClass($class, bool $normalize = true)
@@ -968,9 +931,8 @@ class Field implements Renderable
     /**
      * Add element class.
      *
-     * @param string|array $class
-     * @param bool $normalize
-     *
+     * @param  string|array  $class
+     * @param  bool  $normalize
      * @return $this
      */
     public function addElementClass($class, bool $normalize = false)
@@ -1005,8 +967,7 @@ class Field implements Renderable
     }
 
     /**
-     * @param string|array $class
-     *
+     * @param  string|array  $class
      * @return array|string
      */
     public function normalizeElementClass($class)
@@ -1092,7 +1053,6 @@ class Field implements Renderable
      * Remove element class.
      *
      * @param $class
-     *
      * @return $this
      */
     public function removeElementClass($class)
@@ -1103,9 +1063,8 @@ class Field implements Renderable
     }
 
     /**
-     * @param array|string $labelClass
-     * @param bool         $append
-     *
+     * @param  array|string  $labelClass
+     * @param  bool  $append
      * @return $this|string
      */
     public function setLabelClass($labelClass, bool $append = true)
@@ -1128,7 +1087,6 @@ class Field implements Renderable
     /**
      * @param  mixed  $value
      * @param  callable  $callback
-     *
      * @return $this|mixed
      */
     public function when($value, $callback)
@@ -1141,9 +1099,8 @@ class Field implements Renderable
     }
 
     /**
-     * @param string|array $class
-     * @param bool         $append
-     *
+     * @param  string|array  $class
+     * @param  bool  $append
      * @return $this
      */
     public function setFormGroupClass($class, bool $append = true)
@@ -1164,9 +1121,8 @@ class Field implements Renderable
     }
 
     /**
-     * @param string|array $class
-     * @param bool         $append
-     *
+     * @param  string|array  $class
+     * @param  bool  $append
      * @return $this
      */
     public function setFieldClass($class, bool $append = true)
@@ -1277,9 +1233,8 @@ class Field implements Renderable
     /**
      * 设置默认属性.
      *
-     * @param string $attribute
-     * @param mixed  $value
-     *
+     * @param  string  $attribute
+     * @param  mixed  $value
      * @return $this
      */
     public function defaultAttribute(string $attribute, $value)
@@ -1304,8 +1259,7 @@ class Field implements Renderable
     /**
      * 保存数据为json格式.
      *
-     * @param int $option
-     *
+     * @param  int  $option
      * @return $this
      */
     public function saveAsJson($option = 0)

+ 6 - 8
src/Form/Field/CanCascadeFields.php

@@ -26,7 +26,6 @@ trait CanCascadeFields
      * @param $operator
      * @param $value
      * @param $closure
-     *
      * @return $this
      */
     public function when($operator, $value, $closure = null)
@@ -54,8 +53,8 @@ trait CanCascadeFields
     }
 
     /**
-     * @param string $operator
-     * @param mixed  $value
+     * @param  string  $operator
+     * @param  mixed  $value
      */
     protected function formatValues(string $operator, &$value)
     {
@@ -71,9 +70,9 @@ trait CanCascadeFields
     }
 
     /**
-     * @param string   $operator
-     * @param mixed    $value
-     * @param \Closure $closure
+     * @param  string  $operator
+     * @param  mixed  $value
+     * @param  \Closure  $closure
      */
     protected function addDependents(string $operator, $value, \Closure $closure)
     {
@@ -87,8 +86,7 @@ trait CanCascadeFields
     }
 
     /**
-     * @param mixed $value
-     *
+     * @param  mixed  $value
      * @return string
      */
     protected function getCascadeClass($value, string $operator)

+ 8 - 10
src/Form/Field/CanLoadFields.php

@@ -9,11 +9,10 @@ trait CanLoadFields
     /**
      * 联动加载.
      *
-     * @param string $field
-     * @param string $sourceUrl
-     * @param string $idField
-     * @param string $textField
-     *
+     * @param  string  $field
+     * @param  string  $sourceUrl
+     * @param  string  $idField
+     * @param  string  $textField
      * @return $this
      */
     public function load($field, $sourceUrl, string $idField = 'id', string $textField = 'text')
@@ -24,11 +23,10 @@ trait CanLoadFields
     /**
      * 联动加载多个字段.
      *
-     * @param array|string $fields
-     * @param array|string $sourceUrls
-     * @param string $idField
-     * @param string $textField
-     *
+     * @param  array|string  $fields
+     * @param  array|string  $sourceUrls
+     * @param  string  $idField
+     * @param  string  $textField
      * @return $this
      */
     public function loads($fields = [], $sourceUrls = [], string $idField = 'id', string $textField = 'text')

+ 2 - 3
src/Form/Field/CascadeGroup.php

@@ -19,7 +19,7 @@ class CascadeGroup extends Field
     /**
      * CascadeGroup constructor.
      *
-     * @param array $dependency
+     * @param  array  $dependency
      */
     public function __construct(array $dependency)
     {
@@ -27,8 +27,7 @@ class CascadeGroup extends Field
     }
 
     /**
-     * @param Field $field
-     *
+     * @param  Field  $field
      * @return bool
      */
     public function dependsOn(Field $field)

+ 2 - 4
src/Form/Field/Checkbox.php

@@ -20,8 +20,7 @@ class Checkbox extends MultipleSelect
     protected $inline = true;
 
     /**
-     * @param array|\Closure|string $options
-     *
+     * @param  array|\Closure|string  $options
      * @return $this|mixed
      */
     public function options($options = [])
@@ -40,8 +39,7 @@ class Checkbox extends MultipleSelect
     /**
      * "info", "primary", "inverse", "danger", "success", "purple".
      *
-     * @param string $style
-     *
+     * @param  string  $style
      * @return $this
      */
     public function style(string $style)

+ 3 - 6
src/Form/Field/Currency.php

@@ -22,8 +22,7 @@ class Currency extends Text
     /**
      * Set symbol for currency field.
      *
-     * @param string $symbol
-     *
+     * @param  string  $symbol
      * @return $this
      */
     public function symbol($symbol)
@@ -36,8 +35,7 @@ class Currency extends Text
     /**
      * Set digits for input number.
      *
-     * @param int $digits
-     *
+     * @param  int  $digits
      * @return $this
      */
     public function digits($digits)
@@ -46,8 +44,7 @@ class Currency extends Text
     }
 
     /**
-     * @param mixed $value
-     *
+     * @param  mixed  $value
      * @return mixed
      */
     protected function prepareInputValue($value)

+ 6 - 12
src/Form/Field/Editor.php

@@ -45,8 +45,7 @@ class Editor extends Field
     /**
      * 设置文件上传存储配置.
      *
-     * @param string $disk
-     *
+     * @param  string  $disk
      * @return $this
      */
     public function disk(string $disk)
@@ -59,8 +58,7 @@ class Editor extends Field
     /**
      * 设置图片上传文件夹.
      *
-     * @param string $dir
-     *
+     * @param  string  $dir
      * @return $this
      */
     public function imageDirectory(string $dir)
@@ -73,8 +71,7 @@ class Editor extends Field
     /**
      * 自定义图片上传接口.
      *
-     * @param string $url
-     *
+     * @param  string  $url
      * @return $this
      */
     public function imageUrl(string $url)
@@ -85,8 +82,7 @@ class Editor extends Field
     /**
      * 设置语言包url.
      *
-     * @param string $url
-     *
+     * @param  string  $url
      * @return $this
      */
     public function languageUrl(string $url)
@@ -97,8 +93,7 @@ class Editor extends Field
     /**
      * 设置编辑器高度.
      *
-     * @param int $height
-     *
+     * @param  int  $height
      * @return $this
      */
     public function height(int $height)
@@ -130,8 +125,7 @@ class Editor extends Field
     }
 
     /**
-     * @param string $url
-     *
+     * @param  string  $url
      * @return string
      */
     protected function formatUrl(string $url)

+ 10 - 14
src/Form/Field/Embeds.php

@@ -22,8 +22,8 @@ class Embeds extends Field
     /**
      * Create a new HasMany field instance.
      *
-     * @param string $column
-     * @param array  $arguments
+     * @param  string  $column
+     * @param  array  $arguments
      */
     public function __construct($column, $arguments = [])
     {
@@ -42,8 +42,7 @@ class Embeds extends Field
     /**
      * Prepare input data for insert or update.
      *
-     * @param array $input
-     *
+     * @param  array  $input
      * @return array
      */
     protected function prepareInputValue($input)
@@ -146,9 +145,8 @@ class Embeds extends Field
     /**
      * Format validation messages.
      *
-     * @param array $input
-     * @param array $messages
-     *
+     * @param  array  $input
+     * @param  array  $messages
      * @return array
      */
     protected function formatValidationMessages(array $input, array $messages)
@@ -164,10 +162,9 @@ class Embeds extends Field
     /**
      * Format validation attributes.
      *
-     * @param array  $input
-     * @param string $label
-     * @param string $column
-     *
+     * @param  array  $input
+     * @param  string  $label
+     * @param  string  $column
      * @return array
      */
     protected function formatValidationAttribute($input, $label, $column)
@@ -200,9 +197,8 @@ class Embeds extends Field
     /**
      * Reset input key for validation.
      *
-     * @param array $input
-     * @param array $column $column is the column name array set
-     *
+     * @param  array  $input
+     * @param  array  $column  $column is the column name array set
      * @return void.
      */
     public function resetInputKey(array &$input, array $column)

+ 7 - 10
src/Form/Field/File.php

@@ -186,10 +186,9 @@ class File extends Field implements UploadFieldInterface
      *
      * @see http://fex.baidu.com/webuploader/doc/index.html#WebUploader_Uploader_events
      *
-     * @param string $event
-     * @param string $script
-     * @param bool   $once
-     *
+     * @param  string  $event
+     * @param  string  $script
+     * @param  bool  $once
      * @return $this
      */
     public function on(string $event, string $script, bool $once = false)
@@ -206,9 +205,8 @@ class File extends Field implements UploadFieldInterface
      *
      * @see http://fex.baidu.com/webuploader/doc/index.html#WebUploader_Uploader_events
      *
-     * @param string $event
-     * @param string $script
-     *
+     * @param  string  $event
+     * @param  string  $script
      * @return $this
      */
     public function once(string $event, string $script)
@@ -217,9 +215,8 @@ class File extends Field implements UploadFieldInterface
     }
 
     /**
-     * @param Field $field
-     * @param string|array $fieldRules
-     *
+     * @param  Field  $field
+     * @param  string|array  $fieldRules
      * @return void
      */
     public static function deleteRules(Field $field, &$fieldRules)

+ 19 - 26
src/Form/Field/HasMany.php

@@ -81,7 +81,7 @@ class HasMany extends Field
      * Create a new HasMany field instance.
      *
      * @param $relationName
-     * @param array $arguments
+     * @param  array  $arguments
      */
     public function __construct($relationName, $arguments = [])
     {
@@ -109,8 +109,7 @@ class HasMany extends Field
     /**
      * Get validator for this field.
      *
-     * @param array $input
-     *
+     * @param  array  $input
      * @return bool|Validator
      */
     public function getValidator(array $input)
@@ -220,9 +219,8 @@ class HasMany extends Field
     /**
      * Format validation messages.
      *
-     * @param array $input
-     * @param array $messages
-     *
+     * @param  array  $input
+     * @param  array  $messages
      * @return array
      */
     protected function formatValidationMessages(array $input, array $messages)
@@ -242,10 +240,9 @@ class HasMany extends Field
     /**
      * Format validation attributes.
      *
-     * @param array  $input
-     * @param string $label
-     * @param string $column
-     *
+     * @param  array  $input
+     * @param  string  $label
+     * @param  string  $column
      * @return array
      */
     protected function formatValidationAttribute($input, $label, $column)
@@ -278,9 +275,8 @@ class HasMany extends Field
     /**
      * Reset input key for validation.
      *
-     * @param array $input
-     * @param array $column $column is the column name array set
-     *
+     * @param  array  $input
+     * @param  array  $column  $column is the column name array set
      * @return void.
      */
     protected function resetInputKey(array &$input, array $column)
@@ -342,8 +338,7 @@ class HasMany extends Field
     /**
      * Prepare input data for insert or update.
      *
-     * @param array $input
-     *
+     * @param  array  $input
      * @return array
      */
     protected function prepareInputValue($input)
@@ -358,8 +353,7 @@ class HasMany extends Field
     /**
      * Build a Nested form.
      *
-     * @param null     $key
-     *
+     * @param  null  $key
      * @return NestedForm
      */
     public function buildNestedForm($key = null)
@@ -394,7 +388,7 @@ class HasMany extends Field
     }
 
     /**
-     * @param string $relationKeyName
+     * @param  string  $relationKeyName
      */
     public function setRelationKeyName(?string $relationKeyName)
     {
@@ -406,8 +400,7 @@ class HasMany extends Field
     /**
      * Set view mode.
      *
-     * @param string $mode currently support `tab` mode.
-     *
+     * @param  string  $mode  currently support `tab` mode.
      * @return $this
      *
      * @author Edwin Hui
@@ -442,9 +435,9 @@ class HasMany extends Field
     /**
      * Build Nested form for related data.
      *
-     * @throws \Exception
-     *
      * @return array
+     *
+     * @throws \Exception
      */
     protected function buildRelatedForms()
     {
@@ -507,9 +500,9 @@ class HasMany extends Field
     /**
      * Render the `HasMany` field.
      *
-     * @throws \Exception
-     *
      * @return \Illuminate\View\View|string
+     *
+     * @throws \Exception
      */
     public function render()
     {
@@ -539,9 +532,9 @@ class HasMany extends Field
     /**
      * Render the `HasMany` field for table style.
      *
-     * @throws \Exception
-     *
      * @return mixed
+     *
+     * @throws \Exception
      */
     protected function renderTable()
     {

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

@@ -28,8 +28,8 @@ class Html extends Field
     /**
      * Create a new Html instance.
      *
-     * @param mixed $html
-     * @param array $arguments
+     * @param  mixed  $html
+     * @param  array  $arguments
      */
     public function __construct($html, $arguments)
     {

+ 50 - 52
src/Form/Field/Image.php

@@ -5,45 +5,45 @@ namespace Dcat\Admin\Form\Field;
 use Symfony\Component\HttpFoundation\File\UploadedFile;
 
 /**
- * @method $this backup(string $name = 'default')                                                                                                     Backups current image state as fallback for reset method under an optional name. Overwrites older state on every call, unless a different name is passed.
- * @method $this blur(int $amount = 1)                                                                                                            Apply a gaussian blur filter with a optional amount on the current image. Use values between 0 and 100.
- * @method $this brightness(int $level)                                                                                                           Changes the brightness of the current image by the given level. Use values between -100 for min. brightness. 0 for no change and +100 for max. brightness.
- * @method $this cache(\Closure $callback, int $lifetime = null, boolean $returnObj = false)                                                      Method to create a new cached image instance from a Closure callback. Pass a lifetime in minutes for the callback and decide whether you want to get an Intervention Image instance as return value or just receive the image stream.
- * @method $this canvas(int $width, int $height, mixed $bgcolor = null)                                                                       Factory method to create a new empty image instance with given width and height. You can define a background-color optionally. By default the canvas background is transparent.
- * @method $this circle(int $radius, int $x, int $y, \Closure $callback = null)                                                           Draw a circle at given x, y, coordinates with given radius. You can define the appearance of the circle by an optional closure callback.
- * @method $this colorize(int $red, int $green, int $blue)                                                                                Change the RGB color values of the current image on the given channels red, green and blue. The input values are normalized so you have to include parameters from 100 for maximum color value. 0 for no change and -100 to take out all the certain color on the image.
- * @method $this contrast(int $level)                                                                                                             Changes the contrast of the current image by the given level. Use values between -100 for min. contrast 0 for no change and +100 for max. contrast.
- * @method $this crop(int $width, int $height, int $x = null, int $y = null)                                                          Cut out a rectangular part of the current image with given width and height. Define optional x,y coordinates to move the top-left corner of the cutout to a certain position.
- * @method $this ellipse(int $width, int $height, int $x, int $y, \Closure $callback = null)                                          Draw a colored ellipse at given x, y, coordinates. You can define width and height and set the appearance of the circle by an optional closure callback.
- * @method $this exif(string $key = null)                                                                                                             Read Exif meta data from current image.
- * @method $this iptc(string $key = null)                                                                                                             Read Iptc meta data from current image.
- * @method $this flip(string $mode = 'h')                                                                                                             Mirror the current image horizontally or vertically by specifying the mode.
- * @method $this fit(int $width, int $height = null, \Closure $callback = null, string $position = 'center')                                  Combine cropping and resizing to format image in a smart way. The method will find the best fitting aspect ratio of your given width and height on the current image automatically, cut it out and resize it to the given dimension. You may pass an optional Closure callback as third parameter, to prevent possible upsizing and a custom position of the cutout as fourth parameter.
- * @method $this gamma(float $correction)                                                                                                             Performs a gamma correction operation on the current image.
- * @method $this greyscale()                                                                                                                          Turns image into a greyscale version.
- * @method $this heighten(int $height, \Closure $callback = null)                                                                                 Resizes the current image to new height, constraining aspect ratio. Pass an optional Closure callback as third parameter, to apply additional constraints like preventing possible upsizing.
- * @method $this insert(mixed $source, string $position = 'top-left', int $x = 0, int $y = 0)                                                 Paste a given image source over the current image with an optional position and a offset coordinate. This method can be used to apply another image as watermark because the transparency values are maintained.
- * @method $this interlace(boolean $interlace = true)                                                                                                 Determine whether an image should be encoded in interlaced or standard mode by toggling interlace mode with a boolean parameter. If an JPEG image is set interlaced the image will be processed as a progressive JPEG.
- * @method $this invert()                                                                                                                             Reverses all colors of the current image.
- * @method $this limitColors(int $count, mixed $matte = null)                                                                                     Method converts the existing colors of the current image into a color table with a given maximum count of colors. The function preserves as much alpha channel information as possible and blends transarent pixels against a optional matte color.
- * @method $this line(int $x1, int $y1, int $x2, int $y2, \Closure $callback = null)                                                  Draw a line from x,y point 1 to x,y point 2 on current image. Define color and/or width of line in an optional Closure callback.
- * @method $this make(mixed $source)                                                                                                                  Universal factory method to create a new image instance from source, which can be a filepath, a GD image resource, an Imagick object or a binary image data.
- * @method $this mask(mixed $source, boolean $mask_with_alpha)                                                                                        Apply a given image source as alpha mask to the current image to change current opacity. Mask will be resized to the current image size. By default a greyscale version of the mask is converted to alpha values, but you can set mask_with_alpha to apply the actual alpha channel. Any transparency values of the current image will be maintained.
- * @method $this opacity(int $transparency)                                                                                                       Set the opacity in percent of the current image ranging from 100% for opaque and 0% for full transparency.
- * @method $this orientate()                                                                                                                          This method reads the EXIF image profile setting 'Orientation' and performs a rotation on the image to display the image correctly.
- * @method $this pickColor(int $x, int $y, string $format = 'array')                                                                          Pick a color at point x, y out of current image and return in optional given format.
- * @method $this pixel(mixed $color, int $x, int $y)                                                                                          Draw a single pixel in given color on x, y position.
- * @method $this pixelate(int $size)                                                                                                              Applies a pixelation effect to the current image with a given size of pixels.
- * @method $this polygon(array $points, \Closure $callback = null)                                                                                    Draw a colored polygon with given points. You can define the appearance of the polygon by an optional closure callback.
- * @method $this rectangle(int $x1, int $y1, int $x2, int $y2, \Closure $callback = null)                                             Draw a colored rectangle on current image with top-left corner on x,y point 1 and bottom-right corner at x,y point 2. Define the overall appearance of the shape by passing a Closure callback as an optional parameter.
- * @method $this reset(string $name = 'default')                                                                                                      Resets all of the modifications to a state saved previously by backup under an optional name.
- * @method $this resize(int $width, int $height = null, \Closure $callback = null)                                                                   Resizes current image based on given width and/or height. To contraint the resize command, pass an optional Closure callback as third parameter.
- * @method $this resizeCanvas(int $width, int $height, string $anchor = 'center', boolean $relative = false, mixed $bgcolor = null)           Resize the boundaries of the current image to given width and height. An anchor can be defined to determine from what point of the image the resizing is going to happen. Set the mode to relative to add or subtract the given width or height to the actual image dimensions. You can also pass a background color for the emerging area of the image.
- * @method $this rotate(float $angle, mixed $bgcolor = null)                                                                                          Rotate the current image counter-clockwise by a given angle. Optionally define a background color for the uncovered zone after the rotation.
- * @method $this sharpen(int $amount = 10)                                                                                                        Sharpen current image with an optional amount. Use values between 0 and 100.
- * @method $this text(string $text, int $x = 0, int $y = 0, \Closure $callback = null)                                                        Write a text string to the current image at an optional x,y basepoint position. You can define more details like font-size, font-file and alignment via a callback as the fourth parameter.
+ * @method $this backup(string $name = 'default') Backups current image state as fallback for reset method under an optional name. Overwrites older state on every call, unless a different name is passed.
+ * @method $this blur(int $amount = 1) Apply a gaussian blur filter with a optional amount on the current image. Use values between 0 and 100.
+ * @method $this brightness(int $level) Changes the brightness of the current image by the given level. Use values between -100 for min. brightness. 0 for no change and +100 for max. brightness.
+ * @method $this cache(\Closure $callback, int $lifetime = null, boolean $returnObj = false) Method to create a new cached image instance from a Closure callback. Pass a lifetime in minutes for the callback and decide whether you want to get an Intervention Image instance as return value or just receive the image stream.
+ * @method $this canvas(int $width, int $height, mixed $bgcolor = null) Factory method to create a new empty image instance with given width and height. You can define a background-color optionally. By default the canvas background is transparent.
+ * @method $this circle(int $radius, int $x, int $y, \Closure $callback = null) Draw a circle at given x, y, coordinates with given radius. You can define the appearance of the circle by an optional closure callback.
+ * @method $this colorize(int $red, int $green, int $blue) Change the RGB color values of the current image on the given channels red, green and blue. The input values are normalized so you have to include parameters from 100 for maximum color value. 0 for no change and -100 to take out all the certain color on the image.
+ * @method $this contrast(int $level) Changes the contrast of the current image by the given level. Use values between -100 for min. contrast 0 for no change and +100 for max. contrast.
+ * @method $this crop(int $width, int $height, int $x = null, int $y = null) Cut out a rectangular part of the current image with given width and height. Define optional x,y coordinates to move the top-left corner of the cutout to a certain position.
+ * @method $this ellipse(int $width, int $height, int $x, int $y, \Closure $callback = null) Draw a colored ellipse at given x, y, coordinates. You can define width and height and set the appearance of the circle by an optional closure callback.
+ * @method $this exif(string $key = null) Read Exif meta data from current image.
+ * @method $this iptc(string $key = null) Read Iptc meta data from current image.
+ * @method $this flip(string $mode = 'h') Mirror the current image horizontally or vertically by specifying the mode.
+ * @method $this fit(int $width, int $height = null, \Closure $callback = null, string $position = 'center') Combine cropping and resizing to format image in a smart way. The method will find the best fitting aspect ratio of your given width and height on the current image automatically, cut it out and resize it to the given dimension. You may pass an optional Closure callback as third parameter, to prevent possible upsizing and a custom position of the cutout as fourth parameter.
+ * @method $this gamma(float $correction) Performs a gamma correction operation on the current image.
+ * @method $this greyscale() Turns image into a greyscale version.
+ * @method $this heighten(int $height, \Closure $callback = null) Resizes the current image to new height, constraining aspect ratio. Pass an optional Closure callback as third parameter, to apply additional constraints like preventing possible upsizing.
+ * @method $this insert(mixed $source, string $position = 'top-left', int $x = 0, int $y = 0) Paste a given image source over the current image with an optional position and a offset coordinate. This method can be used to apply another image as watermark because the transparency values are maintained.
+ * @method $this interlace(boolean $interlace = true) Determine whether an image should be encoded in interlaced or standard mode by toggling interlace mode with a boolean parameter. If an JPEG image is set interlaced the image will be processed as a progressive JPEG.
+ * @method $this invert() Reverses all colors of the current image.
+ * @method $this limitColors(int $count, mixed $matte = null) Method converts the existing colors of the current image into a color table with a given maximum count of colors. The function preserves as much alpha channel information as possible and blends transarent pixels against a optional matte color.
+ * @method $this line(int $x1, int $y1, int $x2, int $y2, \Closure $callback = null) Draw a line from x,y point 1 to x,y point 2 on current image. Define color and/or width of line in an optional Closure callback.
+ * @method $this make(mixed $source) Universal factory method to create a new image instance from source, which can be a filepath, a GD image resource, an Imagick object or a binary image data.
+ * @method $this mask(mixed $source, boolean $mask_with_alpha) Apply a given image source as alpha mask to the current image to change current opacity. Mask will be resized to the current image size. By default a greyscale version of the mask is converted to alpha values, but you can set mask_with_alpha to apply the actual alpha channel. Any transparency values of the current image will be maintained.
+ * @method $this opacity(int $transparency) Set the opacity in percent of the current image ranging from 100% for opaque and 0% for full transparency.
+ * @method $this orientate() This method reads the EXIF image profile setting 'Orientation' and performs a rotation on the image to display the image correctly.
+ * @method $this pickColor(int $x, int $y, string $format = 'array') Pick a color at point x, y out of current image and return in optional given format.
+ * @method $this pixel(mixed $color, int $x, int $y) Draw a single pixel in given color on x, y position.
+ * @method $this pixelate(int $size) Applies a pixelation effect to the current image with a given size of pixels.
+ * @method $this polygon(array $points, \Closure $callback = null) Draw a colored polygon with given points. You can define the appearance of the polygon by an optional closure callback.
+ * @method $this rectangle(int $x1, int $y1, int $x2, int $y2, \Closure $callback = null) Draw a colored rectangle on current image with top-left corner on x,y point 1 and bottom-right corner at x,y point 2. Define the overall appearance of the shape by passing a Closure callback as an optional parameter.
+ * @method $this reset(string $name = 'default') Resets all of the modifications to a state saved previously by backup under an optional name.
+ * @method $this resize(int $width, int $height = null, \Closure $callback = null) Resizes current image based on given width and/or height. To contraint the resize command, pass an optional Closure callback as third parameter.
+ * @method $this resizeCanvas(int $width, int $height, string $anchor = 'center', boolean $relative = false, mixed $bgcolor = null) Resize the boundaries of the current image to given width and height. An anchor can be defined to determine from what point of the image the resizing is going to happen. Set the mode to relative to add or subtract the given width or height to the actual image dimensions. You can also pass a background color for the emerging area of the image.
+ * @method $this rotate(float $angle, mixed $bgcolor = null) Rotate the current image counter-clockwise by a given angle. Optionally define a background color for the uncovered zone after the rotation.
+ * @method $this sharpen(int $amount = 10) Sharpen current image with an optional amount. Use values between 0 and 100.
+ * @method $this text(string $text, int $x = 0, int $y = 0, \Closure $callback = null) Write a text string to the current image at an optional x,y basepoint position. You can define more details like font-size, font-file and alignment via a callback as the fourth parameter.
  * @method $this trim(string $base = 'top-left', array $away = array('top', 'bottom', 'left', 'right'), int $tolerance = 0, int $feather = 0) Trim away image space in given color. Define an optional base to pick a color at a certain position and borders that should be trimmed away. You can also set an optional tolerance level, to trim similar colors and add a feathering border around the trimed image.
- * @method $this widen(int $width, \Closure $callback = null)                                                                                     Resizes the current image to new width, constraining aspect ratio. Pass an optional Closure callback as third parameter, to apply additional constraints like preventing possible upsizing.
+ * @method $this widen(int $width, \Closure $callback = null) Resizes the current image to new width, constraining aspect ratio. Pass an optional Closure callback as third parameter, to apply additional constraints like preventing possible upsizing.
  */
 class Image extends File
 {
@@ -71,17 +71,16 @@ class Image extends File
     }
 
     /**
-     * @param array $options support:
-     *                       [
-     *                       'width' => 100,
-     *                       'height' => 100,
-     *                       'min_width' => 100,
-     *                       'min_height' => 100,
-     *                       'max_width' => 100,
-     *                       'max_height' => 100,
-     *                       'ratio' => 3/2, // (width / height)
-     *                       ]
-     *
+     * @param  array  $options  support:
+     *                          [
+     *                          'width' => 100,
+     *                          'height' => 100,
+     *                          'min_width' => 100,
+     *                          'min_height' => 100,
+     *                          'max_width' => 100,
+     *                          'max_height' => 100,
+     *                          'ratio' => 3/2, // (width / height)
+     *                          ]
      * @return $this
      */
     public function dimensions(array $options)
@@ -102,8 +101,7 @@ class Image extends File
     /**
      * Set ratio constraint.
      *
-     * @param float $ratio width/height
-     *
+     * @param  float  $ratio  width/height
      * @return $this
      */
     public function ratio($ratio)
@@ -116,7 +114,7 @@ class Image extends File
     }
 
     /**
-     * @param UploadedFile $file
+     * @param  UploadedFile  $file
      */
     protected function prepareFile(UploadedFile $file)
     {

+ 11 - 16
src/Form/Field/ImageField.php

@@ -42,9 +42,8 @@ trait ImageField
     /**
      * Execute Intervention calls.
      *
-     * @param string $target
-     * @param string $mime
-     *
+     * @param  string  $target
+     * @param  string  $mime
      * @return mixed
      */
     public function callInterventionMethods($target, $mime)
@@ -68,12 +67,11 @@ trait ImageField
     /**
      * Call intervention methods.
      *
-     * @param string $method
-     * @param array  $arguments
+     * @param  string  $method
+     * @param  array  $arguments
+     * @return $this
      *
      * @throws \Exception
-     *
-     * @return $this
      */
     public function __call($method, $arguments)
     {
@@ -94,10 +92,9 @@ trait ImageField
     }
 
     /**
-     * @param string|array $name
-     * @param int          $width
-     * @param int          $height
-     *
+     * @param  string|array  $name
+     * @param  int  $width
+     * @param  int  $height
      * @return $this
      */
     public function thumbnail($name, int $width = null, int $height = null)
@@ -118,9 +115,8 @@ trait ImageField
     /**
      * Destroy original thumbnail files.
      *
-     * @param string|array $file
-     * @param bool         $force
-     *
+     * @param  string|array  $file
+     * @param  bool  $force
      * @return void.
      */
     public function destroyThumbnail($file = null, bool $force = false)
@@ -161,8 +157,7 @@ trait ImageField
     /**
      * Upload file and delete original thumbnail files.
      *
-     * @param UploadedFile $file
-     *
+     * @param  UploadedFile  $file
      * @return $this
      */
     protected function uploadAndDeleteOriginalThumbnail(UploadedFile $file)

+ 2 - 4
src/Form/Field/ListField.php

@@ -28,8 +28,7 @@ class ListField extends Field
     /**
      * Set Max list size.
      *
-     * @param int $size
-     *
+     * @param  int  $size
      * @return $this
      */
     public function max(int $size)
@@ -42,8 +41,7 @@ class ListField extends Field
     /**
      * Set Minimum list size.
      *
-     * @param int $size
-     *
+     * @param  int  $size
      * @return $this
      */
     public function min(int $size)

+ 7 - 14
src/Form/Field/Markdown.php

@@ -47,8 +47,7 @@ class Markdown extends Field
      * 开启 HTML 标签解析.
      * style,script,iframe|on*.
      *
-     * @param string $decode
-     *
+     * @param  string  $decode
      * @return $this
      */
     public function htmlDecode($decode)
@@ -61,8 +60,7 @@ class Markdown extends Field
     /**
      * 设置编辑器容器高度.
      *
-     * @param int $height
-     *
+     * @param  int  $height
      * @return $this
      */
     public function height($height)
@@ -75,8 +73,7 @@ class Markdown extends Field
     /**
      * 设置文件上传存储配置.
      *
-     * @param string $disk
-     *
+     * @param  string  $disk
      * @return $this
      */
     public function disk(string $disk)
@@ -89,8 +86,7 @@ class Markdown extends Field
     /**
      * 设置图片上传文件夹.
      *
-     * @param string $dir
-     *
+     * @param  string  $dir
      * @return $this
      */
     public function imageDirectory(string $dir)
@@ -103,8 +99,7 @@ class Markdown extends Field
     /**
      * 自定义图片上传接口.
      *
-     * @param string $url
-     *
+     * @param  string  $url
      * @return $this
      */
     public function imageUrl(string $url)
@@ -115,8 +110,7 @@ class Markdown extends Field
     /**
      * 设置语言包路径.
      *
-     * @param string $url
-     *
+     * @param  string  $url
      * @return $this
      */
     public function languageUrl(string $url)
@@ -135,8 +129,7 @@ class Markdown extends Field
     }
 
     /**
-     * @param string $url
-     *
+     * @param  string  $url
      * @return string
      */
     protected function formatUrl(string $url)

+ 3 - 6
src/Form/Field/MultipleFile.php

@@ -11,8 +11,7 @@ class MultipleFile extends File
     /**
      * Allow to sort files.
      *
-     * @param bool $value
-     *
+     * @param  bool  $value
      * @return $this
      */
     public function sortable(bool $value = true)
@@ -25,8 +24,7 @@ class MultipleFile extends File
     /**
      * Set a limit of files.
      *
-     * @param int $limit
-     *
+     * @param  int  $limit
      * @return $this
      */
     public function limit(int $limit)
@@ -42,8 +40,7 @@ class MultipleFile extends File
     /**
      * Prepare for saving.
      *
-     * @param string|array $file
-     *
+     * @param  string|array  $file
      * @return array
      */
     protected function prepareInputValue($file)

+ 3 - 6
src/Form/Field/MultipleImage.php

@@ -11,8 +11,7 @@ class MultipleImage extends Image
     /**
      * Allow to sort files.
      *
-     * @param bool $value
-     *
+     * @param  bool  $value
      * @return $this
      */
     public function sortable(bool $value = true)
@@ -25,8 +24,7 @@ class MultipleImage extends Image
     /**
      * Set a limit of files.
      *
-     * @param int $limit
-     *
+     * @param  int  $limit
      * @return $this
      */
     public function limit(int $limit)
@@ -43,8 +41,7 @@ class MultipleImage extends Image
     /**
      * Prepare for saving.
      *
-     * @param string|array $file
-     *
+     * @param  string|array  $file
      * @return array
      */
     protected function prepareInputValue($file)

+ 2 - 4
src/Form/Field/MultipleSelectTable.php

@@ -20,8 +20,7 @@ class MultipleSelectTable extends SelectTable
     /**
      * 设置最大选择数量.
      *
-     * @param int $max
-     *
+     * @param  int  $max
      * @return $this
      */
     public function max(int $max)
@@ -34,8 +33,7 @@ class MultipleSelectTable extends SelectTable
     /**
      * 转化为数组格式保存.
      *
-     * @param mixed $value
-     *
+     * @param  mixed  $value
      * @return array|mixed
      */
     public function prepareInputValue($value)

+ 2 - 4
src/Form/Field/Number.php

@@ -15,8 +15,7 @@ class Number extends Text
     /**
      * Set min value of number field.
      *
-     * @param int $value
-     *
+     * @param  int  $value
      * @return $this
      */
     public function min($value)
@@ -29,8 +28,7 @@ class Number extends Text
     /**
      * Set max value of number field.
      *
-     * @param int $value
-     *
+     * @param  int  $value
      * @return $this
      */
     public function max($value)

+ 2 - 4
src/Form/Field/Radio.php

@@ -19,8 +19,7 @@ class Radio extends Field
     protected $inline = true;
 
     /**
-     * @param array|\Closure|string $options
-     *
+     * @param  array|\Closure|string  $options
      * @return $this
      */
     public function options($options = [])
@@ -46,8 +45,7 @@ class Radio extends Field
     /**
      * "info", "primary", "inverse", "danger", "success", "purple".
      *
-     * @param string $style
-     *
+     * @param  string  $style
      * @return $this
      */
     public function style(string $style)

+ 14 - 21
src/Form/Field/Select.php

@@ -29,8 +29,7 @@ class Select extends Field
     /**
      * Set options.
      *
-     * @param array|\Closure|string $options
-     *
+     * @param  array|\Closure|string  $options
      * @return $this|mixed
      */
     public function options($options = [])
@@ -57,7 +56,7 @@ class Select extends Field
     }
 
     /**
-     * @param array $groups
+     * @param  array  $groups
      */
 
     /**
@@ -74,8 +73,7 @@ class Select extends Field
      *        ...
      *     ]
      *
-     * @param array $groups
-     *
+     * @param  array  $groups
      * @return $this
      */
     public function groups(array $groups)
@@ -88,10 +86,9 @@ class Select extends Field
     /**
      * Load options from current selected resource(s).
      *
-     * @param string $model
-     * @param string $idField
-     * @param string $textField
-     *
+     * @param  string  $model
+     * @param  string  $idField
+     * @param  string  $textField
      * @return $this
      */
     public function model($model, string $idField = 'id', string $textField = 'name')
@@ -128,10 +125,9 @@ class Select extends Field
     /**
      * Load options from remote.
      *
-     * @param string $url
-     * @param array  $parameters
-     * @param array  $options
-     *
+     * @param  string  $url
+     * @param  array  $parameters
+     * @param  array  $options
      * @return $this
      */
     protected function loadRemoteOptions(string $url, array $parameters = [], array $options = [])
@@ -146,9 +142,8 @@ class Select extends Field
     }
 
     /**
-     * @param string|array $key
-     * @param mixed        $value
-     *
+     * @param  string|array  $key
+     * @param  mixed  $value
      * @return $this
      */
     public function addDefaultConfig($key, $value = null)
@@ -171,10 +166,9 @@ class Select extends Field
     /**
      * Load options from ajax results.
      *
-     * @param string $url
+     * @param  string  $url
      * @param $idField
      * @param $textField
-     *
      * @return $this
      */
     public function ajax(string $url, string $idField = 'id', string $textField = 'text')
@@ -193,9 +187,8 @@ class Select extends Field
      *
      * all configurations see https://select2.org/configuration/options-api
      *
-     * @param string $key
-     * @param mixed  $val
-     *
+     * @param  string  $key
+     * @param  mixed  $val
      * @return $this
      */
     public function config(string $key, $val)

+ 7 - 13
src/Form/Field/SelectTable.php

@@ -33,8 +33,7 @@ class SelectTable extends Field
     /**
      * 设置弹窗标题.
      *
-     * @param string $title
-     *
+     * @param  string  $title
      * @return $this
      */
     public function title($title)
@@ -51,8 +50,7 @@ class SelectTable extends Field
      *    $this->width('500px');
      *    $this->width('50%');
      *
-     * @param string $width
-     *
+     * @param  string  $width
      * @return $this
      */
     public function dialogWidth(string $width)
@@ -65,8 +63,7 @@ class SelectTable extends Field
     /**
      * 设置表格异步渲染实例.
      *
-     * @param LazyRenderable $renderable
-     *
+     * @param  LazyRenderable  $renderable
      * @return $this
      */
     public function from(LazyRenderable $renderable)
@@ -81,7 +78,6 @@ class SelectTable extends Field
      *
      * @param $visibleColumn
      * @param $key
-     *
      * @return $this
      */
     public function pluck(?string $visibleColumn, ?string $key = 'id')
@@ -93,8 +89,7 @@ class SelectTable extends Field
     }
 
     /**
-     * @param array $options
-     *
+     * @param  array  $options
      * @return $this
      */
     public function options($options = [])
@@ -107,10 +102,9 @@ class SelectTable extends Field
     /**
      * 设置选中数据显示.
      *
-     * @param string $model
-     * @param string $id
-     * @param string $text
-     *
+     * @param  string  $model
+     * @param  string  $id
+     * @param  string  $text
      * @return $this
      */
     public function model(string $model, string $id = 'id', string $text = 'title')

+ 3 - 6
src/Form/Field/SwitchField.php

@@ -45,8 +45,7 @@ class SwitchField extends Field
     /**
      * Set color of the switcher.
      *
-     * @param string $color
-     *
+     * @param  string  $color
      * @return $this
      */
     public function color($color)
@@ -55,8 +54,7 @@ class SwitchField extends Field
     }
 
     /**
-     * @param string $color
-     *
+     * @param  string  $color
      * @return $this
      */
     public function secondary($color)
@@ -81,8 +79,7 @@ class SwitchField extends Field
     }
 
     /**
-     * @param mixed $value
-     *
+     * @param  mixed  $value
      * @return int
      */
     protected function prepareInputValue($value)

+ 5 - 10
src/Form/Field/Tags.php

@@ -54,7 +54,6 @@ class Tags extends Field
      *
      * @param $visibleColumn
      * @param $key
-     *
      * @return $this
      */
     public function pluck($visibleColumn, $key = 'id')
@@ -72,9 +71,8 @@ class Tags extends Field
     /**
      * Sanitize input data.
      *
-     * @param array  $input
-     * @param string $column
-     *
+     * @param  array  $input
+     * @param  string  $column
      * @return array
      */
     protected function sanitizeInput($input, $column)
@@ -93,8 +91,7 @@ class Tags extends Field
     /**
      * Set the field options.
      *
-     * @param array|Collection|Arrayable|\Closure $options
-     *
+     * @param  array|Collection|Arrayable|\Closure  $options
      * @return $this|Field
      */
     public function options($options = [])
@@ -137,8 +134,7 @@ class Tags extends Field
     /**
      * Get or set value for this field.
      *
-     * @param mixed $value
-     *
+     * @param  mixed  $value
      * @return $this|array|mixed
      */
     public function value($value = null)
@@ -155,10 +151,9 @@ class Tags extends Field
     /**
      * Load options from ajax results.
      *
-     * @param string $url
+     * @param  string  $url
      * @param $idField
      * @param $textField
-     *
      * @return $this
      */
     public function ajax(string $url, string $idField = 'id', string $textField = 'text')

+ 10 - 17
src/Form/Field/Text.php

@@ -47,8 +47,7 @@ class Text extends Field
     /**
      * Set input type.
      *
-     * @param string $type
-     *
+     * @param  string  $type
      * @return $this
      */
     public function type(string $type)
@@ -61,9 +60,8 @@ class Text extends Field
      *
      * @see http://1000hz.github.io/bootstrap-validator/
      *
-     * @param string|Field $field
-     * @param string       $error
-     *
+     * @param  string|Field  $field
+     * @param  string  $error
      * @return $this
      */
     public function same($field, ?string $error = null)
@@ -90,9 +88,8 @@ class Text extends Field
     }
 
     /**
-     * @param int         $length
-     * @param string|null $error
-     *
+     * @param  int  $length
+     * @param  string|null  $error
      * @return $this
      */
     public function minLength(int $length, ?string $error = null)
@@ -110,9 +107,8 @@ class Text extends Field
     }
 
     /**
-     * @param int         $length
-     * @param string|null $error
-     *
+     * @param  int  $length
+     * @param  string|null  $error
      * @return $this
      */
     public function maxLength(int $length, ?string $error = null)
@@ -140,8 +136,7 @@ JS
     /**
      * Add inputmask to an elements.
      *
-     * @param array $options
-     *
+     * @param  array  $options
      * @return $this
      */
     public function inputmask($options)
@@ -158,8 +153,7 @@ JS
     }
 
     /**
-     * @param array $options
-     *
+     * @param  array  $options
      * @return array
      */
     protected function formatOptions($options)
@@ -186,8 +180,7 @@ JS
     /**
      * Add datalist element to Text input.
      *
-     * @param array $entries
-     *
+     * @param  array  $entries
      * @return $this
      */
     public function datalist($entries = [])

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

@@ -16,8 +16,7 @@ class Textarea extends Field
     /**
      * Set rows of textarea.
      *
-     * @param int $rows
-     *
+     * @param  int  $rows
      * @return $this
      */
     public function rows($rows = 5)

+ 12 - 18
src/Form/Field/Tree.php

@@ -49,14 +49,13 @@ class Tree extends Field
     protected $rootParentId = 0;
 
     /**
-     * @param array|Arrayable|\Closure $data exp:
-     *                                       {
-     *                                       "id": "1",
-     *                                       "parent": "#",
-     *                                       "text": "Dashboard",
-     *                                       // "state": {"selected": true}
-     *                                       }
-     *
+     * @param  array|Arrayable|\Closure  $data  exp:
+     *                                          {
+     *                                          "id": "1",
+     *                                          "parent": "#",
+     *                                          "text": "Dashboard",
+     *                                          // "state": {"selected": true}
+     *                                          }
      * @return $this
      */
     public function nodes($data)
@@ -73,8 +72,7 @@ class Tree extends Field
     /**
      * 设置父级复选框是否禁止被单独选中.
      *
-     * @param bool $value
-     *
+     * @param  bool  $value
      * @return $this
      */
     public function treeState(bool $value = true)
@@ -87,8 +85,7 @@ class Tree extends Field
     /**
      * 过滤父节点.
      *
-     * @param bool $value
-     *
+     * @param  bool  $value
      * @return $this
      */
     public function exceptParentNode(bool $value = true)
@@ -197,8 +194,7 @@ class Tree extends Field
     /**
      * Set type.
      *
-     * @param array $value
-     *
+     * @param  array  $value
      * @return $this
      */
     public function type(array $value)
@@ -211,8 +207,7 @@ class Tree extends Field
     /**
      * Set plugins.
      *
-     * @param array $value
-     *
+     * @param  array  $value
      * @return $this
      */
     public function plugins(array $value)
@@ -223,8 +218,7 @@ class Tree extends Field
     }
 
     /**
-     * @param bool $value
-     *
+     * @param  bool  $value
      * @return $this
      */
     public function expand(bool $value = true)

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

@@ -94,7 +94,6 @@ trait UploadField
      * If name already exists, rename it.
      *
      * @param $file
-     *
      * @return void
      */
     public function renameIfExists(UploadedFile $file)
@@ -115,8 +114,7 @@ trait UploadField
     /**
      * Get store name of upload file.
      *
-     * @param UploadedFile $file
-     *
+     * @param  UploadedFile  $file
      * @return string
      */
     protected function getStoreName(UploadedFile $file)
@@ -157,8 +155,7 @@ trait UploadField
     /**
      * Indicates if the underlying field is retainable.
      *
-     * @param bool $retainable
-     *
+     * @param  bool  $retainable
      * @return $this
      */
     public function retainable(bool $retainable = true)
@@ -178,8 +175,7 @@ trait UploadField
     /**
      * Upload File.
      *
-     * @param UploadedFile $file
-     *
+     * @param  UploadedFile  $file
      * @return Response
      */
     public function upload(UploadedFile $file)
@@ -221,7 +217,7 @@ trait UploadField
     }
 
     /**
-     * @param UploadedFile $file
+     * @param  UploadedFile  $file
      */
     protected function prepareFile(UploadedFile $file)
     {
@@ -230,9 +226,8 @@ trait UploadField
     /**
      * Specify the directory and name for upload file.
      *
-     * @param string|\Closure $directory
-     * @param null|string     $name
-     *
+     * @param  string|\Closure  $directory
+     * @param  null|string  $name
      * @return $this
      */
     public function move($directory, $name = null)
@@ -247,8 +242,7 @@ trait UploadField
     /**
      * Specify the directory upload file.
      *
-     * @param string|\Closure $dir
-     *
+     * @param  string|\Closure  $dir
      * @return $this
      */
     public function dir($dir)
@@ -263,8 +257,7 @@ trait UploadField
     /**
      * Set name of store name.
      *
-     * @param string|callable $name
-     *
+     * @param  string|callable  $name
      * @return $this
      */
     public function name($name)
@@ -303,8 +296,7 @@ trait UploadField
     /**
      * Generate a unique name for uploaded file.
      *
-     * @param UploadedFile $file
-     *
+     * @param  UploadedFile  $file
      * @return string
      */
     protected function generateUniqueName(UploadedFile $file)
@@ -315,8 +307,7 @@ trait UploadField
     /**
      * Generate a sequence name for uploaded file.
      *
-     * @param UploadedFile $file
-     *
+     * @param  UploadedFile  $file
      * @return string
      */
     protected function generateSequenceName(UploadedFile $file)
@@ -335,8 +326,7 @@ trait UploadField
     }
 
     /**
-     * @param UploadedFile $file
-     *
+     * @param  UploadedFile  $file
      * @return bool|\Illuminate\Support\MessageBag
      */
     protected function getValidationErrors(UploadedFile $file)
@@ -396,7 +386,7 @@ trait UploadField
     /**
      * Destroy files.
      *
-     * @param string|array $path
+     * @param  string|array  $path
      */
     public function deleteFile($paths)
     {
@@ -437,11 +427,10 @@ trait UploadField
     /**
      * Set disk for storage.
      *
-     * @param string $disk Disks defined in `config/filesystems.php`.
+     * @param  string  $disk  Disks defined in `config/filesystems.php`.
+     * @return $this
      *
      * @throws \Exception
-     *
-     * @return $this
      */
     public function disk($disk)
     {
@@ -466,8 +455,7 @@ trait UploadField
     /**
      * Get file visit url.
      *
-     * @param string $path
-     *
+     * @param  string  $path
      * @return string
      */
     public function objectUrl($path)
@@ -481,7 +469,6 @@ trait UploadField
 
     /**
      * @param $permission
-     *
      * @return $this
      */
     public function storagePermission($permission)

+ 16 - 31
src/Form/Field/WebUploader.php

@@ -13,9 +13,8 @@ use Illuminate\Support\Str;
 trait WebUploader
 {
     /**
-     * @param string      $extensions exp. gif,jpg,jpeg,bmp,png
-     * @param string|null $mimeTypes  exp. image/*
-     *
+     * @param  string  $extensions  exp. gif,jpg,jpeg,bmp,png
+     * @param  string|null  $mimeTypes  exp. image/*
      * @return $this
      */
     public function accept(string $extensions, string $mimeTypes = null)
@@ -32,8 +31,7 @@ trait WebUploader
     }
 
     /**
-     * @param string $mimeTypes  exp. image/*
-     *
+     * @param  string  $mimeTypes  exp. image/*
      * @return $this
      */
     public function mimeTypes(string $mimeTypes)
@@ -44,8 +42,7 @@ trait WebUploader
     }
 
     /**
-     * @param bool $value
-     *
+     * @param  bool  $value
      * @return $this
      */
     public function chunked(bool $value = true)
@@ -56,8 +53,7 @@ trait WebUploader
     }
 
     /**
-     * @param int|null $size kb
-     *
+     * @param  int|null  $size  kb
      * @return $this
      */
     public function chunkSize(int $size)
@@ -70,8 +66,7 @@ trait WebUploader
     }
 
     /**
-     * @param int $size kb
-     *
+     * @param  int  $size  kb
      * @return $this
      */
     public function maxSize(int $size)
@@ -83,8 +78,7 @@ trait WebUploader
     }
 
     /**
-     * @param int $num
-     *
+     * @param  int  $num
      * @return $this
      */
     public function threads(int $num)
@@ -97,8 +91,7 @@ trait WebUploader
     /**
      * 设置上传接口.
      *
-     * @param string $server
-     *
+     * @param  string  $server
      * @return $this
      */
     public function url(string $server)
@@ -113,8 +106,7 @@ trait WebUploader
     /**
      * 禁止上传文件后自动更新字段值.
      *
-     * @param bool $value
-     *
+     * @param  bool  $value
      * @return $this
      */
     public function autoSave(bool $value = true)
@@ -127,8 +119,7 @@ trait WebUploader
     /**
      * 禁用前端删除功能.
      *
-     * @param bool $value
-     *
+     * @param  bool  $value
      * @return $this
      */
     public function removable(bool $value = true)
@@ -141,8 +132,7 @@ trait WebUploader
     /**
      * 设置图片删除地址.
      *
-     * @param string $server
-     *
+     * @param  string  $server
      * @return $this
      */
     public function deleteUrl(string $server)
@@ -155,8 +145,7 @@ trait WebUploader
     /**
      * 设置上传表单请求参数.
      *
-     * @param array $data
-     *
+     * @param  array  $data
      * @return $this
      */
     public function withFormData(array $data)
@@ -169,8 +158,7 @@ trait WebUploader
     /**
      * 设置删除图片请求参数.
      *
-     * @param array $data
-     *
+     * @param  array  $data
      * @return $this
      */
     public function withDeleteData(array $data)
@@ -183,8 +171,7 @@ trait WebUploader
     /**
      * 是否开启自动上传.
      *
-     * @param bool $value
-     *
+     * @param  bool  $value
      * @return $this
      */
     public function autoUpload(bool $value = true)
@@ -197,8 +184,7 @@ trait WebUploader
     /**
      * 是否开启图片压缩.
      *
-     * @param bool|array $compress
-     *
+     * @param  bool|array  $compress
      * @return $this
      */
     public function compress($compress = true)
@@ -211,8 +197,7 @@ trait WebUploader
     /**
      * 是否允许下载文件.
      *
-     * @param bool $value
-     *
+     * @param  bool  $value
      * @return $this
      */
     public function downloadable(bool $value = true)

+ 11 - 19
src/Form/Footer.php

@@ -52,7 +52,7 @@ class Footer implements Renderable
     /**
      * Footer constructor.
      *
-     * @param Builder $builder
+     * @param  Builder  $builder
      */
     public function __construct(Builder $builder)
     {
@@ -62,8 +62,7 @@ class Footer implements Renderable
     /**
      * Disable reset button.
      *
-     * @param bool $disable
-     *
+     * @param  bool  $disable
      * @return $this
      */
     public function disableReset(bool $disable = true)
@@ -76,8 +75,7 @@ class Footer implements Renderable
     /**
      * Disable submit button.
      *
-     * @param bool $disable
-     *
+     * @param  bool  $disable
      * @return $this
      */
     public function disableSubmit(bool $disable = true)
@@ -90,8 +88,7 @@ class Footer implements Renderable
     /**
      * Disable View Checkbox.
      *
-     * @param bool $disable
-     *
+     * @param  bool  $disable
      * @return $this
      */
     public function disableViewCheck(bool $disable = true)
@@ -104,8 +101,7 @@ class Footer implements Renderable
     /**
      * Disable Editing Checkbox.
      *
-     * @param bool $disable
-     *
+     * @param  bool  $disable
      * @return $this
      */
     public function disableEditingCheck(bool $disable = true)
@@ -118,8 +114,7 @@ class Footer implements Renderable
     /**
      * Disable Creating Checkbox.
      *
-     * @param bool $disable
-     *
+     * @param  bool  $disable
      * @return $this
      */
     public function disableCreatingCheck(bool $disable = true)
@@ -132,8 +127,7 @@ class Footer implements Renderable
     /**
      * default View Checked.
      *
-     * @param bool $checked
-     *
+     * @param  bool  $checked
      * @return $this
      */
     public function defaultViewChecked(bool $checked = true)
@@ -146,8 +140,7 @@ class Footer implements Renderable
     /**
      * default Editing Checked.
      *
-     * @param bool $checked
-     *
+     * @param  bool  $checked
      * @return $this
      */
     public function defaultEditingChecked(bool $checked = true)
@@ -160,8 +153,7 @@ class Footer implements Renderable
     /**
      * default Creating Checked.
      *
-     * @param bool $checked
-     *
+     * @param  bool  $checked
      * @return $this
      */
     public function defaultCreatingChecked(bool $checked = true)
@@ -219,8 +211,8 @@ class Footer implements Renderable
     /**
      * Use custom view.
      *
-     * @param string $view
-     * @param array $data
+     * @param  string  $view
+     * @param  array  $data
      */
     public function view(string $view, array $data = [])
     {

+ 10 - 13
src/Form/Layout.php

@@ -53,8 +53,8 @@ class Layout
     /**
      * 列布局.
      *
-     * @param int   $width   1~12
-     * @param mixed $content
+     * @param  int  $width  1~12
+     * @param  mixed  $content
      */
     public function onlyColumn($width, $content)
     {
@@ -74,9 +74,8 @@ class Layout
     /**
      * 增加列.
      *
-     * @param int   $width   1~12
-     * @param mixed $content
-     *
+     * @param  int  $width  1~12
+     * @param  mixed  $content
      * @return Column
      */
     public function column(int $width, $content)
@@ -87,8 +86,8 @@ class Layout
     /**
      * block布局.
      *
-     * @param int $width
-     * @param \Closure $callback
+     * @param  int  $width
+     * @param  \Closure  $callback
      */
     public function block(int $width, \Closure $callback)
     {
@@ -110,8 +109,8 @@ class Layout
     }
 
     /**
-     * @param int   $width
-     * @param mixed $content
+     * @param  int  $width
+     * @param  mixed  $content
      */
     public function prepend(int $width, $content)
     {
@@ -121,8 +120,7 @@ class Layout
     }
 
     /**
-     * @param \Closure|null $callback
-     *
+     * @param  \Closure|null  $callback
      * @return BlockForm
      */
     public function form(\Closure $callback = null)
@@ -144,8 +142,7 @@ class Layout
     /**
      * Build html of content.
      *
-     * @param string $add
-     *
+     * @param  string  $add
      * @return string
      */
     public function build($add = null)

+ 15 - 25
src/Form/NestedForm.php

@@ -52,8 +52,8 @@ class NestedForm extends WidgetForm
      *
      * NestedForm constructor.
      *
-     * @param string $relation
-     * @param null   $key
+     * @param  string  $relation
+     * @param  null  $key
      */
     public function __construct($relation = null, $key = null)
     {
@@ -72,8 +72,7 @@ class NestedForm extends WidgetForm
     /**
      * Set Form.
      *
-     * @param Form|WidgetForm $form
-     *
+     * @param  Form|WidgetForm  $form
      * @return $this
      */
     public function setForm($form = null)
@@ -101,9 +100,8 @@ class NestedForm extends WidgetForm
     /**
      * Set original values for fields.
      *
-     * @param array  $data
-     * @param string $relatedKeyName
-     *
+     * @param  array  $data
+     * @param  string  $relatedKeyName
      * @return $this
      */
     public function setOriginal($data, $relatedKeyName)
@@ -129,8 +127,7 @@ class NestedForm extends WidgetForm
     /**
      * Prepare for insert or update.
      *
-     * @param array $input
-     *
+     * @param  array  $input
      * @return mixed
      */
     public function prepare($input)
@@ -169,8 +166,7 @@ class NestedForm extends WidgetForm
     /**
      * Set key for current form.
      *
-     * @param mixed $key
-     *
+     * @param  mixed  $key
      * @return $this
      */
     public function setKey($key)
@@ -183,8 +179,7 @@ class NestedForm extends WidgetForm
     /**
      * Set original data for each field.
      *
-     * @param string $key
-     *
+     * @param  string  $key
      * @return void
      */
     protected function setFieldOriginalValue($key)
@@ -201,8 +196,7 @@ class NestedForm extends WidgetForm
     /**
      * Do prepare work before store and update.
      *
-     * @param array $record
-     *
+     * @param  array  $record
      * @return array
      */
     protected function prepareRecord($record)
@@ -246,9 +240,8 @@ class NestedForm extends WidgetForm
     /**
      * Fetch value in input data by column name.
      *
-     * @param array        $data
-     * @param string|array $columns
-     *
+     * @param  array  $data
+     * @param  string|array  $columns
      * @return array|mixed
      */
     protected function fetchColumnValue($data, $columns)
@@ -335,8 +328,7 @@ class NestedForm extends WidgetForm
     /**
      * Fill data to all fields in form.
      *
-     * @param array $data
-     *
+     * @param  array  $data
      * @return $this
      */
     public function fill($data)
@@ -352,8 +344,7 @@ class NestedForm extends WidgetForm
     /**
      * Set `errorKey` `elementName` `elementClass` for fields inside hasmany fields.
      *
-     * @param Field $field
-     *
+     * @param  Field  $field
      * @return Field
      */
     protected function formatField(Field $field)
@@ -396,9 +387,8 @@ class NestedForm extends WidgetForm
     /**
      * Add nested-form fields dynamically.
      *
-     * @param string $method
-     * @param array  $arguments
-     *
+     * @param  string  $method
+     * @param  array  $arguments
      * @return mixed
      */
     public function __call($method, $arguments)

+ 2 - 4
src/Form/ResolveField.php

@@ -11,8 +11,7 @@ trait ResolveField
      *     ...
      * });
      *
-     * @param \Closure $callback
-     *
+     * @param  \Closure  $callback
      * @return $this
      */
     public function resolvingField(\Closure $callback)
@@ -28,8 +27,7 @@ trait ResolveField
     }
 
     /**
-     * @param Field $field
-     *
+     * @param  Field  $field
      * @return void
      */
     protected function callResolvingFieldCallbacks(Field $field)

+ 56 - 59
src/Form/Row.php

@@ -10,56 +10,56 @@ use Illuminate\Support\Collection;
 /**
  * Class Row.
  *
- * @method Field\Text                   text($column, $label = '')
- * @method Field\Checkbox               checkbox($column, $label = '')
- * @method Field\Radio                  radio($column, $label = '')
- * @method Field\Select                 select($column, $label = '')
- * @method Field\MultipleSelect         multipleSelect($column, $label = '')
- * @method Field\Textarea               textarea($column, $label = '')
- * @method Field\Hidden                 hidden($column, $label = '')
- * @method Field\Id                     id($column, $label = '')
- * @method Field\Ip                     ip($column, $label = '')
- * @method Field\Url                    url($column, $label = '')
- * @method Field\Email                  email($column, $label = '')
- * @method Field\Mobile                 mobile($column, $label = '')
- * @method Field\Slider                 slider($column, $label = '')
- * @method Field\Map                    map($latitude, $longitude, $label = '')
- * @method Field\Editor                 editor($column, $label = '')
- * @method Field\Date                   date($column, $label = '')
- * @method Field\Datetime               datetime($column, $label = '')
- * @method Field\Time                   time($column, $label = '')
- * @method Field\Year                   year($column, $label = '')
- * @method Field\Month                  month($column, $label = '')
- * @method Field\DateRange              dateRange($start, $end, $label = '')
- * @method Field\DateTimeRange          datetimeRange($start, $end, $label = '')
- * @method Field\TimeRange              timeRange($start, $end, $label = '')
- * @method Field\Number                 number($column, $label = '')
- * @method Field\Currency               currency($column, $label = '')
- * @method Field\SwitchField            switch ($column, $label = '')
- * @method Field\Display                display($column, $label = '')
- * @method Field\Rate                   rate($column, $label = '')
- * @method Field\Divide                 divider()
- * @method Field\Password               password($column, $label = '')
- * @method Field\Decimal                decimal($column, $label = '')
- * @method Field\Html                   html($html, $label = '')
- * @method Field\Tags                   tags($column, $label = '')
- * @method Field\Icon                   icon($column, $label = '')
- * @method Field\Embeds                 embeds($column, $label = '')
- * @method Field\Captcha                captcha()
- * @method Field\Listbox                listbox($column, $label = '')
- * @method Field\File                   file($column, $label = '')
- * @method Field\Image                  image($column, $label = '')
- * @method Field\MultipleFile           multipleFile($column, $label = '')
- * @method Field\MultipleImage          multipleImage($column, $label = '')
- * @method Field\HasMany                hasMany($column, $labelOrCallback, $callback = null)
- * @method Field\Tree                   tree($column, $label = '')
- * @method Field\Table                  table($column, $labelOrCallback, $callback = null)
- * @method Field\ListField              list($column, $label = '')
- * @method Field\Timezone               timezone($column, $label = '')
- * @method Field\KeyValue               keyValue($column, $label = '')
- * @method Field\Tel                    tel($column, $label = '')
- * @method Field\Markdown               markdown($column, $label = '')
- * @method Field\Range                  range($start, $end, $label = '')
+ * @method Field\Text text($column, $label = '')
+ * @method Field\Checkbox checkbox($column, $label = '')
+ * @method Field\Radio radio($column, $label = '')
+ * @method Field\Select select($column, $label = '')
+ * @method Field\MultipleSelect multipleSelect($column, $label = '')
+ * @method Field\Textarea textarea($column, $label = '')
+ * @method Field\Hidden hidden($column, $label = '')
+ * @method Field\Id id($column, $label = '')
+ * @method Field\Ip ip($column, $label = '')
+ * @method Field\Url url($column, $label = '')
+ * @method Field\Email email($column, $label = '')
+ * @method Field\Mobile mobile($column, $label = '')
+ * @method Field\Slider slider($column, $label = '')
+ * @method Field\Map map($latitude, $longitude, $label = '')
+ * @method Field\Editor editor($column, $label = '')
+ * @method Field\Date date($column, $label = '')
+ * @method Field\Datetime datetime($column, $label = '')
+ * @method Field\Time time($column, $label = '')
+ * @method Field\Year year($column, $label = '')
+ * @method Field\Month month($column, $label = '')
+ * @method Field\DateRange dateRange($start, $end, $label = '')
+ * @method Field\DateTimeRange datetimeRange($start, $end, $label = '')
+ * @method Field\TimeRange timeRange($start, $end, $label = '')
+ * @method Field\Number number($column, $label = '')
+ * @method Field\Currency currency($column, $label = '')
+ * @method Field\SwitchField switch ($column, $label = '')
+ * @method Field\Display display($column, $label = '')
+ * @method Field\Rate rate($column, $label = '')
+ * @method Field\Divide divider()
+ * @method Field\Password password($column, $label = '')
+ * @method Field\Decimal decimal($column, $label = '')
+ * @method Field\Html html($html, $label = '')
+ * @method Field\Tags tags($column, $label = '')
+ * @method Field\Icon icon($column, $label = '')
+ * @method Field\Embeds embeds($column, $label = '')
+ * @method Field\Captcha captcha()
+ * @method Field\Listbox listbox($column, $label = '')
+ * @method Field\File file($column, $label = '')
+ * @method Field\Image image($column, $label = '')
+ * @method Field\MultipleFile multipleFile($column, $label = '')
+ * @method Field\MultipleImage multipleImage($column, $label = '')
+ * @method Field\HasMany hasMany($column, $labelOrCallback, $callback = null)
+ * @method Field\Tree tree($column, $label = '')
+ * @method Field\Table table($column, $labelOrCallback, $callback = null)
+ * @method Field\ListField list($column, $label = '')
+ * @method Field\Timezone timezone($column, $label = '')
+ * @method Field\KeyValue keyValue($column, $label = '')
+ * @method Field\Tel tel($column, $label = '')
+ * @method Field\Markdown markdown($column, $label = '')
+ * @method Field\Range range($start, $end, $label = '')
  */
 class Row implements Renderable
 {
@@ -99,8 +99,8 @@ class Row implements Renderable
     /**
      * Row constructor.
      *
-     * @param \Closure        $callback
-     * @param Form|WidgetForm $form
+     * @param  \Closure  $callback
+     * @param  Form|WidgetForm  $form
      */
     public function __construct(\Closure $callback, $form)
     {
@@ -125,8 +125,7 @@ class Row implements Renderable
     /**
      * If the form horizontal layout.
      *
-     * @param bool $value
-     *
+     * @param  bool  $value
      * @return $this
      */
     public function horizontal(bool $value = true)
@@ -164,8 +163,7 @@ class Row implements Renderable
     /**
      * Set width for a incomming field.
      *
-     * @param int $width
-     *
+     * @param  int  $width
      * @return $this
      */
     public function width($width = 12)
@@ -188,9 +186,8 @@ class Row implements Renderable
     /**
      * Add field.
      *
-     * @param string $method
-     * @param array  $arguments
-     *
+     * @param  string  $method
+     * @param  array  $arguments
      * @return Field|void
      */
     public function __call($method, $arguments)

+ 8 - 9
src/Form/Tab.php

@@ -37,7 +37,7 @@ class Tab
     /**
      * Tab constructor.
      *
-     * @param Form|WidgetForm $form
+     * @param  Form|WidgetForm  $form
      */
     public function __construct($form)
     {
@@ -49,11 +49,10 @@ class Tab
     /**
      * Append a tab section.
      *
-     * @param string   $title
-     * @param \Closure $content
-     * @param bool     $active
-     * @param string   $id
-     *
+     * @param  string  $title
+     * @param  \Closure  $content
+     * @param  bool  $active
+     * @param  string  $id
      * @return $this
      */
     public function append($title, \Closure $content, bool $active = false, ?string $id = null)
@@ -122,8 +121,8 @@ class Tab
     /**
      * Set true for some one tab by title or id.
      *
-     * @param string $value
-     * @param string $field
+     * @param  string  $value
+     * @param  string  $field
      */
     public function active(string $value, string $field = 'title')
     {
@@ -139,7 +138,7 @@ class Tab
     /**
      * Set true for some one tab by key.
      *
-     * @param int $index
+     * @param  int  $index
      */
     public function activeByIndex(int $index = 0)
     {

+ 5 - 9
src/Form/Tools.php

@@ -38,7 +38,7 @@ class Tools implements Renderable
     /**
      * Create a new Tools instance.
      *
-     * @param Builder $builder
+     * @param  Builder  $builder
      */
     public function __construct(Builder $builder)
     {
@@ -50,8 +50,7 @@ class Tools implements Renderable
     /**
      * Append a tools.
      *
-     * @param string|\Closure|Renderable|Htmlable|AbstractTool $tool
-     *
+     * @param  string|\Closure|Renderable|Htmlable|AbstractTool  $tool
      * @return $this
      */
     public function append($tool)
@@ -66,8 +65,7 @@ class Tools implements Renderable
     /**
      * Prepend a tool.
      *
-     * @param string|\Closure|Renderable|Htmlable|AbstractTool $tool
-     *
+     * @param  string|\Closure|Renderable|Htmlable|AbstractTool  $tool
      * @return $this
      */
     public function prepend($tool)
@@ -80,8 +78,7 @@ class Tools implements Renderable
     }
 
     /**
-     * @param mixed $tool
-     *
+     * @param  mixed  $tool
      * @return void
      */
     protected function prepareTool($tool)
@@ -226,8 +223,7 @@ HTML;
     /**
      * Render custom tools.
      *
-     * @param Collection $tools
-     *
+     * @param  Collection  $tools
      * @return mixed
      */
     protected function renderCustomTools($tools)

+ 40 - 73
src/Grid.php

@@ -194,8 +194,8 @@ class Grid
      *
      * Grid constructor.
      *
-     * @param Repository|\Illuminate\Database\Eloquent\Model|Builder|null $repository
-     * @param null|\Closure                                       $builder
+     * @param  Repository|\Illuminate\Database\Eloquent\Model|Builder|null  $repository
+     * @param  null|\Closure  $builder
      */
     public function __construct($repository = null, ?\Closure $builder = null, $request = null)
     {
@@ -232,8 +232,7 @@ class Grid
     /**
      * Set primary key name.
      *
-     * @param string|array $name
-     *
+     * @param  string|array  $name
      * @return $this
      */
     public function setKeyName($name)
@@ -256,9 +255,8 @@ class Grid
     /**
      * Add column to Grid.
      *
-     * @param string $name
-     * @param string $label
-     *
+     * @param  string  $name
+     * @param  string  $label
      * @return Column
      */
     public function column($name, $label = '')
@@ -269,8 +267,7 @@ class Grid
     /**
      * Add number column.
      *
-     * @param null|string $label
-     *
+     * @param  null|string  $label
      * @return Column
      */
     public function number(?string $label = null)
@@ -281,8 +278,7 @@ class Grid
     /**
      * 启用异步渲染功能.
      *
-     * @param bool $async
-     *
+     * @param  bool  $async
      * @return $this
      */
     public function async(bool $async = true)
@@ -326,8 +322,7 @@ class Grid
      * 1.$grid->columns(['name' => 'Name', 'email' => 'Email' ...]);
      * 2.$grid->columns('name', 'email' ...)
      *
-     * @param array $columns
-     *
+     * @param  array  $columns
      * @return Collection|Column[]|void
      */
     public function columns($columns = null)
@@ -360,8 +355,7 @@ class Grid
     /**
      * 删除列.
      *
-     * @param string|Column $column
-     *
+     * @param  string|Column  $column
      * @return $this
      */
     public function dropColumn($column)
@@ -379,9 +373,8 @@ class Grid
     /**
      * Add column to grid.
      *
-     * @param string $field
-     * @param string $label
-     *
+     * @param  string  $field
+     * @param  string  $label
      * @return Column
      */
     protected function addColumn($field = '', $label = '')
@@ -395,9 +388,8 @@ class Grid
     }
 
     /**
-     * @param string $field
-     * @param string $label
-     *
+     * @param  string  $field
+     * @param  string  $label
      * @return Column
      */
     public function prependColumn($field = '', $label = '')
@@ -411,9 +403,8 @@ class Grid
     }
 
     /**
-     * @param string $field
-     * @param string $label
-     *
+     * @param  string  $field
+     * @param  string  $label
      * @return Column
      */
     public function newColumn($field = '', $label = '')
@@ -451,8 +442,7 @@ class Grid
     }
 
     /**
-     * @param string|array $class
-     *
+     * @param  string|array  $class
      * @return $this
      */
     public function addTableClass($class)
@@ -527,8 +517,7 @@ class Grid
     /**
      * Build the grid rows.
      *
-     * @param Collection $data
-     *
+     * @param  Collection  $data
      * @return void
      */
     protected function buildRows($data)
@@ -569,8 +558,7 @@ class Grid
     }
 
     /**
-     * @param string $key
-     *
+     * @param  string  $key
      * @return string
      */
     public function getEditUrl($key)
@@ -579,8 +567,7 @@ class Grid
     }
 
     /**
-     * @param string $url
-     *
+     * @param  string  $url
      * @return string
      */
     public function urlWithConstraints(?string $url)
@@ -595,8 +582,7 @@ class Grid
     }
 
     /**
-     * @param \Closure $closure
-     *
+     * @param  \Closure  $closure
      * @return Grid\Tools\RowSelector
      */
     public function rowSelector()
@@ -626,9 +612,8 @@ class Grid
     }
 
     /**
-     * @param string $width
-     * @param string $height
-     *
+     * @param  string  $width
+     * @param  string  $height
      * @return $this
      */
     public function setDialogFormDimensions(string $width, string $height)
@@ -653,8 +638,7 @@ class Grid
     }
 
     /**
-     * @param bool $value
-     *
+     * @param  bool  $value
      * @return $this
      */
     public function withBorder(bool $value = true)
@@ -665,8 +649,7 @@ class Grid
     }
 
     /**
-     * @param bool $value
-     *
+     * @param  bool  $value
      * @return $this
      */
     public function tableCollapse(bool $value = true)
@@ -679,8 +662,7 @@ class Grid
     /**
      * 显示横轴滚动条.
      *
-     * @param bool $value
-     *
+     * @param  bool  $value
      * @return $this
      */
     public function scrollbar(bool $value = true)
@@ -693,8 +675,7 @@ class Grid
     /**
      * Set grid header.
      *
-     * @param Closure|string|Renderable $content
-     *
+     * @param  Closure|string|Renderable  $content
      * @return $this
      */
     public function header($content)
@@ -739,8 +720,7 @@ HTML;
     /**
      * Set grid footer.
      *
-     * @param Closure|string|Renderable $content
-     *
+     * @param  Closure|string|Renderable  $content
      * @return $this
      */
     public function footer($content)
@@ -769,9 +749,8 @@ HTML;
     /**
      * Get or set option for grid.
      *
-     * @param string|array $key
-     * @param mixed        $value
-     *
+     * @param  string|array  $key
+     * @param  mixed  $value
      * @return $this|mixed
      */
     public function option($key, $value = null)
@@ -849,8 +828,7 @@ HTML;
     }
 
     /**
-     * @param string $mode
-     *
+     * @param  string  $mode
      * @return $this
      */
     public function createMode(string $mode)
@@ -879,8 +857,7 @@ HTML;
     /**
      * Create a grid instance.
      *
-     * @param mixed ...$params
-     *
+     * @param  mixed  ...$params
      * @return $this
      */
     public static function make(...$params)
@@ -889,8 +866,7 @@ HTML;
     }
 
     /**
-     * @param Closure $closure
-     *
+     * @param  Closure  $closure
      * @return $this;
      */
     public function wrap(\Closure $closure)
@@ -911,8 +887,7 @@ HTML;
     /**
      * Add variables to grid view.
      *
-     * @param array $variables
-     *
+     * @param  array  $variables
      * @return $this
      */
     public function with(array $variables)
@@ -936,8 +911,7 @@ HTML;
     /**
      * Set a view to render.
      *
-     * @param string $view
-     *
+     * @param  string  $view
      * @return $this
      */
     public function view($view)
@@ -950,8 +924,7 @@ HTML;
     /**
      * Set grid title.
      *
-     * @param string $title
-     *
+     * @param  string  $title
      * @return $this
      */
     public function title($title)
@@ -964,8 +937,7 @@ HTML;
     /**
      * Set grid description.
      *
-     * @param string $description
-     *
+     * @param  string  $description
      * @return $this
      */
     public function description($description)
@@ -978,8 +950,7 @@ HTML;
     /**
      * Set resource path for grid.
      *
-     * @param string $path
-     *
+     * @param  string  $path
      * @return $this
      */
     public function setResource($path)
@@ -992,8 +963,7 @@ HTML;
     /**
      * 设置是否显示.
      *
-     * @param bool $value
-     *
+     * @param  bool  $value
      * @return $this
      */
     public function show(bool $value = true)
@@ -1006,8 +976,7 @@ HTML;
     /**
      * 是否显示横向滚动条.
      *
-     * @param bool $value
-     *
+     * @param  bool  $value
      * @return $this
      */
     public function scrollbarX(bool $value = true)
@@ -1102,8 +1071,7 @@ JS
     /**
      * Add column to grid.
      *
-     * @param string $name
-     *
+     * @param  string  $name
      * @return Column
      */
     public function __get($name)
@@ -1116,7 +1084,6 @@ JS
      *
      * @param $method
      * @param $arguments
-     *
      * @return Column
      */
     public function __call($method, $arguments)

+ 30 - 50
src/Grid/Column.php

@@ -185,8 +185,8 @@ class Column
     protected $conditions = [];
 
     /**
-     * @param string $name
-     * @param string $label
+     * @param  string  $name
+     * @param  string  $label
      */
     public function __construct($name, $label)
     {
@@ -224,7 +224,7 @@ class Column
     /**
      * Set grid instance for column.
      *
-     * @param Grid $grid
+     * @param  Grid  $grid
      */
     public function setGrid(Grid $grid)
     {
@@ -242,7 +242,7 @@ class Column
     /**
      * Set original data for column.
      *
-     * @param Collection $collection
+     * @param  Collection  $collection
      */
     public static function setOriginalGridModels(Collection $collection)
     {
@@ -258,8 +258,7 @@ class Column
     /**
      * Set width for column.
      *
-     * @param string $width
-     *
+     * @param  string  $width
      * @return $this|string
      */
     public function width(?string $width)
@@ -298,8 +297,7 @@ class Column
      *         ->end()
      *         ->modal()
      *
-     * @param \Closure $condition
-     *
+     * @param  \Closure  $condition
      * @return Column\Condition
      */
     public function if(\Closure $condition = null)
@@ -314,8 +312,7 @@ class Column
     /**
      * Set column attributes.
      *
-     * @param array $attributes
-     *
+     * @param  array  $attributes
      * @return $this
      */
     public function setAttributes(array $attributes = [])
@@ -328,8 +325,7 @@ class Column
     /**
      * Get column attributes.
      *
-     * @param string $name
-     *
+     * @param  string  $name
      * @return mixed
      */
     public function getAttributes()
@@ -350,8 +346,7 @@ class Column
     /**
      * Set style of this column.
      *
-     * @param string $style
-     *
+     * @param  string  $style
      * @return Column
      */
     public function style($style)
@@ -370,7 +365,7 @@ class Column
     }
 
     /**
-     * @param array|Model $model
+     * @param  array|Model  $model
      */
     public function setOriginalModel($model)
     {
@@ -408,8 +403,7 @@ class Column
     /**
      * Format label.
      *
-     * @param string $label
-     *
+     * @param  string  $label
      * @return mixed
      */
     protected function formatLabel($label)
@@ -428,8 +422,7 @@ class Column
     }
 
     /**
-     * @param string $label
-     *
+     * @param  string  $label
      * @return $this
      */
     public function setLabel($label)
@@ -442,9 +435,8 @@ class Column
     /**
      * Add a display callback.
      *
-     * @param \Closure|string $callback
-     * @param array           $params
-     *
+     * @param  \Closure|string  $callback
+     * @param  array  $params
      * @return $this
      */
     public function display($callback, ...$params)
@@ -465,8 +457,7 @@ class Column
     }
 
     /**
-     * @param array $callbacks
-     *
+     * @param  array  $callbacks
      * @return void
      */
     public function setDisplayCallbacks(array $callbacks)
@@ -485,8 +476,7 @@ class Column
     /**
      * Call all of the "display" callbacks column.
      *
-     * @param mixed $value
-     *
+     * @param  mixed  $value
      * @return mixed
      */
     protected function callDisplayCallbacks($value)
@@ -520,8 +510,7 @@ class Column
     /**
      * Set original grid data to column.
      *
-     * @param Closure $callback
-     *
+     * @param  Closure  $callback
      * @return Closure
      */
     protected function bindOriginalRowModel(Closure $callback)
@@ -532,7 +521,7 @@ class Column
     /**
      * Fill all data to every column.
      *
-     * @param \Illuminate\Support\Collection $data
+     * @param  \Illuminate\Support\Collection  $data
      */
     public function fill($data)
     {
@@ -577,8 +566,7 @@ class Column
     /**
      * 把模型转化为数组.
      *
-     * @param array|Model $row
-     *
+     * @param  array|Model  $row
      * @return mixed
      */
     protected function convertModelToArray(&$row)
@@ -609,8 +597,7 @@ class Column
     /**
      * Convert characters to HTML entities recursively.
      *
-     * @param array|string $item
-     *
+     * @param  array|string  $item
      * @return mixed
      */
     protected function htmlEntityEncode($item)
@@ -637,9 +624,8 @@ class Column
     /**
      * Find a displayer to display column.
      *
-     * @param string $abstract
-     * @param array  $arguments
-     *
+     * @param  string  $abstract
+     * @param  array  $arguments
      * @return Column
      */
     protected function resolveDisplayer($abstract, $arguments)
@@ -654,9 +640,8 @@ class Column
     /**
      * Call Illuminate/Support displayer.
      *
-     * @param string $abstract
-     * @param array  $arguments
-     *
+     * @param  string  $abstract
+     * @param  array  $arguments
      * @return Column
      */
     protected function callSupportDisplayer($abstract, $arguments)
@@ -677,9 +662,8 @@ class Column
     /**
      * Call Builtin displayer.
      *
-     * @param string $abstract
-     * @param array  $arguments
-     *
+     * @param  string  $abstract
+     * @param  array  $arguments
      * @return Column
      */
     protected function callBuiltinDisplayer($abstract, $arguments)
@@ -708,8 +692,7 @@ class Column
     /**
      * Set column title attributes.
      *
-     * @param array $attributes
-     *
+     * @param  array  $attributes
      * @return $this
      */
     public function setHeaderAttributes(array $attributes = [])
@@ -722,8 +705,7 @@ class Column
     /**
      * Set column title default attributes.
      *
-     * @param array $attributes
-     *
+     * @param  array  $attributes
      * @return $this
      */
     public function setDefaultHeaderAttribute(array $attributes)
@@ -755,7 +737,6 @@ class Column
     /**
      * @param  mixed  $value
      * @param  callable  $callback
-     *
      * @return $this|mixed
      */
     public function when($value, $callback)
@@ -772,9 +753,8 @@ class Column
      *
      * Allow fluent calls on the Column object.
      *
-     * @param string $method
-     * @param array  $arguments
-     *
+     * @param  string  $method
+     * @param  array  $arguments
      * @return $this
      */
     public function __call($method, $arguments)

+ 11 - 18
src/Grid/Column/Filter.php

@@ -36,7 +36,7 @@ abstract class Filter implements Renderable
     protected $display = true;
 
     /**
-     * @param Column $column
+     * @param  Column  $column
      */
     public function setParent(Column $column)
     {
@@ -64,8 +64,7 @@ abstract class Filter implements Renderable
     }
 
     /**
-     * @param \Closure $callback
-     *
+     * @param  \Closure  $callback
      * @return $this
      */
     public function resolving(\Closure $callback)
@@ -76,8 +75,7 @@ abstract class Filter implements Renderable
     }
 
     /**
-     * @param string $name
-     *
+     * @param  string  $name
      * @return $this
      */
     public function setColumnName(string $name)
@@ -118,8 +116,7 @@ abstract class Filter implements Renderable
     /**
      * Get filter value of this column.
      *
-     * @param string $default
-     *
+     * @param  string  $default
      * @return array|\Illuminate\Http\Request|string
      */
     public function value($default = '')
@@ -128,10 +125,9 @@ abstract class Filter implements Renderable
     }
 
     /**
-     * @param mixed $model
-     * @param string $query
+     * @param  mixed  $model
+     * @param  string  $query
      * @param mixed array $params
-     *
      * @return void
      */
     protected function withQuery($model, string $query, array $params)
@@ -196,8 +192,7 @@ HMLT;
     }
 
     /**
-     * @param string $key
-     *
+     * @param  string  $key
      * @return array|null|string
      */
     protected function trans($key)
@@ -206,8 +201,7 @@ HMLT;
     }
 
     /**
-     * @param bool $value
-     *
+     * @param  bool  $value
      * @return $this
      */
     public function display(bool $value)
@@ -236,8 +230,8 @@ HMLT;
     /**
      * Add a query binding.
      *
-     * @param mixed $value
-     * @param Model $model
+     * @param  mixed  $value
+     * @param  Model  $model
      */
     public function addBinding($value, Model $model)
     {
@@ -253,8 +247,7 @@ HMLT;
     }
 
     /**
-     * @param array ...$params
-     *
+     * @param  array  ...$params
      * @return static
      */
     public static function make(...$params)

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

@@ -66,8 +66,7 @@ class Between extends Filter
     }
 
     /**
-     * @param string $format
-     *
+     * @param  string  $format
      * @return $this
      */
     protected function setDateFormat($format)
@@ -82,8 +81,8 @@ class Between extends Filter
     /**
      * Add a binding to the query.
      *
-     * @param mixed $value
-     * @param Model $model
+     * @param  mixed  $value
+     * @param  Model  $model
      */
     public function addBinding($value, Model $model)
     {

+ 4 - 5
src/Grid/Column/Filter/Equal.php

@@ -18,7 +18,7 @@ class Equal extends Filter
     /**
      * InputFilter constructor.
      *
-     * @param string $type
+     * @param  string  $type
      */
     public function __construct(?string $placeholder = null)
     {
@@ -58,8 +58,7 @@ class Equal extends Filter
     }
 
     /**
-     * @param string $format
-     *
+     * @param  string  $format
      * @return $this
      */
     protected function setDateFormat($format)
@@ -88,8 +87,8 @@ class Equal extends Filter
     /**
      * Add a binding to the query.
      *
-     * @param string     $value
-     * @param Model|null $model
+     * @param  string  $value
+     * @param  Model|null  $model
      */
     public function addBinding($value, Model $model)
     {

+ 2 - 2
src/Grid/Column/Filter/Gt.php

@@ -9,8 +9,8 @@ class Gt extends Equal
     /**
      * Add a binding to the query.
      *
-     * @param string     $value
-     * @param Model|null $model
+     * @param  string  $value
+     * @param  Model|null  $model
      */
     public function addBinding($value, Model $model)
     {

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

@@ -17,7 +17,7 @@ class In extends Filter
     /**
      * CheckFilter constructor.
      *
-     * @param array $options
+     * @param  array  $options
      */
     public function __construct(array $options)
     {
@@ -32,8 +32,8 @@ class In extends Filter
     /**
      * Add a binding to the query.
      *
-     * @param array $value
-     * @param Model $model
+     * @param  array  $value
+     * @param  Model  $model
      */
     public function addBinding($value, Model $model)
     {

+ 2 - 4
src/Grid/Column/Filter/Input.php

@@ -27,8 +27,7 @@ JS;
     /**
      * Set input placeholder.
      *
-     * @param null|string $placeholder
-     *
+     * @param  null|string  $placeholder
      * @return $this
      */
     public function placeholder(?string $placeholder)
@@ -67,8 +66,7 @@ HTML;
     }
 
     /**
-     * @param string|\Closure $valueKey
-     *
+     * @param  string|\Closure  $valueKey
      * @return $this
      */
     public function valueFilter($valueKey = null)

+ 2 - 2
src/Grid/Column/Filter/Like.php

@@ -9,8 +9,8 @@ class Like extends Equal
     /**
      * Add a binding to the query.
      *
-     * @param string     $value
-     * @param Model|null $model
+     * @param  string  $value
+     * @param  Model|null  $model
      */
     public function addBinding($value, Model $model)
     {

+ 2 - 2
src/Grid/Column/Filter/Lt.php

@@ -9,8 +9,8 @@ class Lt extends Equal
     /**
      * Add a binding to the query.
      *
-     * @param string     $value
-     * @param Model|null $model
+     * @param  string  $value
+     * @param  Model|null  $model
      */
     public function addBinding($value, Model $model)
     {

+ 2 - 2
src/Grid/Column/Filter/Ngt.php

@@ -9,8 +9,8 @@ class Ngt extends Equal
     /**
      * Add a binding to the query.
      *
-     * @param string     $value
-     * @param Model|null $model
+     * @param  string  $value
+     * @param  Model|null  $model
      */
     public function addBinding($value, Model $model)
     {

+ 2 - 2
src/Grid/Column/Filter/Nlt.php

@@ -9,8 +9,8 @@ class Nlt extends Equal
     /**
      * Add a binding to the query.
      *
-     * @param string     $value
-     * @param Model|null $model
+     * @param  string  $value
+     * @param  Model|null  $model
      */
     public function addBinding($value, Model $model)
     {

+ 2 - 2
src/Grid/Column/Filter/StartWith.php

@@ -9,8 +9,8 @@ class StartWith extends Equal
     /**
      * Add a binding to the query.
      *
-     * @param string     $value
-     * @param Model|null $model
+     * @param  string  $value
+     * @param  Model|null  $model
      */
     public function addBinding($value, Model $model)
     {

+ 19 - 32
src/Grid/Column/HasDisplayers.php

@@ -20,9 +20,8 @@ trait HasDisplayers
     /**
      * Display using display abstract.
      *
-     * @param string $abstract
-     * @param array  $arguments
-     *
+     * @param  string  $abstract
+     * @param  array  $arguments
      * @return Column
      */
     public function displayUsing($abstract, $arguments = [])
@@ -42,9 +41,8 @@ trait HasDisplayers
     /**
      * Display column using array value map.
      *
-     * @param array $values
-     * @param null  $default
-     *
+     * @param  array  $values
+     * @param  null  $default
      * @return $this
      */
     public function using(array $values, $default = null)
@@ -59,8 +57,7 @@ trait HasDisplayers
     }
 
     /**
-     * @param string $color
-     *
+     * @param  string  $color
      * @return $this
      */
     public function bold($color = null)
@@ -79,8 +76,7 @@ trait HasDisplayers
     /**
      * Display column with "long2ip".
      *
-     * @param null $default
-     *
+     * @param  null  $default
      * @return $this
      */
     public function long2ip($default = null)
@@ -97,8 +93,7 @@ trait HasDisplayers
     /**
      * Render this column with the given view.
      *
-     * @param string $view
-     *
+     * @param  string  $view
      * @return $this
      */
     public function view($view)
@@ -113,8 +108,7 @@ trait HasDisplayers
     }
 
     /**
-     * @param string $val
-     *
+     * @param  string  $val
      * @return $this
      */
     public function prepend($val)
@@ -137,8 +131,7 @@ trait HasDisplayers
     }
 
     /**
-     * @param string $val
-     *
+     * @param  string  $val
      * @return $this
      */
     public function append($val)
@@ -163,8 +156,7 @@ trait HasDisplayers
     /**
      * Split a string by string.
      *
-     * @param string $d
-     *
+     * @param  string  $d
      * @return $this
      */
     public function explode(string $d = ',')
@@ -181,8 +173,7 @@ trait HasDisplayers
     /**
      * Display the fields in the email format as gavatar.
      *
-     * @param int $size
-     *
+     * @param  int  $size
      * @return $this
      */
     public function gravatar($size = 30)
@@ -201,9 +192,8 @@ trait HasDisplayers
     /**
      * Add a `dot` before column text.
      *
-     * @param array  $options
-     * @param string $default
-     *
+     * @param  array  $options
+     * @param  string  $default
      * @return $this
      */
     public function dot($options = [], $default = 'default')
@@ -222,10 +212,9 @@ trait HasDisplayers
     /**
      * Show children of current node.
      *
-     * @param bool $showAll
-     * @param bool $sortable
-     * @param mixed $defaultParentId
-     *
+     * @param  bool  $showAll
+     * @param  bool  $sortable
+     * @param  mixed  $defaultParentId
      * @return $this
      */
     public function tree(bool $showAll = false, bool $sortable = true, $defaultParentId = null)
@@ -249,8 +238,7 @@ trait HasDisplayers
     /**
      * Display column using a grid row action.
      *
-     * @param string $action
-     *
+     * @param  string  $action
      * @return $this
      */
     public function action($action)
@@ -275,9 +263,8 @@ trait HasDisplayers
     /**
      * Display column as boolean , `✓` for true, and `✗` for false.
      *
-     * @param array $map
-     * @param bool  $default
-     *
+     * @param  array  $map
+     * @param  bool  $default
      * @return $this
      */
     public function bool(array $map = [], $default = false)

+ 9 - 14
src/Grid/Column/HasHeader.php

@@ -27,8 +27,7 @@ trait HasHeader
     /**
      * Add contents to column header.
      *
-     * @param string|Renderable|Htmlable $header
-     *
+     * @param  string|Renderable|Htmlable  $header
      * @return $this
      */
     public function addHeader($header)
@@ -46,9 +45,8 @@ trait HasHeader
     /**
      * Add a column sortable to column header.
      *
-     * @param string $columnName
-     * @param string $cast
-     *
+     * @param  string  $columnName
+     * @param  string  $cast
      * @return $this
      */
     public function sortable($columnName = null, $cast = null)
@@ -78,8 +76,7 @@ trait HasHeader
      *          Grid\Column\Filter\Equal::make(__('admin.created_at'))->date()
      *      );
      *
-     * @param Grid\Column\Filter|string $filter
-     *
+     * @param  Grid\Column\Filter|string  $filter
      * @return $this
      */
     public function filter($filter = null)
@@ -98,8 +95,7 @@ trait HasHeader
     }
 
     /**
-     * @param string|\Closure $valueKey
-     *
+     * @param  string|\Closure  $valueKey
      * @return $this
      */
     public function filterByValue($valueKey = null)
@@ -114,10 +110,9 @@ trait HasHeader
     /**
      * Add a help tooltip to column header.
      *
-     * @param string|\Closure $message
-     * @param null|string     $style     'green', 'blue', 'red', 'purple'
-     * @param null|string     $placement 'bottom', 'left', 'right', 'top'
-     *
+     * @param  string|\Closure  $message
+     * @param  null|string  $style  'green', 'blue', 'red', 'purple'
+     * @param  null|string  $placement  'bottom', 'left', 'right', 'top'
      * @return $this
      */
     public function help($message, ?string $style = null, ?string $placement = null)
@@ -128,7 +123,7 @@ trait HasHeader
     /**
      * Add a binding based on filter to the model query.
      *
-     * @param Model $model
+     * @param  Model  $model
      */
     public function bindFilterQuery(Model $model)
     {

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

@@ -26,7 +26,7 @@ class Help implements Renderable
     /**
      * Help constructor.
      *
-     * @param string $message
+     * @param  string  $message
      */
     public function __construct($message = '', ?string $style = null, ?string $placement = null)
     {

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

@@ -34,9 +34,9 @@ class Sorter implements Renderable
     /**
      * Sorter constructor.
      *
-     * @param Grid $grid
-     * @param string $columnName
-     * @param string $cast
+     * @param  Grid  $grid
+     * @param  string  $columnName
+     * @param  string  $cast
      */
     public function __construct(Grid $grid, $columnName, $cast)
     {

+ 4 - 6
src/Grid/ComplexHeader.php

@@ -85,8 +85,7 @@ class ComplexHeader extends Widget
     }
 
     /**
-     * @param string $html
-     *
+     * @param  string  $html
      * @return $this
      */
     public function append($html)
@@ -97,10 +96,9 @@ class ComplexHeader extends Widget
     }
 
     /**
-     * @param string|\Closure $message
-     * @param null|string     $style     'green', 'blue', 'red', 'purple'
-     * @param null|string     $placement 'bottom', 'left', 'right', 'top'
-     *
+     * @param  string|\Closure  $message
+     * @param  null|string  $style  'green', 'blue', 'red', 'purple'
+     * @param  null|string  $placement  'bottom', 'left', 'right', 'top'
      * @return $this
      */
     public function help($message, ?string $style = null, ?string $placement = null)

+ 2 - 3
src/Grid/Concerns/CanFixColumns.php

@@ -15,9 +15,8 @@ trait CanFixColumns
     protected $fixColumns;
 
     /**
-     * @param int $head
-     * @param int $tail
-     *
+     * @param  int  $head
+     * @param  int  $tail
      * @return FixColumns
      */
     public function fixColumns(int $head, int $tail = -1)

+ 2 - 4
src/Grid/Concerns/CanHidesColumns.php

@@ -25,8 +25,7 @@ trait CanHidesColumns
     /**
      * Remove column selector on grid.
      *
-     * @param bool $disable
-     *
+     * @param  bool  $disable
      * @return $this|mixed
      */
     public function disableColumnSelector(bool $disable = true)
@@ -65,8 +64,7 @@ trait CanHidesColumns
     /**
      * Setting default shown columns on grid.
      *
-     * @param array|string $columns
-     *
+     * @param  array|string  $columns
      * @return $this
      */
     public function hideColumns($columns)

+ 8 - 16
src/Grid/Concerns/HasActions.php

@@ -16,8 +16,7 @@ trait HasActions
     protected $actionsCallback = [];
 
     /**
-     * @param string $actionClass
-     *
+     * @param  string  $actionClass
      * @return $this
      */
     public function setActionClass(string $actionClass)
@@ -48,8 +47,7 @@ trait HasActions
     /**
      * Set grid action callback or add actions.
      *
-     * @param Closure|array|string|Renderable|Grid\RowAction $callback
-     *
+     * @param  Closure|array|string|Renderable|Grid\RowAction  $callback
      * @return $this
      */
     public function actions($callback)
@@ -115,8 +113,7 @@ trait HasActions
     /**
      * Disable edit.
      *
-     * @param bool $disable
-     *
+     * @param  bool  $disable
      * @return $this
      */
     public function disableEditButton(bool $disable = true)
@@ -129,8 +126,7 @@ trait HasActions
     /**
      * Show edit.
      *
-     * @param bool $val
-     *
+     * @param  bool  $val
      * @return $this
      */
     public function showEditButton(bool $val = true)
@@ -163,8 +159,7 @@ trait HasActions
     /**
      * Disable view action.
      *
-     * @param bool $disable
-     *
+     * @param  bool  $disable
      * @return $this
      */
     public function disableViewButton(bool $disable = true)
@@ -177,8 +172,7 @@ trait HasActions
     /**
      * Show view action.
      *
-     * @param bool $disable
-     *
+     * @param  bool  $disable
      * @return $this
      */
     public function showViewButton(bool $val = true)
@@ -189,8 +183,7 @@ trait HasActions
     /**
      * Disable delete.
      *
-     * @param bool $disable
-     *
+     * @param  bool  $disable
      * @return $this
      */
     public function disableDeleteButton(bool $disable = true)
@@ -203,8 +196,7 @@ trait HasActions
     /**
      * Show delete button.
      *
-     * @param bool $disable
-     *
+     * @param  bool  $disable
      * @return $this
      */
     public function showDeleteButton(bool $val = true)

+ 3 - 4
src/Grid/Concerns/HasComplexHeaders.php

@@ -17,10 +17,9 @@ trait HasComplexHeaders
     /**
      * Merge cells.
      *
-     * @param string $column
-     * @param array  $columnNames
-     * @param string $label
-     *
+     * @param  string  $column
+     * @param  array  $columnNames
+     * @param  string  $label
      * @return ComplexHeader
      */
     public function combine(string $column, array $columnNames, string $label = null)

+ 4 - 5
src/Grid/Concerns/HasEvents.php

@@ -15,9 +15,8 @@ trait HasEvents
     /**
      * 监听事件.
      *
-     * @param string $class
-     *
-     * @param \Closure $callback
+     * @param  string  $class
+     * @param  \Closure  $callback
      */
     public function listen(string $class, \Closure $callback)
     {
@@ -33,7 +32,7 @@ trait HasEvents
     /**
      * 触发事件.
      *
-     * @param \Dcat\Admin\Grid\Events\Event $event
+     * @param  \Dcat\Admin\Grid\Events\Event  $event
      */
     public function fire(Events\Event $event)
     {
@@ -47,7 +46,7 @@ trait HasEvents
     /**
      * 只触发一次.
      *
-     * @param \Dcat\Admin\Grid\Events\Event $event
+     * @param  \Dcat\Admin\Grid\Events\Event  $event
      */
     public function fireOnce(Events\Event $event)
     {

+ 5 - 9
src/Grid/Concerns/HasExporter.php

@@ -27,8 +27,7 @@ trait HasExporter
     /**
      * Set exporter driver for Grid to export.
      *
-     * @param string|Grid\Exporters\AbstractExporter|array $exporterDriver
-     *
+     * @param  string|Grid\Exporters\AbstractExporter|array  $exporterDriver
      * @return Exporter
      */
     public function export($exporterDriver = null)
@@ -54,8 +53,7 @@ trait HasExporter
     /**
      * Handle export request.
      *
-     * @param bool $forceExport
-     *
+     * @param  bool  $forceExport
      * @return mixed
      */
     public function handleExportRequest($forceExport = false)
@@ -96,8 +94,7 @@ trait HasExporter
     }
 
     /**
-     * @param string $scope
-     *
+     * @param  string  $scope
      * @return AbstractExporter
      */
     protected function resolveExportDriver($scope)
@@ -108,9 +105,8 @@ trait HasExporter
     /**
      * Get the export url.
      *
-     * @param int  $scope
-     * @param null $args
-     *
+     * @param  int  $scope
+     * @param  null  $args
      * @return string
      */
     public function exportUrl($scope = 1, $args = null)

+ 5 - 10
src/Grid/Concerns/HasFilter.php

@@ -30,8 +30,7 @@ trait HasFilter
     /**
      * Process the grid filter.
      *
-     * @param bool $toArray
-     *
+     * @param  bool  $toArray
      * @return Collection
      */
     public function processFilter()
@@ -49,8 +48,7 @@ trait HasFilter
     /**
      * Get or set the grid filter.
      *
-     * @param Closure $callback
-     *
+     * @param  Closure  $callback
      * @return $this|Grid\Filter
      */
     public function filter(Closure $callback = null)
@@ -105,8 +103,7 @@ trait HasFilter
     /**
      * Show grid filter.
      *
-     * @param bool $val
-     *
+     * @param  bool  $val
      * @return $this
      */
     public function showFilter(bool $val = true)
@@ -117,8 +114,7 @@ trait HasFilter
     /**
      * Disable filter button.
      *
-     * @param bool $disable
-     *
+     * @param  bool  $disable
      * @return $this
      */
     public function disableFilterButton(bool $disable = true)
@@ -131,8 +127,7 @@ trait HasFilter
     /**
      * Show filter button.
      *
-     * @param bool $val
-     *
+     * @param  bool  $val
      * @return $this
      */
     public function showFilterButton(bool $val = true)

+ 3 - 6
src/Grid/Concerns/HasNames.php

@@ -19,8 +19,7 @@ trait HasNames
     /**
      * Set name to grid.
      *
-     * @param string $name
-     *
+     * @param  string  $name
      * @return $this
      */
     public function setName($name)
@@ -44,8 +43,7 @@ trait HasNames
     /**
      * Retrieve an input item from the request.
      *
-     * @param string $key
-     *
+     * @param  string  $key
      * @return mixed
      */
     public function getRequestInput($key)
@@ -54,8 +52,7 @@ trait HasNames
     }
 
     /**
-     * @param string $key
-     *
+     * @param  string  $key
      * @return string
      */
     public function makeName($key)

+ 5 - 9
src/Grid/Concerns/HasPaginator.php

@@ -28,8 +28,7 @@ trait HasPaginator
     /**
      * Paginate the grid.
      *
-     * @param int $perPage
-     *
+     * @param  int  $perPage
      * @return void
      */
     public function paginate(int $perPage = 20)
@@ -42,8 +41,7 @@ trait HasPaginator
     /**
      * 是否使用 simplePaginate 方法分页.
      *
-     * @param bool $value
-     *
+     * @param  bool  $value
      * @return $this
      */
     public function simplePaginate(bool $value = true)
@@ -62,8 +60,7 @@ trait HasPaginator
     }
 
     /**
-     * @param string $paginator
-     *
+     * @param  string  $paginator
      * @return $this
      */
     public function setPaginatorClass(string $paginator)
@@ -102,7 +99,7 @@ trait HasPaginator
     /**
      * Set per-page options.
      *
-     * @param array $perPages
+     * @param  array  $perPages
      */
     public function perPages(array $perPages)
     {
@@ -144,8 +141,7 @@ trait HasPaginator
     /**
      * Show grid pagination.
      *
-     * @param bool $val
-     *
+     * @param  bool  $val
      * @return $this
      */
     public function showPagination(bool $val = true)

+ 1 - 2
src/Grid/Concerns/HasQuickCreate.php

@@ -13,8 +13,7 @@ trait HasQuickCreate
     protected $quickCreate;
 
     /**
-     * @param Closure $callback
-     *
+     * @param  Closure  $callback
      * @return $this
      */
     public function quickCreate(\Closure $callback)

+ 27 - 29
src/Grid/Concerns/HasQuickSearch.php

@@ -15,7 +15,7 @@ use Illuminate\Support\Str;
  * @property Collection $columns
  * @property Tools $tools
  *
- * @method  Model model()
+ * @method Model model()
  */
 trait HasQuickSearch
 {
@@ -31,7 +31,6 @@ trait HasQuickSearch
 
     /**
      * @param array|string|\Closure
-     *
      * @return Tools\QuickSearch
      */
     public function quickSearch($search = null)
@@ -135,7 +134,7 @@ trait HasQuickSearch
     /**
      * Add where bindings.
      *
-     * @param string $query
+     * @param  string  $query
      */
     protected function addWhereBindings($query)
     {
@@ -189,8 +188,7 @@ trait HasQuickSearch
     /**
      * Parse quick query bindings.
      *
-     * @param array $queries
-     *
+     * @param  array  $queries
      * @return array
      */
     protected function parseQueryBindings(array $queries)
@@ -229,10 +227,10 @@ trait HasQuickSearch
     /**
      * Add where like binding to model query.
      *
-     * @param mixed  $query
-     * @param string $column
-     * @param bool   $or
-     * @param string $pattern
+     * @param  mixed  $query
+     * @param  string  $column
+     * @param  bool  $or
+     * @param  string  $pattern
      */
     protected function addWhereLikeBinding($query, ?string $column, ?bool $or, ?string $pattern)
     {
@@ -245,11 +243,11 @@ trait HasQuickSearch
     /**
      * Add where date time function binding to model query.
      *
-     * @param mixed  $query
-     * @param string $column
-     * @param bool   $or
-     * @param string $function
-     * @param string $value
+     * @param  mixed  $query
+     * @param  string  $column
+     * @param  bool  $or
+     * @param  string  $function
+     * @param  string  $value
      */
     protected function addWhereDatetimeBinding($query, ?string $column, ?bool $or, ?string $function, ?string $value)
     {
@@ -261,11 +259,11 @@ trait HasQuickSearch
     /**
      * Add where in binding to the model query.
      *
-     * @param mixed  $query
-     * @param string $column
-     * @param bool   $or
-     * @param bool   $not
-     * @param string $values
+     * @param  mixed  $query
+     * @param  string  $column
+     * @param  bool  $or
+     * @param  bool  $not
+     * @param  string  $values
      */
     protected function addWhereInBinding($query, ?string $column, ?bool $or, ?bool $not, ?string $values)
     {
@@ -286,11 +284,11 @@ trait HasQuickSearch
     /**
      * Add where between binding to the model query.
      *
-     * @param mixed  $query
-     * @param string $column
-     * @param bool   $or
-     * @param string $start
-     * @param string $end
+     * @param  mixed  $query
+     * @param  string  $column
+     * @param  bool  $or
+     * @param  string  $start
+     * @param  string  $end
      */
     protected function addWhereBetweenBinding($query, ?string $column, ?bool $or, ?string $start, ?string $end)
     {
@@ -302,11 +300,11 @@ trait HasQuickSearch
     /**
      * Add where basic binding to the model query.
      *
-     * @param mixed  $query
-     * @param string $column
-     * @param bool   $or
-     * @param string $operator
-     * @param string $value
+     * @param  mixed  $query
+     * @param  string  $column
+     * @param  bool  $or
+     * @param  string  $operator
+     * @param  string  $value
      */
     protected function addWhereBasicBinding($query, ?string $column, ?bool $or, ?string $operator, ?string $value)
     {

Some files were not shown because too many files changed in this diff