@@ -57,7 +57,7 @@ |
||
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 |
@@ -93,18 +93,18 @@ discard block |
||
93 | 93 | */ |
94 | 94 | public static function parseSelected() |
95 | 95 | { |
96 | - if (! is_null(static::$selected)) { |
|
96 | + if (!is_null(static::$selected)) { |
|
97 | 97 | return static::$selected; |
98 | 98 | } |
99 | 99 | |
100 | 100 | $selected = request('_selector', []); |
101 | 101 | |
102 | - if (! is_array($selected)) { |
|
102 | + if (!is_array($selected)) { |
|
103 | 103 | return []; |
104 | 104 | } |
105 | 105 | |
106 | - $selected = array_filter($selected, function ($value) { |
|
107 | - return ! is_null($value); |
|
106 | + $selected = array_filter($selected, function($value) { |
|
107 | + return !is_null($value); |
|
108 | 108 | }); |
109 | 109 | |
110 | 110 | foreach ($selected as &$value) { |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | array_push($options, $value); |
145 | 145 | } |
146 | 146 | |
147 | - if (! empty($options)) { |
|
147 | + if (!empty($options)) { |
|
148 | 148 | Arr::set($query, "_selector.{$column}", implode(',', $options)); |
149 | 149 | } else { |
150 | 150 | Arr::forget($query, "_selector.{$column}"); |
@@ -289,7 +289,7 @@ |
||
289 | 289 | * |
290 | 290 | * @param Collection $tools |
291 | 291 | * |
292 | - * @return mixed |
|
292 | + * @return string |
|
293 | 293 | */ |
294 | 294 | protected function renderCustomTools($tools) |
295 | 295 | { |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | { |
107 | 107 | if ($disable) { |
108 | 108 | array_delete($this->tools, 'list'); |
109 | - } elseif (! in_array('list', $this->tools)) { |
|
109 | + } elseif (!in_array('list', $this->tools)) { |
|
110 | 110 | array_push($this->tools, 'list'); |
111 | 111 | } |
112 | 112 | |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | { |
123 | 123 | if ($disable) { |
124 | 124 | array_delete($this->tools, 'delete'); |
125 | - } elseif (! in_array('delete', $this->tools)) { |
|
125 | + } elseif (!in_array('delete', $this->tools)) { |
|
126 | 126 | array_push($this->tools, 'delete'); |
127 | 127 | } |
128 | 128 | |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | { |
139 | 139 | if ($disable) { |
140 | 140 | array_delete($this->tools, 'edit'); |
141 | - } elseif (! in_array('edit', $this->tools)) { |
|
141 | + } elseif (!in_array('edit', $this->tools)) { |
|
142 | 142 | array_push($this->tools, 'edit'); |
143 | 143 | } |
144 | 144 | |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | */ |
294 | 294 | protected function renderCustomTools($tools) |
295 | 295 | { |
296 | - return $tools->map(function ($tool) { |
|
296 | + return $tools->map(function($tool) { |
|
297 | 297 | if ($tool instanceof Renderable) { |
298 | 298 | return $tool->render(); |
299 | 299 | } |
@@ -13,7 +13,7 @@ |
||
13 | 13 | $this->value = $this->value->toArray(); |
14 | 14 | } |
15 | 15 | |
16 | - return collect((array) $this->value)->map(function ($item) use ($style) { |
|
16 | + return collect((array) $this->value)->map(function($item) use ($style) { |
|
17 | 17 | if (is_array($style)) { |
18 | 18 | if (is_string($this->getColumn()->getOriginal()) || is_int($this->getColumn()->getOriginal())) { |
19 | 19 | $style = Arr::get($style, $this->getColumn()->getOriginal(), 'success'); |
@@ -40,7 +40,7 @@ |
||
40 | 40 | /** |
41 | 41 | * Set row model. |
42 | 42 | * |
43 | - * @param mixed $key |
|
43 | + * @param string $key |
|
44 | 44 | * |
45 | 45 | * @return \Illuminate\Database\Eloquent\Model|mixed |
46 | 46 | */ |
@@ -110,7 +110,7 @@ |
||
110 | 110 | */ |
111 | 111 | public function retrieveModel(Request $request) |
112 | 112 | { |
113 | - if (! $key = $request->get('_key')) { |
|
113 | + if (!$key = $request->get('_key')) { |
|
114 | 114 | return false; |
115 | 115 | } |
116 | 116 |
@@ -390,7 +390,7 @@ |
||
390 | 390 | * |
391 | 391 | * @param $name |
392 | 392 | * @param $slug |
393 | - * @param $path |
|
393 | + * @param string $path |
|
394 | 394 | * @param array $methods |
395 | 395 | */ |
396 | 396 | protected static function createPermission($name, $slug, $path, $methods = []) |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | { |
93 | 93 | $class = get_called_class(); |
94 | 94 | |
95 | - if (! isset(self::$instance[$class]) || ! self::$instance[$class] instanceof $class) { |
|
95 | + if (!isset(self::$instance[$class]) || !self::$instance[$class] instanceof $class) { |
|
96 | 96 | self::$instance[$class] = new static(); |
97 | 97 | } |
98 | 98 | |
@@ -112,11 +112,11 @@ discard block |
||
112 | 112 | return false; |
113 | 113 | } |
114 | 114 | |
115 | - if (! empty($css = $extension->css())) { |
|
115 | + if (!empty($css = $extension->css())) { |
|
116 | 116 | Admin::css($css); |
117 | 117 | } |
118 | 118 | |
119 | - if (! empty($js = $extension->js())) { |
|
119 | + if (!empty($js = $extension->js())) { |
|
120 | 120 | Admin::js($js); |
121 | 121 | } |
122 | 122 | |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | */ |
207 | 207 | public function disabled() |
208 | 208 | { |
209 | - return ! $this->enabled(); |
|
209 | + return !$this->enabled(); |
|
210 | 210 | } |
211 | 211 | |
212 | 212 | /** |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | public static function import() |
237 | 237 | { |
238 | 238 | $extension = static::getInstance(); |
239 | - DB::transaction(function () use ($extension) { |
|
239 | + DB::transaction(function() use ($extension) { |
|
240 | 240 | if ($menu = $extension->menu()) { |
241 | 241 | if ($extension->validateMenu($menu)) { |
242 | 242 | extract($menu); |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | */ |
310 | 310 | public function validatePermission(array $permission) |
311 | 311 | { |
312 | - if (! empty($permission['method'])) { |
|
312 | + if (!empty($permission['method'])) { |
|
313 | 313 | $permission['method'] = array_map('strtoupper', $permission['method']); |
314 | 314 | } |
315 | 315 | |
@@ -370,7 +370,7 @@ discard block |
||
370 | 370 | 'icon' => $icon, |
371 | 371 | 'uri' => $uri, |
372 | 372 | ]); |
373 | - if (! empty($children)) { |
|
373 | + if (!empty($children)) { |
|
374 | 374 | $extension = static::getInstance(); |
375 | 375 | foreach ($children as $child) { |
376 | 376 | if ($extension->validateMenu($child)) { |
@@ -89,7 +89,7 @@ |
||
89 | 89 | /** |
90 | 90 | * Remove reserved fields from form layout. |
91 | 91 | * |
92 | - * @param array $fields |
|
92 | + * @param string[] $fields |
|
93 | 93 | */ |
94 | 94 | public function removeReservedFields(array $fields) |
95 | 95 | { |
@@ -48,7 +48,7 @@ |
||
48 | 48 | */ |
49 | 49 | public function removeFields($fields) |
50 | 50 | { |
51 | - $this->fields = $this->fields->reject(function (Field $field) use ($fields) { |
|
51 | + $this->fields = $this->fields->reject(function(Field $field) use ($fields) { |
|
52 | 52 | return in_array($field->column(), $fields); |
53 | 53 | }); |
54 | 54 | } |
@@ -42,7 +42,7 @@ |
||
42 | 42 | if (empty($selectedOption)) { |
43 | 43 | $selected = $this->choice('Please choose a role for the user', $selectedOption, null, null, true); |
44 | 44 | |
45 | - $roles = $roles->filter(function ($role) use ($selected) { |
|
45 | + $roles = $roles->filter(function($role) use ($selected) { |
|
46 | 46 | return in_array($role->name, $selected); |
47 | 47 | }); |
48 | 48 | } |
@@ -45,7 +45,7 @@ |
||
45 | 45 | } |
46 | 46 | |
47 | 47 | /** |
48 | - * @return mixed |
|
48 | + * @return string |
|
49 | 49 | */ |
50 | 50 | protected function getModelClass() |
51 | 51 | { |