construct function without parameters obliterates pre-set clientId, clientSecret and accessToken
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 16
- Forks
- 19
- PR merge metrics
- No merged PRs in 30d
Description
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';
}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the PHP class's __construct entry point described in the issue and inspect how clientId, clientSecret, and accessToken are initialized. Verify that constructing Bitly without arguments preserves pre-set values while explicit arguments still apply; add or run the relevant constructor tests if present.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100