Skip to content

Commit

Permalink
Merge pull request #74 from bshaffer/misc-fixes
Browse files Browse the repository at this point in the history
adds docs, changes is_null to empty, adds clone
  • Loading branch information
tbetbetbe committed Oct 2, 2015
2 parents 6ddd5a0 + 9eae8e2 commit 213ca87
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/AuthTokenFetcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class AuthTokenFetcher implements SubscriberInterface
* @param FetchAuthTokenInterface $fetcher is used to fetch the auth token
* @param array $cacheConfig configures the cache
* @param CacheInterface $cache (optional) caches the token.
* @param ClientInterface $client (optional) http client to fetch the token.
*/
public function __construct(FetchAuthTokenInterface $fetcher,
array $cacheConfig = null,
Expand Down Expand Up @@ -113,7 +114,7 @@ public function onBefore(BeforeEvent $event)
//
// TODO: correct caching; enable the cache to be cleared.
$cached = $this->getCachedValue();
if (!is_null($cached)) {
if (!empty($cached)) {
$request->setHeader('Authorization', 'Bearer ' . $cached);
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/OAuth2.php
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ public function buildFullAuthorizationUri(array $config = null)
}

// Construct the uri object; return it if it is valid.
$result = $this->authorizationUri;
$result = clone $this->authorizationUri;
if (is_string($result)) {
$result = Url::fromString($this->getAuthorizationUri());
}
Expand Down

0 comments on commit 213ca87

Please sign in to comment.