Skip to content

Commit 79cbc80

Browse files
authored
Add return types to PhpFlickrService methods
* Add return types to PhpFlickrService methods. * Remove an unused import. * Add `vendor/` directory to Phan. Fixes #79
1 parent d0a4013 commit 79cbc80

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

.phan/config.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
return [
44
'directory_list' => [
55
'src',
6+
'vendor',
67
],
78
'exclude_file_regex' => '@^vendor/.*/(tests?|Tests?)/@',
89
'exclude_analysis_directory_list' => [

src/Oauth/PhpFlickrService.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
use OAuth\Common\Http\Uri\Uri;
88
use OAuth\Common\Http\Uri\UriInterface;
99
use OAuth\Common\Storage\TokenStorageInterface;
10-
use OAuth\OAuth1\Service\AbstractService;
1110
use OAuth\OAuth1\Service\Flickr;
1211
use OAuth\OAuth1\Signature\SignatureInterface;
1312

@@ -37,17 +36,17 @@ public static function setBaseUrl($baseUrl)
3736
static::$baseUrl = rtrim($baseUrl, '/');
3837
}
3938

40-
public function getRequestTokenEndpoint()
39+
public function getRequestTokenEndpoint(): UriInterface
4140
{
4241
return new Uri(static::$baseUrl . '/oauth/request_token');
4342
}
4443

45-
public function getAuthorizationEndpoint()
44+
public function getAuthorizationEndpoint(): UriInterface
4645
{
4746
return new Uri(static::$baseUrl . '/oauth/authorize');
4847
}
4948

50-
public function getAccessTokenEndpoint()
49+
public function getAccessTokenEndpoint(): UriInterface
5150
{
5251
return new Uri(static::$baseUrl . '/oauth/access_token');
5352
}

src/PhpFlickr.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
use OAuth\Common\Consumer\Credentials;
2727
use OAuth\Common\Http\Client\CurlClient;
2828
use OAuth\Common\Http\Uri\Uri;
29+
use OAuth\Common\Http\Uri\UriInterface;
2930
use OAuth\Common\Storage\Memory;
3031
use OAuth\Common\Storage\TokenStorageInterface;
3132
use OAuth\OAuth1\Service\Flickr;
@@ -281,8 +282,8 @@ public function getOauthService($callbackUrl = 'oob')
281282
$factory->registerService('Flickr', PhpFlickrService::class);
282283
$factory->setHttpClient(new CurlClient());
283284
$storage = $this->getOauthTokenStorage();
284-
/** @var PhpFlickrService $flickrService */
285285
$this->oauthService = $factory->createService('Flickr', $credentials, $storage);
286+
assert($this->oauthService instanceof PhpFlickrService);
286287
return $this->oauthService;
287288
}
288289

@@ -295,7 +296,7 @@ public function getOauthService($callbackUrl = 'oob')
295296
* @param string $perm One of 'read', 'write', or 'delete'.
296297
* @param string $callbackUrl Defaults to 'oob' ('out-of-band') for when no callback is
297298
* required, for example for console usage.
298-
* @return Uri
299+
* @return UriInterface
299300
*/
300301
public function getAuthUrl($perm = 'read', $callbackUrl = 'oob')
301302
{

0 commit comments

Comments
 (0)