src/models/Client.php
public function getSortedPurses()
    {
        $purses = $this->purses;
        if (empty($purses)) {
            return $purses;
        }

        $getOrder = function ($currency) {
            $order = ['usd' => 0, 'eur' => 1];

            return $order[$currency] ?? 100;
        };

        usort($purses, function ($a, $b) use ($getOrder) {
            return $getOrder($a->currency) <=> $getOrder($b->currency);
        });

        return $purses;
    }
public function getSortedPurses()
    {
        $purses = $this->purses;
        if (empty($purses)) {
            return $purses;
        }

        $getOrder = function ($currency) {
            $order = ['usd' => 0, 'eur' => 1];

            return $order[$currency] ?? 100;
        };

        usort($purses, function ($a, $b) use ($getOrder) {
            return $getOrder($a->currency) <=> $getOrder($b->currency);
        });

        return $purses;
    }
public function getSortedPurses ( ) { $ purses = $ this -> purses ; if ( empty ( $ purses ) ) { return $ purses ; } $ getOrder = function ( $ currency ) { $ order = [ 'usd' => 0 , 'eur' => 1 ] ; return $ order [ $ currency ] ?? 100 ; } ; usort ( $ purses , function ( $ a , $ b ) use ( $ getOrder ) { return $ getOrder ( $ a -> currency ) <=> $ getOrder ( $ b -> currency ) ; } ) ; return $ purses ; }
Sort related purses like `usd`, `eur`, other...

@return array
Sort related purses like usd eur other ...