src/Api/User.php
public function add(string $requestMessage = null) : void
    {
        if ($this->onlineIdParameter() === 'me') return;

        $data = ($requestMessage === null) ? new \stdClass() : [
            "requestMessage" => $requestMessage
        ];

        $this->postJson(sprintf(self::USERS_ENDPOINT . 'friendList/%s', $this->client->onlineId(), $this->onlineId()), $data);
    }
public function add(string $requestMessage = null) : void
    {
        if ($this->onlineIdParameter() === 'me') return;

        $data = ($requestMessage === null) ? new \stdClass() : [
            "requestMessage" => $requestMessage
        ];

        $this->postJson(sprintf(self::USERS_ENDPOINT . 'friendList/%s', $this->client->onlineId(), $this->onlineId()), $data);
    }
public function add ( string $ requestMessage = null ) : void { if ( $ this -> onlineIdParameter ( ) === 'me' ) return ; $ data = ( $ requestMessage === null ) ? new \ stdClass ( ) : [ "requestMessage" => $ requestMessage ] ; $ this -> postJson ( sprintf ( self :: USERS_ENDPOINT . 'friendList/%s' , $ this -> client -> onlineId ( ) , $ this -> onlineId ( ) ) , $ data ) ; }
Add the User to friends list.

Will not do anything if called on the logged in user.

@param string $requestMessage Message to send with the request.
@return void
Add the User to friends list .