The construct function defaults the parameters clientId, clientSecret and accessToken to null so doing this:
$btlObj = new Bitly;
... wipes out any pre-set keys/tokens. There probably is a much cleaner way too fix this (hence why I'm doing this as an issue and not a pull request) but I did quickly this way for the user who needed help:
public function __construct($clientId=null, $clientSecret=null,
$accessToken=null)
{
if ($clientId!==null)
$this->clientId = $clientId;
if ($clientSecret!==null)
$this->clientSecret = $clientSecret;
if ($accessToken!==null)
$this->accessToken = $accessToken;
$this->userAgent = 'PHP/' . phpversion() . ' bitly_api/0.1.0';
}
The construct function defaults the parameters clientId, clientSecret and accessToken to null so doing this:
$btlObj = new Bitly;
... wipes out any pre-set keys/tokens. There probably is a much cleaner way too fix this (hence why I'm doing this as an issue and not a pull request) but I did quickly this way for the user who needed help:
public function __construct($clientId=null, $clientSecret=null, $accessToken=null) {