@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | */ |
13 | 13 | public function storeAsJson() |
14 | 14 | { |
15 | - $this->mutateValue(function ($value) { |
|
15 | + $this->mutateValue(function($value) { |
|
16 | 16 | return json_encode($value); |
17 | 17 | }); |
18 | 18 | |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | */ |
27 | 27 | public function storeAsComaSeparatedValue() |
28 | 28 | { |
29 | - $this->mutateValue(function ($value) { |
|
29 | + $this->mutateValue(function($value) { |
|
30 | 30 | return implode(',', $value); |
31 | 31 | }); |
32 | 32 | |
@@ -38,13 +38,13 @@ discard block |
||
38 | 38 | $name = $this->getName(); |
39 | 39 | $value = Request::input($name, ''); |
40 | 40 | |
41 | - if (! empty($value)) { |
|
41 | + if (!empty($value)) { |
|
42 | 42 | $value = explode(',', $value); |
43 | 43 | } else { |
44 | - $value = []; |
|
44 | + $value = [ ]; |
|
45 | 45 | } |
46 | 46 | |
47 | - Request::merge([$name => $value]); |
|
47 | + Request::merge([ $name => $value ]); |
|
48 | 48 | parent::save(); |
49 | 49 | } |
50 | 50 | |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | { |
56 | 56 | $value = parent::getValue(); |
57 | 57 | if (is_null($value)) { |
58 | - $value = []; |
|
58 | + $value = [ ]; |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | if (is_string($value)) { |
@@ -96,11 +96,11 @@ discard block |
||
96 | 96 | ]; |
97 | 97 | |
98 | 98 | if ($this->isTaggable()) { |
99 | - $attributes['class'] .= ' input-taggable'; |
|
99 | + $attributes[ 'class' ] .= ' input-taggable'; |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | if ($this->isReadonly()) { |
103 | - $attributes['disabled'] = 'disabled'; |
|
103 | + $attributes[ 'disabled' ] = 'disabled'; |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | return [ |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | $attribute = $this->getAttribute(); |
126 | 126 | |
127 | 127 | if (is_null(Request::input($this->getPath()))) { |
128 | - $values = []; |
|
128 | + $values = [ ]; |
|
129 | 129 | } else { |
130 | 130 | $values = $this->getValue(); |
131 | 131 | } |
@@ -134,19 +134,19 @@ discard block |
||
134 | 134 | |
135 | 135 | if ($relation instanceof \Illuminate\Database\Eloquent\Relations\BelongsToMany) { |
136 | 136 | foreach ($values as $i => $value) { |
137 | - if (! array_key_exists($value, $this->getOptions()) and $this->isTaggable()) { |
|
137 | + if (!array_key_exists($value, $this->getOptions()) and $this->isTaggable()) { |
|
138 | 138 | $model = clone $this->getModelForOptions(); |
139 | 139 | $model->{$this->getDisplay()} = $value; |
140 | 140 | $model->save(); |
141 | 141 | |
142 | - $values[$i] = $model->getKey(); |
|
142 | + $values[ $i ] = $model->getKey(); |
|
143 | 143 | } |
144 | 144 | } |
145 | 145 | |
146 | 146 | $relation->sync($values); |
147 | 147 | } elseif ($relation instanceof \Illuminate\Database\Eloquent\Relations\HasMany) { |
148 | 148 | foreach ($relation->get() as $item) { |
149 | - if (! in_array($item->getKey(), $values)) { |
|
149 | + if (!in_array($item->getKey(), $values)) { |
|
150 | 150 | if ($this->isDeleteRelatedItem()) { |
151 | 151 | $item->delete(); |
152 | 152 | } else { |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | $item = $model->find($value); |
163 | 163 | |
164 | 164 | if (is_null($item)) { |
165 | - if (! $this->isTaggable()) { |
|
165 | + if (!$this->isTaggable()) { |
|
166 | 166 | continue; |
167 | 167 | } |
168 | 168 |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | { |
14 | 14 | $value = $this->getValue(); |
15 | 15 | |
16 | - if (! $this->isAllowedEmptyValue() and $this->getModel()->exists() and empty($value)) { |
|
16 | + if (!$this->isAllowedEmptyValue() and $this->getModel()->exists() and empty($value)) { |
|
17 | 17 | return; |
18 | 18 | } |
19 | 19 | |
@@ -27,11 +27,11 @@ discard block |
||
27 | 27 | { |
28 | 28 | $data = parent::getValidationRules(); |
29 | 29 | |
30 | - if (! $this->isAllowedEmptyValue() and $this->getModel()->exists()) { |
|
30 | + if (!$this->isAllowedEmptyValue() and $this->getModel()->exists()) { |
|
31 | 31 | foreach ($data as $field => $rules) { |
32 | 32 | foreach ($rules as $i => $rule) { |
33 | 33 | if ($rule == 'required') { |
34 | - unset($data[$field][$i]); |
|
34 | + unset($data[ $field ][ $i ]); |
|
35 | 35 | } |
36 | 36 | } |
37 | 37 | } |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | */ |
64 | 64 | public function hashWithBcrypt() |
65 | 65 | { |
66 | - return $this->mutateValue(function ($value) { |
|
66 | + return $this->mutateValue(function($value) { |
|
67 | 67 | return bcrypt($value); |
68 | 68 | }); |
69 | 69 | } |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | */ |
74 | 74 | public function hashWithMD5() |
75 | 75 | { |
76 | - return $this->mutateValue(function ($value) { |
|
76 | + return $this->mutateValue(function($value) { |
|
77 | 77 | return md5($value); |
78 | 78 | }); |
79 | 79 | } |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | */ |
84 | 84 | public function hashWithSHA1() |
85 | 85 | { |
86 | - return $this->mutateValue(function ($value) { |
|
86 | + return $this->mutateValue(function($value) { |
|
87 | 87 | return sha1($value); |
88 | 88 | }); |
89 | 89 | } |
@@ -91,7 +91,7 @@ |
||
91 | 91 | */ |
92 | 92 | public function getConditionAttributes(Model $model) |
93 | 93 | { |
94 | - $temp = $this->attributeCondition ? call_user_func($this->attributeCondition, $model) : []; |
|
94 | + $temp = $this->attributeCondition ? call_user_func($this->attributeCondition, $model) : [ ]; |
|
95 | 95 | |
96 | 96 | if ($temp) { |
97 | 97 | foreach ($temp as $key => $value) { |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | */ |
41 | 41 | public function set($filters) |
42 | 42 | { |
43 | - if (! is_array($filters)) { |
|
43 | + if (!is_array($filters)) { |
|
44 | 44 | $filters = func_get_args(); |
45 | 45 | } |
46 | 46 | |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | */ |
79 | 79 | public function getActive() |
80 | 80 | { |
81 | - return $this->filters->filter(function (FilterInterface $filter) { |
|
81 | + return $this->filters->filter(function(FilterInterface $filter) { |
|
82 | 82 | return $filter->isActive(); |
83 | 83 | }); |
84 | 84 | } |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | */ |
125 | 125 | public function modifyQuery(\Illuminate\Database\Eloquent\Builder $query) |
126 | 126 | { |
127 | - $this->getActive()->each(function (FilterInterface $filter) use ($query) { |
|
127 | + $this->getActive()->each(function(FilterInterface $filter) use ($query) { |
|
128 | 128 | $filter->apply($query); |
129 | 129 | }); |
130 | 130 | } |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | */ |
135 | 135 | public function initialize() |
136 | 136 | { |
137 | - $this->filters->each(function (FilterInterface $filter) { |
|
137 | + $this->filters->each(function(FilterInterface $filter) { |
|
138 | 138 | $filter->initialize(); |
139 | 139 | }); |
140 | 140 | } |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | /** |
16 | 16 | * @var ColumnFilterInterface[] |
17 | 17 | */ |
18 | - protected $columnFilters = []; |
|
18 | + protected $columnFilters = [ ]; |
|
19 | 19 | |
20 | 20 | /** |
21 | 21 | * @var string|\Illuminate\View\View |
@@ -34,11 +34,11 @@ discard block |
||
34 | 34 | */ |
35 | 35 | public function set($columnFilters) |
36 | 36 | { |
37 | - if (! is_array($columnFilters)) { |
|
37 | + if (!is_array($columnFilters)) { |
|
38 | 38 | $columnFilters = func_get_args(); |
39 | 39 | } |
40 | 40 | |
41 | - $this->columnFilters = []; |
|
41 | + $this->columnFilters = [ ]; |
|
42 | 42 | |
43 | 43 | foreach ($columnFilters as $filter) { |
44 | 44 | $this->push($filter); |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function push(ColumnFilterInterface $filter = null) |
64 | 64 | { |
65 | - $this->columnFilters[] = $filter; |
|
65 | + $this->columnFilters[ ] = $filter; |
|
66 | 66 | |
67 | 67 | return $this; |
68 | 68 | } |
@@ -156,12 +156,12 @@ discard block |
||
156 | 156 | } |
157 | 157 | } |
158 | 158 | |
159 | - if (! in_array($this->getPlacement(), ['table.footer', 'table.header']) && $this->view == 'display.extensions.columns_filters_table') { |
|
159 | + if (!in_array($this->getPlacement(), [ 'table.footer', 'table.header' ]) && $this->view == 'display.extensions.columns_filters_table') { |
|
160 | 160 | $this->view = 'display.extensions.columns_filters'; |
161 | 161 | $this->setHtmlAttribute('class', 'table table-default'); |
162 | 162 | } |
163 | 163 | |
164 | - if (! $this->hasHtmlAttribute('class')) { |
|
164 | + if (!$this->hasHtmlAttribute('class')) { |
|
165 | 165 | $this->setHtmlAttribute('class', 'panel-footer'); |
166 | 166 | } |
167 | 167 | } |
@@ -88,10 +88,10 @@ discard block |
||
88 | 88 | $this->controlActive = false; |
89 | 89 | |
90 | 90 | if ($this->isInitialize()) { |
91 | - $this->columns = $this->columns->filter(function ($column) { |
|
91 | + $this->columns = $this->columns->filter(function($column) { |
|
92 | 92 | $class = get_class($this->getControlColumn()); |
93 | 93 | |
94 | - return ! ($column instanceof $class); |
|
94 | + return !($column instanceof $class); |
|
95 | 95 | }); |
96 | 96 | } |
97 | 97 | |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | */ |
114 | 114 | public function set($columns) |
115 | 115 | { |
116 | - if (! is_array($columns)) { |
|
116 | + if (!is_array($columns)) { |
|
117 | 117 | $columns = func_get_args(); |
118 | 118 | } |
119 | 119 | |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | |
180 | 180 | public function initialize() |
181 | 181 | { |
182 | - $this->all()->each(function (ColumnInterface $column) { |
|
182 | + $this->all()->each(function(ColumnInterface $column) { |
|
183 | 183 | $column->initialize(); |
184 | 184 | }); |
185 | 185 | |
@@ -198,14 +198,14 @@ discard block |
||
198 | 198 | public function render() |
199 | 199 | { |
200 | 200 | $params = $this->toArray(); |
201 | - $params['collection'] = $this->getDisplay()->getCollection(); |
|
202 | - $params['pagination'] = null; |
|
201 | + $params[ 'collection' ] = $this->getDisplay()->getCollection(); |
|
202 | + $params[ 'pagination' ] = null; |
|
203 | 203 | |
204 | - if ($params['collection'] instanceof \Illuminate\Contracts\Pagination\Paginator) { |
|
204 | + if ($params[ 'collection' ] instanceof \Illuminate\Contracts\Pagination\Paginator) { |
|
205 | 205 | if (class_exists('Illuminate\Pagination\BootstrapThreePresenter')) { |
206 | - $params['pagination'] = (new \Illuminate\Pagination\BootstrapThreePresenter($params['collection']))->render(); |
|
206 | + $params[ 'pagination' ] = (new \Illuminate\Pagination\BootstrapThreePresenter($params[ 'collection' ]))->render(); |
|
207 | 207 | } else { |
208 | - $params['pagination'] = $params['collection']->render(); |
|
208 | + $params[ 'pagination' ] = $params[ 'collection' ]->render(); |
|
209 | 209 | } |
210 | 210 | } |
211 | 211 |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | { |
36 | 36 | $this->setName($name); |
37 | 37 | |
38 | - if (! is_null($title)) { |
|
38 | + if (!is_null($title)) { |
|
39 | 39 | $this->setTitle($title); |
40 | 40 | } |
41 | 41 | } |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | */ |
78 | 78 | public function getAlias() |
79 | 79 | { |
80 | - if (! $this->alias) { |
|
80 | + if (!$this->alias) { |
|
81 | 81 | return $this->getName(); |
82 | 82 | } |
83 | 83 | |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | return call_user_func($this->title, $this->getValue()); |
110 | 110 | } |
111 | 111 | |
112 | - return strtr($this->title, [':value' => $this->getValue()]); |
|
112 | + return strtr($this->title, [ ':value' => $this->getValue() ]); |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | /** |
@@ -149,6 +149,6 @@ discard block |
||
149 | 149 | */ |
150 | 150 | public function isActive() |
151 | 151 | { |
152 | - return ! is_null($this->getValue()); |
|
152 | + return !is_null($this->getValue()); |
|
153 | 153 | } |
154 | 154 | } |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | /** |
51 | 51 | * @var array |
52 | 52 | */ |
53 | - protected $with = []; |
|
53 | + protected $with = [ ]; |
|
54 | 54 | |
55 | 55 | /** |
56 | 56 | * @var string |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | $this->repository = $this->makeRepository(); |
168 | 168 | $this->repository->with($this->with); |
169 | 169 | |
170 | - $this->extensions->each(function (DisplayExtensionInterface $extension) { |
|
170 | + $this->extensions->each(function(DisplayExtensionInterface $extension) { |
|
171 | 171 | if ($extension instanceof Initializable) { |
172 | 172 | $extension->initialize(); |
173 | 173 | } |
@@ -201,9 +201,9 @@ discard block |
||
201 | 201 | $this->title, |
202 | 202 | ]; |
203 | 203 | |
204 | - $this->getExtensions()->each(function (DisplayExtensionInterface $extension) use (&$titles) { |
|
204 | + $this->getExtensions()->each(function(DisplayExtensionInterface $extension) use (&$titles) { |
|
205 | 205 | if (method_exists($extension, $method = 'getTitle')) { |
206 | - $titles[] = call_user_func([$extension, $method]); |
|
206 | + $titles[ ] = call_user_func([ $extension, $method ]); |
|
207 | 207 | } |
208 | 208 | }); |
209 | 209 | |
@@ -265,14 +265,14 @@ discard block |
||
265 | 265 | { |
266 | 266 | $view = app('sleeping_owl.template')->view($this->getView(), $this->toArray()); |
267 | 267 | |
268 | - $blocks = []; |
|
268 | + $blocks = [ ]; |
|
269 | 269 | |
270 | - $placableExtensions = $this->getExtensions()->filter(function ($extension) { |
|
270 | + $placableExtensions = $this->getExtensions()->filter(function($extension) { |
|
271 | 271 | return $extension instanceof Placable; |
272 | 272 | }); |
273 | 273 | |
274 | 274 | foreach ($placableExtensions as $extension) { |
275 | - $blocks[$extension->getPlacement()][] = (string) app('sleeping_owl.template')->view( |
|
275 | + $blocks[ $extension->getPlacement() ][ ] = (string) app('sleeping_owl.template')->view( |
|
276 | 276 | $extension->getView(), |
277 | 277 | $extension->toArray() |
278 | 278 | ); |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | |
281 | 281 | foreach ($blocks as $block => $data) { |
282 | 282 | foreach ($data as $html) { |
283 | - if (! empty($html)) { |
|
283 | + if (!empty($html)) { |
|
284 | 284 | $view->getFactory()->startSection($block); |
285 | 285 | echo $html; |
286 | 286 | $view->getFactory()->yieldSection(); |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | $extension = $this->extensions->get($method); |
316 | 316 | |
317 | 317 | if (method_exists($extension, 'set')) { |
318 | - return call_user_func_array([$extension, 'set'], $arguments); |
|
318 | + return call_user_func_array([ $extension, 'set' ], $arguments); |
|
319 | 319 | } |
320 | 320 | } |
321 | 321 | |
@@ -336,9 +336,9 @@ discard block |
||
336 | 336 | */ |
337 | 337 | protected function makeRepository() |
338 | 338 | { |
339 | - $repository = app($this->repositoryClass, [$this->modelClass]); |
|
339 | + $repository = app($this->repositoryClass, [ $this->modelClass ]); |
|
340 | 340 | |
341 | - if (! ($repository instanceof RepositoryInterface)) { |
|
341 | + if (!($repository instanceof RepositoryInterface)) { |
|
342 | 342 | throw new \Exception('Repository class must be instanced of [RepositoryInterface]'); |
343 | 343 | } |
344 | 344 |