src/Api/User.php
public function friends($sort = 'onlineStatus', $offset = 0, $limit = 36) : array
    {
        $result = [];

        $friends = $this->get(sprintf(self::USERS_ENDPOINT . 'friends/profiles2', $this->onlineIdParameter()), [
            'fields' => 'onlineId,accountId,avatarUrls,plus,trophySummary(@default),isOfficiallyVerified,personalDetail(@default,profilePictureUrls),presences(@titleInfo,hasBroadcastData,lastOnlineDate),presences(@titleInfo),friendRelation,consoleAvailability',
            'offset' => $offset,
            'limit' => $limit,
            'profilePictureSizes' => 'm',
            'avatarSizes' => 'm',
            'titleIconSize' => 's',
            'sort' => $sort
        ]);
        
        foreach ($friends->profiles as $friend) {
            $result[] = new self($this->client, $friend);
        }

        return $result;
    }
public function friends($sort = 'onlineStatus', $offset = 0, $limit = 36) : array
    {
        $result = [];

        $friends = $this->get(sprintf(self::USERS_ENDPOINT . 'friends/profiles2', $this->onlineIdParameter()), [
            'fields' => 'onlineId,accountId,avatarUrls,plus,trophySummary(@default),isOfficiallyVerified,personalDetail(@default,profilePictureUrls),presences(@titleInfo,hasBroadcastData,lastOnlineDate),presences(@titleInfo),friendRelation,consoleAvailability',
            'offset' => $offset,
            'limit' => $limit,
            'profilePictureSizes' => 'm',
            'avatarSizes' => 'm',
            'titleIconSize' => 's',
            'sort' => $sort
        ]);
        
        foreach ($friends->profiles as $friend) {
            $result[] = new self($this->client, $friend);
        }

        return $result;
    }
public function friends ( $ sort = 'onlineStatus' , $ offset = 0 , $ limit = 36 ) : array { $ result = [ ] ; $ friends = $ this -> get ( sprintf ( self :: USERS_ENDPOINT . 'friends/profiles2' , $ this -> onlineIdParameter ( ) ) , [ 'fields' => 'onlineId,accountId,avatarUrls,plus,trophySummary(@default),isOfficiallyVerified,personalDetail(@default,profilePictureUrls),presences(@titleInfo,hasBroadcastData,lastOnlineDate),presences(@titleInfo),friendRelation,consoleAvailability' , 'offset' => $ offset , 'limit' => $ limit , 'profilePictureSizes' => 'm' , 'avatarSizes' => 'm' , 'titleIconSize' => 's' , 'sort' => $ sort ] ) ; foreach ( $ friends -> profiles as $ friend ) { $ result [ ] = new self ( $ this -> client , $ friend ) ; } return $ result ; }
Gets the User's friends.

@param string $sort Order to return friends in (onlineStatus | name-onlineId)
@param integer $offset Where to start
@param integer $limit How many friends to return
@return array Array of Api\User.
Gets the User s friends .