@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | } |
119 | 119 | |
120 | 120 | /** |
121 | - * @param mixed $distinct |
|
121 | + * @param string|null $distinct |
|
122 | 122 | * |
123 | 123 | * @return $this |
124 | 124 | */ |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | /** |
163 | 163 | * Apply offset and limit to the query. |
164 | 164 | * |
165 | - * @param $query |
|
165 | + * @param Builder $query |
|
166 | 166 | * @param \Illuminate\Http\Request $request |
167 | 167 | */ |
168 | 168 | protected function applyOffset($query, \Illuminate\Http\Request $request) |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | * Convert collection to the datatables structure. |
205 | 205 | * |
206 | 206 | * @param \Illuminate\Http\Request $request |
207 | - * @param array|Collection $collection |
|
207 | + * @param Collection $collection |
|
208 | 208 | * @param int $totalCount |
209 | 209 | * @param int $filteredCount |
210 | 210 | * |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | public static function registerRoutes(Router $router) |
25 | 25 | { |
26 | 26 | $routeName = 'admin.display.async'; |
27 | - if (! $router->has($routeName)) { |
|
27 | + if (!$router->has($routeName)) { |
|
28 | 28 | $router->get('{adminModel}/async/{adminDisplayName?}', [ |
29 | 29 | 'as' => $routeName, |
30 | 30 | 'uses' => 'SleepingOwl\Admin\Http\Controllers\DisplayController@async', |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | } |
33 | 33 | |
34 | 34 | $routeName = 'admin.display.async.inlineEdit'; |
35 | - if (! $router->has($routeName)) { |
|
35 | + if (!$router->has($routeName)) { |
|
36 | 36 | $router->post('{adminModel}/async/{adminDisplayName?}', [ |
37 | 37 | 'as' => $routeName, |
38 | 38 | 'uses' => 'SleepingOwl\Admin\Http\Controllers\AdminController@inlineEdit', |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | $totalCount = $query->count(); |
143 | 143 | $filteredCount = 0; |
144 | 144 | |
145 | - if (! is_null($this->distinct)) { |
|
145 | + if (!is_null($this->distinct)) { |
|
146 | 146 | $filteredCount = $query->distinct()->count($this->getDistinct()); |
147 | 147 | } |
148 | 148 | |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | return; |
191 | 191 | } |
192 | 192 | |
193 | - $query->where(function ($query) use ($search) { |
|
193 | + $query->where(function($query) use ($search) { |
|
194 | 194 | $columns = $this->getColumns()->all(); |
195 | 195 | foreach ($columns as $column) { |
196 | 196 | if (in_array(get_class($column), $this->searchableColumns)) { |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | list($name, $params) = $this->currentRoute->get(); |
35 | 35 | } |
36 | 36 | |
37 | - if (! $this->exists($name)) { |
|
37 | + if (!$this->exists($name)) { |
|
38 | 38 | return ''; |
39 | 39 | } |
40 | 40 | |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | */ |
61 | 61 | public function renderIfExistsArray($name, $params = []) |
62 | 62 | { |
63 | - if (! $this->exists($name)) { |
|
63 | + if (!$this->exists($name)) { |
|
64 | 64 | return ''; |
65 | 65 | } |
66 | 66 |
@@ -21,7 +21,7 @@ |
||
21 | 21 | { |
22 | 22 | parent::__construct($name, $title); |
23 | 23 | |
24 | - if (! is_null($callback)) { |
|
24 | + if (!is_null($callback)) { |
|
25 | 25 | $this->setCallback($callback); |
26 | 26 | } |
27 | 27 | } |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | public function __construct($label = null, Closure $callback = null) |
33 | 33 | { |
34 | 34 | parent::__construct($label); |
35 | - if (! is_null($callback)) { |
|
35 | + if (!is_null($callback)) { |
|
36 | 36 | $this->setCallback($callback); |
37 | 37 | } |
38 | 38 | } |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | */ |
67 | 67 | public function getModelValue() |
68 | 68 | { |
69 | - if (! is_callable($callback = $this->getCallback())) { |
|
69 | + if (!is_callable($callback = $this->getCallback())) { |
|
70 | 70 | throw new \Exception('Invalid custom column callback'); |
71 | 71 | } |
72 | 72 |
@@ -42,7 +42,7 @@ |
||
42 | 42 | |
43 | 43 | if ($request->input($this->getPath().'_remove')) { |
44 | 44 | $this->setModelAttribute(null); |
45 | - } elseif (! is_null($value)) { |
|
45 | + } elseif (!is_null($value)) { |
|
46 | 46 | $this->setModelAttribute($value); |
47 | 47 | } |
48 | 48 | } |
@@ -27,13 +27,13 @@ |
||
27 | 27 | */ |
28 | 28 | public function customValidation(Validator $validator) |
29 | 29 | { |
30 | - $validator->after(function ($validator) { |
|
30 | + $validator->after(function($validator) { |
|
31 | 31 | /** @var \Illuminate\Http\UploadedFile $file */ |
32 | 32 | $file = array_get($validator->attributes(), 'file'); |
33 | 33 | |
34 | 34 | $size = getimagesize($file->getRealPath()); |
35 | 35 | |
36 | - if (! $size) { |
|
36 | + if (!$size) { |
|
37 | 37 | $validator->errors()->add('file', trans('sleeping_owl::validation.not_image')); |
38 | 38 | } |
39 | 39 | }); |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | { |
24 | 24 | $value = $this->getValueFromModel(); |
25 | 25 | |
26 | - if (! $this->isAllowedEmptyValue() and $this->getModel()->exists and empty($value)) { |
|
26 | + if (!$this->isAllowedEmptyValue() and $this->getModel()->exists and empty($value)) { |
|
27 | 27 | return; |
28 | 28 | } |
29 | 29 | |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | { |
38 | 38 | $data = parent::getValidationRules(); |
39 | 39 | |
40 | - if (! $this->isAllowedEmptyValue() and $this->getModel()->exists) { |
|
40 | + if (!$this->isAllowedEmptyValue() and $this->getModel()->exists) { |
|
41 | 41 | foreach ($data as $field => $rules) { |
42 | 42 | foreach ($rules as $i => $rule) { |
43 | 43 | if ($rule == 'required') { |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | */ |
74 | 74 | public function hashWithBcrypt() |
75 | 75 | { |
76 | - return $this->mutateValue(function ($value) { |
|
76 | + return $this->mutateValue(function($value) { |
|
77 | 77 | return bcrypt($value); |
78 | 78 | }); |
79 | 79 | } |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | */ |
84 | 84 | public function hashWithMD5() |
85 | 85 | { |
86 | - return $this->mutateValue(function ($value) { |
|
86 | + return $this->mutateValue(function($value) { |
|
87 | 87 | return md5($value); |
88 | 88 | }); |
89 | 89 | } |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | */ |
94 | 94 | public function hashWithSHA1() |
95 | 95 | { |
96 | - return $this->mutateValue(function ($value) { |
|
96 | + return $this->mutateValue(function($value) { |
|
97 | 97 | return sha1($value); |
98 | 98 | }); |
99 | 99 | } |
@@ -165,7 +165,7 @@ |
||
165 | 165 | */ |
166 | 166 | public function setModelAttribute($value) |
167 | 167 | { |
168 | - if (! empty($this->filteredFieldKey)) { |
|
168 | + if (!empty($this->filteredFieldKey)) { |
|
169 | 169 | parent::setModelAttribute($value); |
170 | 170 | |
171 | 171 | $this->setModelAttributeKey($this->filteredFieldKey); |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | */ |
16 | 16 | public function storeAsJson() |
17 | 17 | { |
18 | - $this->mutateValue(function ($value) { |
|
18 | + $this->mutateValue(function($value) { |
|
19 | 19 | return json_encode($value); |
20 | 20 | }); |
21 | 21 | |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | */ |
30 | 30 | public function storeAsComaSeparatedValue() |
31 | 31 | { |
32 | - $this->mutateValue(function ($value) { |
|
32 | + $this->mutateValue(function($value) { |
|
33 | 33 | return implode(',', $value); |
34 | 34 | }); |
35 | 35 | |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | $name = $this->getName(); |
47 | 47 | $value = $request->input($name, ''); |
48 | 48 | |
49 | - if (! empty($value)) { |
|
49 | + if (!empty($value)) { |
|
50 | 50 | $value = explode(',', $value); |
51 | 51 | } else { |
52 | 52 | $value = []; |