@@ -91,8 +91,7 @@ discard block |
||
| 91 | 91 | } |
| 92 | 92 | if ($ordered) { |
| 93 | 93 | $returnTeams = $this->sortTeams($ordering); |
| 94 | - } |
|
| 95 | - else { |
|
| 94 | + } else { |
|
| 96 | 95 | $returnTeams = $this->teams->unique()->get(); |
| 97 | 96 | } |
| 98 | 97 | |
@@ -142,8 +141,7 @@ discard block |
||
| 142 | 141 | if ($this instanceof WithGroupsInterface) { |
| 143 | 142 | $filter = new Filter($filters, $this->getGroups()); |
| 144 | 143 | $filter->filter($teams); |
| 145 | - } |
|
| 146 | - else if ($this instanceof Group) { |
|
| 144 | + } else if ($this instanceof Group) { |
|
| 147 | 145 | $filter = new Filter($filters, [$this]); |
| 148 | 146 | $filter->filter($teams); |
| 149 | 147 | } |
@@ -95,7 +95,7 @@ |
||
| 95 | 95 | public function orderGroups() : array { |
| 96 | 96 | $groups = $this->getGroups(); |
| 97 | 97 | usort($groups, static function($a, $b) { |
| 98 | - return $a->getOrder() - $b->getOrder(); |
|
| 98 | + return $a->getOrder()-$b->getOrder(); |
|
| 99 | 99 | }); |
| 100 | 100 | return $groups; |
| 101 | 101 | } |
@@ -48,8 +48,7 @@ discard block |
||
| 48 | 48 | // Get initial data |
| 49 | 49 | if ($this->topLevelOnly) { |
| 50 | 50 | $data = $this->container->getTopLevel(); |
| 51 | - } |
|
| 52 | - else { |
|
| 51 | + } else { |
|
| 53 | 52 | $data = $this->container->get(); |
| 54 | 53 | } |
| 55 | 54 | |
@@ -64,8 +63,7 @@ discard block |
||
| 64 | 63 | } |
| 65 | 64 | $ids[] = $obj->getId(); |
| 66 | 65 | } |
| 67 | - } |
|
| 68 | - else { |
|
| 66 | + } else { |
|
| 69 | 67 | $data = array_unique($data); |
| 70 | 68 | } |
| 71 | 69 | } |
@@ -78,11 +76,9 @@ discard block |
||
| 78 | 76 | // Sorting |
| 79 | 77 | if (isset($this->sorter)) { |
| 80 | 78 | $data = $this->sorter->sort($data); |
| 81 | - } |
|
| 82 | - elseif (isset($this->sortClosure)) { |
|
| 79 | + } elseif (isset($this->sortClosure)) { |
|
| 83 | 80 | uasort($data, $this->sortClosure); |
| 84 | - } |
|
| 85 | - elseif (isset($this->sortProperty)) { |
|
| 81 | + } elseif (isset($this->sortProperty)) { |
|
| 86 | 82 | uasort($data, [$this, 'sortByPropertyCallback']); |
| 87 | 83 | } |
| 88 | 84 | |
@@ -181,14 +177,12 @@ discard block |
||
| 181 | 177 | $property2 = null; |
| 182 | 178 | if (is_object($value1) && isset($value1->$property)) { |
| 183 | 179 | $property1 = $value1->$property; |
| 184 | - } |
|
| 185 | - elseif (is_array($value1) && isset($value1[$property])) { |
|
| 180 | + } elseif (is_array($value1) && isset($value1[$property])) { |
|
| 186 | 181 | $property1 = $value1[$property]; |
| 187 | 182 | } |
| 188 | 183 | if (is_object($value2) && isset($value2->$property)) { |
| 189 | 184 | $property2 = $value2->$property; |
| 190 | - } |
|
| 191 | - elseif (is_array($value2) && isset($value2[$property])) { |
|
| 185 | + } elseif (is_array($value2) && isset($value2[$property])) { |
|
| 192 | 186 | $property2 = $value2[$property]; |
| 193 | 187 | } |
| 194 | 188 | |