@@ -162,7 +162,9 @@ discard block |
||
162 | 162 | // sort tags by depth so that there will be no errors in case we are deleting parent and child |
163 | 163 | $tagsCollection = $tagsCollection->getArrayCopy(); |
164 | 164 | uasort($tagsCollection, function ($t1, $t2) { |
165 | - if ($t1->depth == $t2->depth) return 0; |
|
165 | + if ($t1->depth == $t2->depth) { |
|
166 | + return 0; |
|
167 | + } |
|
166 | 168 | return ($t1->depth > $t2->depth) ? -1 : 1; |
167 | 169 | }); |
168 | 170 | |
@@ -267,7 +269,9 @@ discard block |
||
267 | 269 | // sort top to bottom |
268 | 270 | $tagCollection = $tagCollection->getArrayCopy(); |
269 | 271 | uasort($tagCollection, function ($t1, $t2) { |
270 | - if ($t1->depth == $t2->depth) return 0; |
|
272 | + if ($t1->depth == $t2->depth) { |
|
273 | + return 0; |
|
274 | + } |
|
271 | 275 | return ($t1->depth > $t2->depth) ? 1 : -1; |
272 | 276 | }); |
273 | 277 | break; |
@@ -275,7 +279,9 @@ discard block |
||
275 | 279 | // sort bottom to top |
276 | 280 | $tagCollection = $tagCollection->getArrayCopy(); |
277 | 281 | uasort($tagCollection, function ($t1, $t2) { |
278 | - if ($t1->depth == $t2->depth) return 0; |
|
282 | + if ($t1->depth == $t2->depth) { |
|
283 | + return 0; |
|
284 | + } |
|
279 | 285 | return ($t1->depth > $t2->depth) ? -1 : 1; |
280 | 286 | }); |
281 | 287 | break; |