Completed
Pull Request — master (#3979)
by
unknown
07:34
created
src/Grid/Tools/Selector.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
57 57
      * @param string $column
58 58
      * @param string $label
59 59
      * @param array  $options
60
-     * @param null   $query
60
+     * @param null|\Closure   $query
61 61
      * @param string $type
62 62
      *
63 63
      * @return $this
Please login to merge, or discard this patch.
Unused Use Statements   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -2,9 +2,9 @@
 block discarded – undo
2 2
 
3 3
 namespace Encore\Admin\Grid\Tools;
4 4
 
5
-use Illuminate\Contracts\Support\Renderable;
6
-use Illuminate\Support\Arr;
7
-use Illuminate\Support\Collection;
5
+use Illuminate\Contracts\Support\Renderable;
6
+use Illuminate\Support\Arr;
7
+use Illuminate\Support\Collection;
8 8
 use Illuminate\Support\Str;
9 9
 
10 10
 class Selector implements Renderable
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@
 block discarded – undo
105 105
             return [];
106 106
         }
107 107
 
108
-        $selected = array_filter($selected, function ($value) {
108
+        $selected = array_filter($selected, function($value) {
109 109
             return !is_null($value);
110 110
         });
111 111
 
Please login to merge, or discard this patch.
src/Grid/Tools/TotalRow.php 2 patches
Unused Use Statements   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -2,9 +2,9 @@
 block discarded – undo
2 2
 
3 3
 namespace Encore\Admin\Grid\Tools;
4 4
 
5
-use Encore\Admin\Grid\Column;
6
-use Illuminate\Database\Query\Builder;
7
-use Illuminate\Support\Arr;
5
+use Encore\Admin\Grid\Column;
6
+use Illuminate\Database\Query\Builder;
7
+use Illuminate\Support\Arr;
8 8
 use Illuminate\Support\Collection;
9 9
 
10 10
 class TotalRow extends AbstractTool
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@
 block discarded – undo
87 87
      */
88 88
     public function render()
89 89
     {
90
-        $columns = $this->getVisibleColumns()->map(function (Column $column) {
90
+        $columns = $this->getVisibleColumns()->map(function(Column $column) {
91 91
             $name = $column->getName();
92 92
 
93 93
             $total = '';
Please login to merge, or discard this patch.
src/helpers.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -161,7 +161,7 @@
 block discarded – undo
161 161
      * @param array  $replace
162 162
      * @param string $locale
163 163
      *
164
-     * @return \Illuminate\Contracts\Translation\Translator|string|array|null
164
+     * @return string|null
165 165
      */
166 166
     function admin_trans($key = null, $replace = [], $locale = null)
167 167
     {
Please login to merge, or discard this patch.
src/Layout/Column.php 2 patches
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 
3 3
 namespace Encore\Admin\Layout;
4 4
 
5
-use Encore\Admin\Grid;
5
+use Encore\Admin\Grid;
6 6
 use Illuminate\Contracts\Support\Renderable;
7 7
 
8 8
 class Column implements Buildable
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@
 block discarded – undo
112 112
     protected function startColumn()
113 113
     {
114 114
         // get class name using width array
115
-        $classnName = collect($this->width)->map(function ($value, $key) {
115
+        $classnName = collect($this->width)->map(function($value, $key) {
116 116
             return "col-$key-$value";
117 117
         })->implode(' ');
118 118
 
Please login to merge, or discard this patch.
src/Layout/Content.php 1 patch
Unused Use Statements   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,8 +2,8 @@
 block discarded – undo
2 2
 
3 3
 namespace Encore\Admin\Layout;
4 4
 
5
-use Closure;
6
-use Illuminate\Contracts\Support\Renderable;
5
+use Closure;
6
+use Illuminate\Contracts\Support\Renderable;
7 7
 use Illuminate\Support\Arr;
8 8
 
9 9
 class Content implements Renderable
Please login to merge, or discard this patch.
src/Middleware/LogOperation.php 2 patches
Unused Use Statements   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -2,9 +2,9 @@
 block discarded – undo
2 2
 
3 3
 namespace Encore\Admin\Middleware;
4 4
 
5
-use Encore\Admin\Auth\Database\OperationLog as OperationLogModel;
6
-use Encore\Admin\Facades\Admin;
7
-use Illuminate\Http\Request;
5
+use Encore\Admin\Auth\Database\OperationLog as OperationLogModel;
6
+use Encore\Admin\Facades\Admin;
7
+use Illuminate\Http\Request;
8 8
 use Illuminate\Support\Str;
9 9
 
10 10
 class LogOperation
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@
 block discarded – undo
66 66
             return true;
67 67
         }
68 68
 
69
-        return $allowedMethods->map(function ($method) {
69
+        return $allowedMethods->map(function($method) {
70 70
             return strtoupper($method);
71 71
         })->contains($method);
72 72
     }
Please login to merge, or discard this patch.
src/Middleware/Permission.php 2 patches
Unused Use Statements   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -2,9 +2,9 @@
 block discarded – undo
2 2
 
3 3
 namespace Encore\Admin\Middleware;
4 4
 
5
-use Encore\Admin\Auth\Permission as Checker;
6
-use Encore\Admin\Facades\Admin;
7
-use Illuminate\Http\Request;
5
+use Encore\Admin\Auth\Permission as Checker;
6
+use Encore\Admin\Facades\Admin;
7
+use Illuminate\Http\Request;
8 8
 use Illuminate\Support\Str;
9 9
 
10 10
 class Permission
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
             return $next($request);
38 38
         }
39 39
 
40
-        if (!Admin::user()->allPermissions()->first(function ($permission) use ($request) {
40
+        if (!Admin::user()->allPermissions()->first(function($permission) use ($request) {
41 41
             return $permission->shouldPassThrough($request);
42 42
         })) {
43 43
             Checker::error();
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
      */
57 57
     public function checkRoutePermission(Request $request)
58 58
     {
59
-        if (!$middleware = collect($request->route()->middleware())->first(function ($middleware) {
59
+        if (!$middleware = collect($request->route()->middleware())->first(function($middleware) {
60 60
             return Str::startsWith($middleware, $this->middlewarePrefix);
61 61
         })) {
62 62
             return false;
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 
92 92
         return collect($excepts)
93 93
             ->map('admin_base_path')
94
-            ->contains(function ($except) use ($request) {
94
+            ->contains(function($except) use ($request) {
95 95
                 if ($except !== '/') {
96 96
                     $except = trim($except, '/');
97 97
                 }
Please login to merge, or discard this patch.
src/Middleware/Pjax.php 2 patches
Unused Use Statements   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -2,11 +2,11 @@
 block discarded – undo
2 2
 
3 3
 namespace Encore\Admin\Middleware;
4 4
 
5
-use Closure;
6
-use Encore\Admin\Facades\Admin;
7
-use Illuminate\Http\Request;
8
-use Illuminate\Support\MessageBag;
9
-use Symfony\Component\DomCrawler\Crawler;
5
+use Closure;
6
+use Encore\Admin\Facades\Admin;
7
+use Illuminate\Http\Request;
8
+use Illuminate\Support\MessageBag;
9
+use Symfony\Component\DomCrawler\Crawler;
10 10
 use Symfony\Component\HttpFoundation\Response;
11 11
 
12 12
 class Pjax
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
      */
48 48
     public static function respond(Response $response)
49 49
     {
50
-        $next = function () use ($response) {
50
+        $next = function() use ($response) {
51 51
             return $response;
52 52
         };
53 53
 
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
      */
140 140
     protected function decodeUtf8HtmlEntities($html)
141 141
     {
142
-        return preg_replace_callback('/(&#[0-9]+;)/', function ($html) {
142
+        return preg_replace_callback('/(&#[0-9]+;)/', function($html) {
143 143
             return mb_convert_encoding($html[1], 'UTF-8', 'HTML-ENTITIES');
144 144
         }, $html);
145 145
     }
Please login to merge, or discard this patch.
src/Show.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -374,7 +374,7 @@
 block discarded – undo
374 374
      * @param string $method
375 375
      * @param array  $arguments
376 376
      *
377
-     * @return bool|mixed
377
+     * @return Field
378 378
      */
379 379
     public function __call($method, $arguments = [])
380 380
     {
Please login to merge, or discard this patch.
Unused Use Statements   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -2,22 +2,22 @@
 block discarded – undo
2 2
 
3 3
 namespace Encore\Admin;
4 4
 
5
-use Encore\Admin\Show\Divider;
6
-use Encore\Admin\Show\Field;
7
-use Encore\Admin\Show\Panel;
8
-use Encore\Admin\Show\Relation;
9
-use Illuminate\Contracts\Support\Renderable;
10
-use Illuminate\Database\Eloquent\Model;
11
-use Illuminate\Database\Eloquent\Relations\BelongsTo;
12
-use Illuminate\Database\Eloquent\Relations\BelongsToMany;
13
-use Illuminate\Database\Eloquent\Relations\HasMany;
14
-use Illuminate\Database\Eloquent\Relations\HasManyThrough;
15
-use Illuminate\Database\Eloquent\Relations\HasOne;
16
-use Illuminate\Database\Eloquent\Relations\MorphMany;
17
-use Illuminate\Database\Eloquent\Relations\MorphOne;
18
-use Illuminate\Database\Eloquent\Relations\Relation as EloquentRelation;
19
-use Illuminate\Support\Arr;
20
-use Illuminate\Support\Collection;
5
+use Encore\Admin\Show\Divider;
6
+use Encore\Admin\Show\Field;
7
+use Encore\Admin\Show\Panel;
8
+use Encore\Admin\Show\Relation;
9
+use Illuminate\Contracts\Support\Renderable;
10
+use Illuminate\Database\Eloquent\Model;
11
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
12
+use Illuminate\Database\Eloquent\Relations\BelongsToMany;
13
+use Illuminate\Database\Eloquent\Relations\HasMany;
14
+use Illuminate\Database\Eloquent\Relations\HasManyThrough;
15
+use Illuminate\Database\Eloquent\Relations\HasOne;
16
+use Illuminate\Database\Eloquent\Relations\MorphMany;
17
+use Illuminate\Database\Eloquent\Relations\MorphOne;
18
+use Illuminate\Database\Eloquent\Relations\Relation as EloquentRelation;
19
+use Illuminate\Support\Arr;
20
+use Illuminate\Support\Collection;
21 21
 use Illuminate\Support\Str;
22 22
 
23 23
 class Show implements Renderable
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 
224 224
         $this->overwriteExistingField($name);
225 225
 
226
-        return tap($field, function ($field) {
226
+        return tap($field, function($field) {
227 227
             $this->fields->push($field);
228 228
         });
229 229
     }
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
 
246 246
         $this->overwriteExistingRelation($name);
247 247
 
248
-        return tap($relation, function ($relation) {
248
+        return tap($relation, function($relation) {
249 249
             $this->relations->push($relation);
250 250
         });
251 251
     }
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
         }
263 263
 
264 264
         $this->fields = $this->fields->filter(
265
-            function (Field $field) use ($name) {
265
+            function(Field $field) use ($name) {
266 266
                 return $field->getName() != $name;
267 267
             }
268 268
         );
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
         }
281 281
 
282 282
         $this->relations = $this->relations->filter(
283
-            function (Relation $relation) use ($name) {
283
+            function(Relation $relation) use ($name) {
284 284
                 return $relation->getName() != $name;
285 285
             }
286 286
         );
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
      */
338 338
     public function setWidth($fieldWidth = 8, $labelWidth = 2)
339 339
     {
340
-        collect($this->fields)->each(function ($field) use ($fieldWidth, $labelWidth) {
340
+        collect($this->fields)->each(function($field) use ($fieldWidth, $labelWidth) {
341 341
             $field->each->setWidth($fieldWidth, $labelWidth);
342 342
         });
343 343
 
Please login to merge, or discard this patch.