public function authenticate($username, $token) {
        if (empty($username) || empty($token)) {
            throw new \ErrorException('No username or token supplied.');
        }
        
        $this->username = $username;
        $this->token = $token;
    }
public function authenticate($username, $token) {
        if (empty($username) || empty($token)) {
            throw new \ErrorException('No username or token supplied.');
        }
        
        $this->username = $username;
        $this->token = $token;
    }
public function authenticate ( $ username , $ token ) { if ( empty ( $ username ) || empty ( $ token ) ) { throw new \ ErrorException ( 'No username or token supplied.' ) ; } $ this -> username = $ username ; $ this -> token = $ token ; }
Set API credentials

@param string $username API username
@param string $token API token
Set API credentials