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/Oauth/PhpFlickrService.php b/src/Oauth/PhpFlickrService.php index 8e03122..35aba6e 100644 --- a/src/Oauth/PhpFlickrService.php +++ b/src/Oauth/PhpFlickrService.php @@ -7,7 +7,6 @@ use OAuth\Common\Http\Uri\Uri; use OAuth\Common\Http\Uri\UriInterface; use OAuth\Common\Storage\TokenStorageInterface; -use OAuth\OAuth1\Service\AbstractService; use OAuth\OAuth1\Service\Flickr; use OAuth\OAuth1\Signature\SignatureInterface; @@ -37,17 +36,17 @@ public static function setBaseUrl($baseUrl) static::$baseUrl = rtrim($baseUrl, '/'); } - public function getRequestTokenEndpoint() + public function getRequestTokenEndpoint(): UriInterface { return new Uri(static::$baseUrl . '/oauth/request_token'); } - public function getAuthorizationEndpoint() + public function getAuthorizationEndpoint(): UriInterface { return new Uri(static::$baseUrl . '/oauth/authorize'); } - public function getAccessTokenEndpoint() + public function getAccessTokenEndpoint(): UriInterface { return new Uri(static::$baseUrl . '/oauth/access_token'); } diff --git a/src/PhpFlickr.php b/src/PhpFlickr.php index 7b88d01..4f863dc 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') {