Skip to content

Commit 01a6102

Browse files
author
Jordan Hall
committed
Change sorting method for portmanteaus
1 parent 99fb013 commit 01a6102

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/Word.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,6 @@ public function portmanteaus()
115115

116116
$portmanteaus = [];
117117

118-
usort($responseItems, function($a, $b) {
119-
return $a->combined > $b->combined ? 1 : -1;
120-
});
121-
122118
foreach($responseItems as $responseItem) {
123119
$responseItemPortmanteaus = array_map(function($portmanteauString) {
124120
return new Word($portmanteauString);
@@ -127,6 +123,8 @@ public function portmanteaus()
127123
$portmanteaus = array_merge($portmanteaus, $responseItemPortmanteaus);
128124
}
129125

126+
sort($portmanteaus);
127+
130128
$this->cache->set($cacheKey, $portmanteaus);
131129

132130
return $portmanteaus;

0 commit comments

Comments
 (0)