From b96dee920ee17985116b5a8e4fcf8385b1429f5f Mon Sep 17 00:00:00 2001 From: Sam Wilson Date: Mon, 16 Dec 2024 07:39:41 +0800 Subject: [PATCH] Add vendor dir to Phan, fix other errors --- .phan/config.php | 1 + src/PhpFlickr.php | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.phan/config.php b/.phan/config.php index 74a9cab..9979d2f 100644 --- a/.phan/config.php +++ b/.phan/config.php @@ -3,6 +3,7 @@ return [ 'directory_list' => [ 'src', + 'vendor', ], 'exclude_file_regex' => '@^vendor/.*/(tests?|Tests?)/@', 'exclude_analysis_directory_list' => [ diff --git a/src/PhpFlickr.php b/src/PhpFlickr.php index 7b88d01..739d9a5 100644 --- a/src/PhpFlickr.php +++ b/src/PhpFlickr.php @@ -26,6 +26,7 @@ use OAuth\Common\Consumer\Credentials; use OAuth\Common\Http\Client\CurlClient; use OAuth\Common\Http\Uri\Uri; +use OAuth\Common\Http\Uri\UriInterface; use OAuth\Common\Storage\Memory; use OAuth\Common\Storage\TokenStorageInterface; use OAuth\OAuth1\Service\Flickr; @@ -281,8 +282,8 @@ public function getOauthService($callbackUrl = 'oob') $factory->registerService('Flickr', PhpFlickrService::class); $factory->setHttpClient(new CurlClient()); $storage = $this->getOauthTokenStorage(); - /** @var PhpFlickrService $flickrService */ $this->oauthService = $factory->createService('Flickr', $credentials, $storage); + assert( $this->oauthService instanceof PhpFlickrService ); return $this->oauthService; } @@ -295,7 +296,7 @@ public function getOauthService($callbackUrl = 'oob') * @param string $perm One of 'read', 'write', or 'delete'. * @param string $callbackUrl Defaults to 'oob' ('out-of-band') for when no callback is * required, for example for console usage. - * @return Uri + * @return UriInterface */ public function getAuthUrl($perm = 'read', $callbackUrl = 'oob') {