@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | } |
288 | 288 | |
289 | 289 | /** |
290 | - * @param string|array $sortableGroupField |
|
290 | + * @param string|null $sortableGroupField |
|
291 | 291 | * @param Model $entity |
292 | 292 | * |
293 | 293 | * @throws SortableException |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | } |
309 | 309 | |
310 | 310 | /** |
311 | - * @param Model|SortableTrait $entity1 |
|
311 | + * @param SortableTrait $entity1 |
|
312 | 312 | * @param Model $entity2 |
313 | 313 | * @param string $field |
314 | 314 | * |
@@ -93,14 +93,14 @@ discard block |
||
93 | 93 | $oldPosition = $this->getAttribute($sortableField); |
94 | 94 | $newPosition = $entity->getAttribute($sortableField); |
95 | 95 | |
96 | - if($groupField && $this->getCanSwitchBetweenGroups()) { |
|
96 | + if ($groupField && $this->getCanSwitchBetweenGroups()) { |
|
97 | 97 | $oldList = $this->getAttribute($groupField); |
98 | 98 | $newList = $entity->getAttribute($groupField); |
99 | - if($oldList !== $newList) |
|
99 | + if ($oldList !== $newList) |
|
100 | 100 | { |
101 | 101 | $query = static::applySortableGroup(static::on(), $entity); |
102 | 102 | $oldPosition = $query->max($sortableField) + 1; |
103 | - $this->setAttribute($groupField,$newList); |
|
103 | + $this->setAttribute($groupField, $newList); |
|
104 | 104 | } |
105 | 105 | } |
106 | 106 | |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | { |
271 | 271 | $sortableGroupField = self::getSortableGroupField(); |
272 | 272 | |
273 | - if($sortableGroupField == null || is_array($sortableGroupField)) |
|
273 | + if ($sortableGroupField == null || is_array($sortableGroupField)) |
|
274 | 274 | return false; |
275 | 275 | |
276 | 276 | return isset(static::$switchBetweenGroups) ? static::$switchBetweenGroups : false; |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | */ |
295 | 295 | public function checkSortableGroupField($sortableGroupField, $entity) |
296 | 296 | { |
297 | - if($this->getCanSwitchBetweenGroups()) { |
|
297 | + if ($this->getCanSwitchBetweenGroups()) { |
|
298 | 298 | return; |
299 | 299 | } |
300 | 300 |
@@ -270,8 +270,9 @@ |
||
270 | 270 | { |
271 | 271 | $sortableGroupField = self::getSortableGroupField(); |
272 | 272 | |
273 | - if($sortableGroupField == null || is_array($sortableGroupField)) |
|
274 | - return false; |
|
273 | + if($sortableGroupField == null || is_array($sortableGroupField)) { |
|
274 | + return false; |
|
275 | + } |
|
275 | 276 | |
276 | 277 | return isset(static::$switchBetweenGroups) ? static::$switchBetweenGroups : false; |
277 | 278 | } |