Completed
Pull Request — master (#836)
by Iman
03:18
created
src/Grid/Model.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
     /**
241 241
      * Resolve perPage for pagination.
242 242
      *
243
-     * @param array|null $paginate
243
+     * @param Model $paginate
244 244
      *
245 245
      * @return array
246 246
      */
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
     /**
263 263
      * Find query by method name.
264 264
      *
265
-     * @param $method
265
+     * @param string $method
266 266
      *
267 267
      * @return static
268 268
      */
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
         $this->setSort();
195 195
         $this->setPaginate();
196 196
 
197
-        $this->queries->unique()->each(function ($query) {
197
+        $this->queries->unique()->each(function($query) {
198 198
             $this->model = call_user_func_array([$this->model, $query['method']], $query['arguments']);
199 199
         });
200 200
 
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
     {
219 219
         $paginate = $this->findQueryByMethod('paginate');
220 220
 
221
-        $this->queries = $this->queries->reject(function ($query) {
221
+        $this->queries = $this->queries->reject(function($query) {
222 222
             return $query['method'] == 'paginate';
223 223
         });
224 224
 
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
      */
269 269
     protected function findQueryByMethod($method)
270 270
     {
271
-        return $this->queries->first(function ($query) use ($method) {
271
+        return $this->queries->first(function($query) use ($method) {
272 272
             return $query['method'] == $method;
273 273
         });
274 274
     }
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
     {
314 314
         list($relationName, $relationColumn) = explode('.', $column);
315 315
 
316
-        if ($this->queries->contains(function ($query) use ($relationName) {
316
+        if ($this->queries->contains(function($query) use ($relationName) {
317 317
             return $query['method'] == 'with' && in_array($relationName, $query['arguments']);
318 318
         })) {
319 319
             $relation = $this->model->$relationName();
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
      */
343 343
     public function resetOrderBy()
344 344
     {
345
-        $this->queries = $this->queries->reject(function ($query) {
345
+        $this->queries = $this->queries->reject(function($query) {
346 346
             return $query['method'] == 'orderBy';
347 347
         });
348 348
     }
Please login to merge, or discard this patch.
migrations/2016_01_04_173148_create_admin_tables.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
     {
15 15
         $connection = config('admin.database.connection') ?: config('database.default');
16 16
 
17
-        Schema::connection($connection)->create(config('admin.database.users_table'), function (Blueprint $table) {
17
+        Schema::connection($connection)->create(config('admin.database.users_table'), function(Blueprint $table) {
18 18
             $table->increments('id');
19 19
             $table->string('username', 190)->unique();
20 20
             $table->string('password', 60);
@@ -23,21 +23,21 @@  discard block
 block discarded – undo
23 23
             $table->timestamps();
24 24
         });
25 25
 
26
-        Schema::connection($connection)->create(config('admin.database.roles_table'), function (Blueprint $table) {
26
+        Schema::connection($connection)->create(config('admin.database.roles_table'), function(Blueprint $table) {
27 27
             $table->increments('id');
28 28
             $table->string('name', 50)->unique();
29 29
             $table->string('slug', 50);
30 30
             $table->timestamps();
31 31
         });
32 32
 
33
-        Schema::connection($connection)->create(config('admin.database.permissions_table'), function (Blueprint $table) {
33
+        Schema::connection($connection)->create(config('admin.database.permissions_table'), function(Blueprint $table) {
34 34
             $table->increments('id');
35 35
             $table->string('name', 50)->unique();
36 36
             $table->string('slug', 50);
37 37
             $table->timestamps();
38 38
         });
39 39
 
40
-        Schema::connection($connection)->create(config('admin.database.menu_table'), function (Blueprint $table) {
40
+        Schema::connection($connection)->create(config('admin.database.menu_table'), function(Blueprint $table) {
41 41
             $table->increments('id');
42 42
             $table->integer('parent_id')->default(0);
43 43
             $table->integer('order')->default(0);
@@ -48,35 +48,35 @@  discard block
 block discarded – undo
48 48
             $table->timestamps();
49 49
         });
50 50
 
51
-        Schema::connection($connection)->create(config('admin.database.role_users_table'), function (Blueprint $table) {
51
+        Schema::connection($connection)->create(config('admin.database.role_users_table'), function(Blueprint $table) {
52 52
             $table->integer('role_id');
53 53
             $table->integer('user_id');
54 54
             $table->index(['role_id', 'user_id']);
55 55
             $table->timestamps();
56 56
         });
57 57
 
58
-        Schema::connection($connection)->create(config('admin.database.role_permissions_table'), function (Blueprint $table) {
58
+        Schema::connection($connection)->create(config('admin.database.role_permissions_table'), function(Blueprint $table) {
59 59
             $table->integer('role_id');
60 60
             $table->integer('permission_id');
61 61
             $table->index(['role_id', 'permission_id']);
62 62
             $table->timestamps();
63 63
         });
64 64
 
65
-        Schema::connection($connection)->create(config('admin.database.user_permissions_table'), function (Blueprint $table) {
65
+        Schema::connection($connection)->create(config('admin.database.user_permissions_table'), function(Blueprint $table) {
66 66
             $table->integer('user_id');
67 67
             $table->integer('permission_id');
68 68
             $table->index(['user_id', 'permission_id']);
69 69
             $table->timestamps();
70 70
         });
71 71
 
72
-        Schema::connection($connection)->create(config('admin.database.role_menu_table'), function (Blueprint $table) {
72
+        Schema::connection($connection)->create(config('admin.database.role_menu_table'), function(Blueprint $table) {
73 73
             $table->integer('role_id');
74 74
             $table->integer('menu_id');
75 75
             $table->index(['role_id', 'menu_id']);
76 76
             $table->timestamps();
77 77
         });
78 78
 
79
-        Schema::connection($connection)->create(config('admin.database.operation_log_table'), function (Blueprint $table) {
79
+        Schema::connection($connection)->create(config('admin.database.operation_log_table'), function(Blueprint $table) {
80 80
             $table->increments('id');
81 81
             $table->integer('user_id');
82 82
             $table->string('path');
Please login to merge, or discard this patch.
src/Form/Field/File.php 1 patch
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
      *
270 270
      * @param UploadedFile $file
271 271
      *
272
-     * @return mixed|string
272
+     * @return string
273 273
      */
274 274
     protected function prepareForSingle(UploadedFile $file = null)
275 275
     {
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
      *
312 312
      * @param UploadedFile $file
313 313
      *
314
-     * @return mixed
314
+     * @return string
315 315
      */
316 316
     protected function uploadAndDeleteOriginal(UploadedFile $file)
317 317
     {
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
     /**
367 367
      * Get file visit url.
368 368
      *
369
-     * @param $path
369
+     * @param string $path
370 370
      *
371 371
      * @return string
372 372
      */
Please login to merge, or discard this patch.
src/Form/Field/Image.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
      *
57 57
      * @param string $target
58 58
      *
59
-     * @return mixed
59
+     * @return string
60 60
      */
61 61
     public function executeCalls($target)
62 62
     {
Please login to merge, or discard this patch.
src/Grid/Exporter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@
 block discarded – undo
68 68
      */
69 69
     protected function sanitize(array $row)
70 70
     {
71
-        return collect($row)->reject(function ($val, $_) {
71
+        return collect($row)->reject(function($val, $_) {
72 72
             return is_array($val) && !Arr::isAssoc($val);
73 73
         })->toArray();
74 74
     }
Please login to merge, or discard this patch.
src/Controllers/LogController.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -18,23 +18,23 @@  discard block
 block discarded – undo
18 18
      */
19 19
     public function index()
20 20
     {
21
-        return Admin::content(function (Content $content) {
21
+        return Admin::content(function(Content $content) {
22 22
             $content->header(trans('admin::lang.operation_log'));
23 23
             $content->description(trans('admin::lang.list'));
24 24
 
25
-            $grid = Admin::grid(OperationLog::class, function (Grid $grid) {
25
+            $grid = Admin::grid(OperationLog::class, function(Grid $grid) {
26 26
                 $grid->model()->orderBy('id', 'DESC');
27 27
 
28 28
                 $grid->id('ID')->sortable();
29 29
                 $grid->user()->name();
30
-                $grid->method()->value(function ($method) {
30
+                $grid->method()->value(function($method) {
31 31
                     $color = array_get(OperationLog::$methodColors, $method, 'grey');
32 32
 
33 33
                     return "<span class=\"badge bg-$color\">$method</span>";
34 34
                 });
35 35
                 $grid->path()->label('info');
36 36
                 $grid->ip()->label('primary');
37
-                $grid->input()->value(function ($input) {
37
+                $grid->input()->value(function($input) {
38 38
                     $input = json_decode($input, true);
39 39
                     $input = array_except($input, '_pjax');
40 40
 
@@ -43,13 +43,13 @@  discard block
 block discarded – undo
43 43
 
44 44
                 $grid->created_at(trans('admin::lang.created_at'));
45 45
 
46
-                $grid->rows(function ($row) {
46
+                $grid->rows(function($row) {
47 47
                     $row->actions('delete');
48 48
                 });
49 49
 
50 50
                 $grid->disableCreation();
51 51
 
52
-                $grid->filter(function ($filter) {
52
+                $grid->filter(function($filter) {
53 53
                     $filter->is('user_id', 'User')->select(Administrator::all()->pluck('name', 'id'));
54 54
                     $filter->is('method')->select(array_combine(OperationLog::$methods, OperationLog::$methods));
55 55
                     $filter->like('path');
Please login to merge, or discard this patch.
src/Controllers/PermissionController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
      */
21 21
     public function index()
22 22
     {
23
-        return Admin::content(function (Content $content) {
23
+        return Admin::content(function(Content $content) {
24 24
             $content->header(trans('admin::lang.permissions'));
25 25
             $content->description(trans('admin::lang.list'));
26 26
             $content->body($this->grid()->render());
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
      */
37 37
     public function edit($id)
38 38
     {
39
-        return Admin::content(function (Content $content) use ($id) {
39
+        return Admin::content(function(Content $content) use ($id) {
40 40
             $content->header(trans('admin::lang.permissions'));
41 41
             $content->description(trans('admin::lang.edit'));
42 42
             $content->body($this->form()->edit($id));
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
      */
51 51
     public function create()
52 52
     {
53
-        return Admin::content(function (Content $content) {
53
+        return Admin::content(function(Content $content) {
54 54
             $content->header(trans('admin::lang.permissions'));
55 55
             $content->description(trans('admin::lang.create'));
56 56
             $content->body($this->form());
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
      */
65 65
     protected function grid()
66 66
     {
67
-        return Admin::grid(Permission::class, function (Grid $grid) {
67
+        return Admin::grid(Permission::class, function(Grid $grid) {
68 68
             $grid->id('ID')->sortable();
69 69
             $grid->slug(trans('admin::lang.slug'));
70 70
             $grid->name(trans('admin::lang.name'));
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
      */
84 84
     public function form()
85 85
     {
86
-        return Admin::form(Permission::class, function (Form $form) {
86
+        return Admin::form(Permission::class, function(Form $form) {
87 87
             $form->display('id', 'ID');
88 88
 
89 89
             $form->text('slug', trans('admin::lang.slug'))->rules('required');
Please login to merge, or discard this patch.
src/Providers/AdminServiceProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
      */
71 71
     public function register()
72 72
     {
73
-        $this->app->booting(function () {
73
+        $this->app->booting(function() {
74 74
             $loader = AliasLoader::getInstance();
75 75
 
76 76
             $loader->alias('Admin', \Encore\Admin\Facades\Admin::class);
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
      */
124 124
     public function registerRouter()
125 125
     {
126
-        $this->app->singleton('admin.router', function ($app) {
126
+        $this->app->singleton('admin.router', function($app) {
127 127
             return new Router($app['router']);
128 128
         });
129 129
     }
Please login to merge, or discard this patch.
src/Grid/Column.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
     public function progressBar($style = 'primary', $size = 'sm', $max = 100)
263 263
     {
264 264
         if (is_array($style)) {
265
-            $style = array_map(function ($style) {
265
+            $style = array_map(function($style) {
266 266
                 return 'progress-bar-'.$style;
267 267
             }, $style);
268 268
 
@@ -470,7 +470,7 @@  discard block
 block discarded – undo
470 470
     protected function htmlEntityEncode($item)
471 471
     {
472 472
         if (is_array($item)) {
473
-            array_walk_recursive($item, function (&$value) {
473
+            array_walk_recursive($item, function(&$value) {
474 474
                 $value = htmlentities($value);
475 475
             });
476 476
         } else {
@@ -548,15 +548,15 @@  discard block
 block discarded – undo
548 548
     private function _resolveClassName($style)
549 549
     {
550 550
         if (is_array($style)) {
551
-            $style = array_map(function ($style) {
552
-                return 'btn-' . $style;
551
+            $style = array_map(function($style) {
552
+                return 'btn-'.$style;
553 553
             }, $style);
554 554
 
555 555
             return implode(' ', $style);
556 556
         }
557 557
 
558 558
         if (is_string($style)) {
559
-            return 'btn-' . $style;
559
+            return 'btn-'.$style;
560 560
         }
561 561
         
562 562
         return $style;
Please login to merge, or discard this patch.