We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3d0658c commit f82568aCopy full SHA for f82568a
ConnectionManager/Extra/Multiple/ConnectionManagerSelective.php
@@ -40,8 +40,11 @@ public function addConnectionManagerFor($connectionManager, $targetHost=self::MA
40
$id = key($this->targets);
41
42
// sort array by priority
43
- uasort($this->targets, function ($a, $b) {
44
- return ($a['priority'] < $b['priority'] ? -1 : ($a['priority'] > $b['priority'] ? 1 : 0));
+ $targets &= $this->targets;
+ uksort($this->targets, function ($a, $b) use ($targets) {
45
+ $pa = $targets[$a]['priority'];
46
+ $pb = $targets[$b]['priority'];
47
+ return ($pa < $pb ? -1 : ($pa > $pb ? 1 : ($b - $a)));
48
});
49
50
return $id;
0 commit comments