Completed
Pull Request — master (#4037)
by Muhlis
02:52
created
src/Form/Field.php 1 patch
Doc Comments   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
      *
282 282
      * @param string $column
283 283
      *
284
-     * @return mixed|string
284
+     * @return string
285 285
      */
286 286
     protected function formatColumn($column = '')
287 287
     {
@@ -574,7 +574,7 @@  discard block
 block discarded – undo
574 574
     }
575 575
 
576 576
     /**
577
-     * @param string|array|Closure $input
577
+     * @param callable|null $input
578 578
      * @param string|array         $original
579 579
      *
580 580
      * @return array|Closure
@@ -785,7 +785,7 @@  discard block
 block discarded – undo
785 785
     /**
786 786
      * Set or get value of the field.
787 787
      *
788
-     * @param null $value
788
+     * @param string $value
789 789
      *
790 790
      * @return mixed
791 791
      */
@@ -956,7 +956,7 @@  discard block
 block discarded – undo
956 956
     /**
957 957
      * Add html attributes to elements.
958 958
      *
959
-     * @param array|string $attribute
959
+     * @param string $attribute
960 960
      * @param mixed        $value
961 961
      *
962 962
      * @return $this
@@ -1334,7 +1334,7 @@  discard block
 block discarded – undo
1334 1334
     }
1335 1335
 
1336 1336
     /**
1337
-     * @param array $labelClass
1337
+     * @param string[] $labelClass
1338 1338
      *
1339 1339
      * @return self
1340 1340
      */
@@ -1389,7 +1389,7 @@  discard block
 block discarded – undo
1389 1389
      *
1390 1390
      * @param string $view
1391 1391
      *
1392
-     * @return string
1392
+     * @return Field
1393 1393
      */
1394 1394
     public function setView($view): self
1395 1395
     {
Please login to merge, or discard this patch.
src/Show/Panel.php 1 patch
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
     /**
129 129
      * Build panel tools.
130 130
      *
131
-     * @param $callable
131
+     * @param \Closure $callable
132 132
      */
133 133
     public function tools($callable)
134 134
     {
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
     /**
139 139
      * Fill fields to panel.
140 140
      *
141
-     * @param []Field $fields
141
+     * @param Collection $fields
142 142
      *
143 143
      * @return $this
144 144
      */
Please login to merge, or discard this patch.
src/Controllers/UserController.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -34,14 +34,14 @@  discard block
 block discarded – undo
34 34
         $grid->column('created_at', trans('admin.created_at'));
35 35
         $grid->column('updated_at', trans('admin.updated_at'));
36 36
 
37
-        $grid->actions(function (Grid\Displayers\Actions $actions) {
37
+        $grid->actions(function(Grid\Displayers\Actions $actions) {
38 38
             if ($actions->getKey() == 1) {
39 39
                 $actions->disableDelete();
40 40
             }
41 41
         });
42 42
 
43
-        $grid->tools(function (Grid\Tools $tools) {
44
-            $tools->batch(function (Grid\Tools\BatchActions $actions) {
43
+        $grid->tools(function(Grid\Tools $tools) {
44
+            $tools->batch(function(Grid\Tools\BatchActions $actions) {
45 45
                 $actions->disableDelete();
46 46
             });
47 47
         });
@@ -65,15 +65,15 @@  discard block
 block discarded – undo
65 65
         $show->field('id', 'ID');
66 66
         $show->field('username', trans('admin.username'));
67 67
         $show->field('name', trans('admin.name'));
68
-        $show->field('roles', trans('admin.roles'))->as(function ($roles) {
68
+        $show->field('roles', trans('admin.roles'))->as(function($roles) {
69 69
             return $roles->pluck('name');
70 70
         })->label();
71
-        $show->field('permissions', trans('admin.permissions'))->as(function ($permission) {
71
+        $show->field('permissions', trans('admin.permissions'))->as(function($permission) {
72 72
             return $permission->pluck('name');
73 73
         })->label();
74 74
         $show->field('created_at', trans('admin.created_at'));
75 75
         $show->field('updated_at', trans('admin.updated_at'));
76
-        $show->panel()->tools(function ($tools) use ($id) {
76
+        $show->panel()->tools(function($tools) use ($id) {
77 77
             if ($id == 1) {
78 78
                 $tools->disableDelete();
79 79
             }
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
         $form->image('avatar', trans('admin.avatar'));
108 108
         $form->password('password', trans('admin.password'))->rules('required|confirmed');
109 109
         $form->password('password_confirmation', trans('admin.password_confirmation'))->rules('required')
110
-            ->default(function ($form) {
110
+            ->default(function($form) {
111 111
                 return $form->model()->password;
112 112
             });
113 113
 
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
         $form->display('created_at', trans('admin.created_at'));
120 120
         $form->display('updated_at', trans('admin.updated_at'));
121 121
 
122
-        $form->saving(function (Form $form) {
122
+        $form->saving(function(Form $form) {
123 123
             if ($form->password && $form->model()->password != $form->password) {
124 124
                 $form->password = bcrypt($form->password);
125 125
             }
Please login to merge, or discard this patch.
src/Show.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
             $this->overwriteExistingField($name);
225 225
         }
226 226
 
227
-        return tap($field, function ($field) {
227
+        return tap($field, function($field) {
228 228
             $this->fields->push($field);
229 229
         });
230 230
     }
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
             $this->overwriteExistingRelation($name);
249 249
         }
250 250
 
251
-        return tap($relation, function ($relation) {
251
+        return tap($relation, function($relation) {
252 252
             $this->relations->push($relation);
253 253
         });
254 254
     }
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
         }
266 266
 
267 267
         $this->fields = $this->fields->filter(
268
-            function (Field $field) use ($name) {
268
+            function(Field $field) use ($name) {
269 269
                 return $field->getName() != $name;
270 270
             }
271 271
         );
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
         }
284 284
 
285 285
         $this->relations = $this->relations->filter(
286
-            function (Relation $relation) use ($name) {
286
+            function(Relation $relation) use ($name) {
287 287
                 return $relation->getName() != $name;
288 288
             }
289 289
         );
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
      */
341 341
     public function setWidth($fieldWidth = 8, $labelWidth = 2)
342 342
     {
343
-        collect($this->fields)->each(function ($field) use ($fieldWidth, $labelWidth) {
343
+        collect($this->fields)->each(function($field) use ($fieldWidth, $labelWidth) {
344 344
             $field->each->setWidth($fieldWidth, $labelWidth);
345 345
         });
346 346
 
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
     /**
154 154
      * Overwrite properties for field and relation.
155 155
      *
156
-     * @return bool
156
+     * @return Show
157 157
      */
158 158
     public function overWrite()
159 159
     {
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
      * @param string $method
397 397
      * @param array  $arguments
398 398
      *
399
-     * @return bool|mixed
399
+     * @return Field
400 400
      */
401 401
     public function __call($method, $arguments = [])
402 402
     {
Please login to merge, or discard this patch.
src/Grid/Exporters/CsvExporter.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -22,12 +22,12 @@  discard block
 block discarded – undo
22 22
             'Content-Disposition' => "attachment; filename=\"$filename\"",
23 23
         ];
24 24
 
25
-        response()->stream(function () {
25
+        response()->stream(function() {
26 26
             $handle = fopen('php://output', 'w');
27 27
 
28 28
             $titles = [];
29 29
 
30
-            $this->chunk(function ($records) use ($handle, &$titles) {
30
+            $this->chunk(function($records) use ($handle, &$titles) {
31 31
                 if (empty($titles)) {
32 32
                     $titles = $this->getHeaderRowFromRecords($records);
33 33
 
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
     public function getHeaderRowFromRecords(Collection $records): array
56 56
     {
57 57
         $titles = collect(Arr::dot($records->first()->getAttributes()))->keys()->map(
58
-            function ($key) {
58
+            function($key) {
59 59
                 $key = str_replace('.', ' ', $key);
60 60
 
61 61
                 return Str::ucfirst($key);
Please login to merge, or discard this patch.
tests/ModelTreeTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
     {
14 14
         $rootText = 'Root Text';
15 15
 
16
-        $options = Tree::selectOptions(function ($query) {
16
+        $options = Tree::selectOptions(function($query) {
17 17
             return $query->where('uri', '');
18 18
         }, $rootText);
19 19
 
Please login to merge, or discard this patch.
tests/migrations/2016_11_22_093148_create_test_tables.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
      */
13 13
     public function up()
14 14
     {
15
-        Schema::create('test_images', function (Blueprint $table) {
15
+        Schema::create('test_images', function(Blueprint $table) {
16 16
             $table->increments('id');
17 17
             $table->string('image1');
18 18
             $table->string('image2');
@@ -23,13 +23,13 @@  discard block
 block discarded – undo
23 23
             $table->timestamps();
24 24
         });
25 25
 
26
-        Schema::create('test_multiple_images', function (Blueprint $table) {
26
+        Schema::create('test_multiple_images', function(Blueprint $table) {
27 27
             $table->increments('id');
28 28
             $table->text('pictures');
29 29
             $table->timestamps();
30 30
         });
31 31
 
32
-        Schema::create('test_files', function (Blueprint $table) {
32
+        Schema::create('test_files', function(Blueprint $table) {
33 33
             $table->increments('id');
34 34
             $table->string('file1');
35 35
             $table->string('file2');
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
             $table->timestamps();
41 41
         });
42 42
 
43
-        Schema::create('test_users', function (Blueprint $table) {
43
+        Schema::create('test_users', function(Blueprint $table) {
44 44
             $table->increments('id');
45 45
             $table->string('username');
46 46
             $table->string('email');
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
             $table->timestamps();
51 51
         });
52 52
 
53
-        Schema::create('test_user_profiles', function (Blueprint $table) {
53
+        Schema::create('test_user_profiles', function(Blueprint $table) {
54 54
             $table->increments('id');
55 55
             $table->string('user_id');
56 56
             $table->string('first_name')->nullable();
@@ -66,13 +66,13 @@  discard block
 block discarded – undo
66 66
             $table->timestamps();
67 67
         });
68 68
 
69
-        Schema::create('test_tags', function (Blueprint $table) {
69
+        Schema::create('test_tags', function(Blueprint $table) {
70 70
             $table->increments('id');
71 71
             $table->string('name');
72 72
             $table->timestamps();
73 73
         });
74 74
 
75
-        Schema::create('test_user_tags', function (Blueprint $table) {
75
+        Schema::create('test_user_tags', function(Blueprint $table) {
76 76
             $table->integer('user_id');
77 77
             $table->integer('tag_id');
78 78
             $table->index(['user_id', 'tag_id']);
Please login to merge, or discard this patch.
tests/seeds/UserTableSeeder.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
     {
11 11
         factory(\Tests\Models\User::class, 50)
12 12
             ->create()
13
-            ->each(function ($u) {
13
+            ->each(function($u) {
14 14
                 $u->profile()->save(factory(\Tests\Models\Profile::class)->make());
15 15
                 $u->tags()->saveMany(factory(\Tests\Models\Tag::class, 5)->make());
16 16
             });
Please login to merge, or discard this patch.
tests/seeds/factory.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
 
6 6
 $factory = app(Factory::class);
7 7
 
8
-$factory->define(Tests\Models\User::class, function (Faker $faker) {
8
+$factory->define(Tests\Models\User::class, function(Faker $faker) {
9 9
     return [
10 10
         'username' => $faker->userName,
11 11
         'email'    => $faker->email,
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
     ];
16 16
 });
17 17
 
18
-$factory->define(Tests\Models\Profile::class, function (Faker $faker) {
18
+$factory->define(Tests\Models\Profile::class, function(Faker $faker) {
19 19
     return [
20 20
         'first_name' => $faker->firstName,
21 21
         'last_name'  => $faker->lastName,
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
     ];
30 30
 });
31 31
 
32
-$factory->define(Tests\Models\Tag::class, function (Faker $faker) {
32
+$factory->define(Tests\Models\Tag::class, function(Faker $faker) {
33 33
     return [
34 34
         'name' => $faker->word,
35 35
     ];
Please login to merge, or discard this patch.