Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Phan issue and improve uploads example #86

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .phan/baseline.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@
'src/GroupsPoolsApi.php' => ['PhanUnextractableAnnotation'],
'src/InterestingnessApi.php' => ['PhanUnextractableAnnotation'],
'src/MachinetagsApi.php' => ['PhanUnextractableAnnotation'],
'src/Oauth/PhpFlickrService.php' => [
'PhanUndeclaredClass', 'PhanUndeclaredClassMethod', 'PhanUndeclaredExtendedClass',
'PhanUndeclaredMethod', 'PhanUndeclaredProperty', 'PhanUndeclaredTypeParameter',
'PhanUnreferencedUseNormal'
],
'src/PandaApi.php' => ['PhanUnextractableAnnotation'],
'src/PeopleApi.php' => ['PhanUnextractableAnnotation'],
'src/PhotosApi.php' => ['PhanTypeMismatchDefault', 'PhanTypeMismatchForeach', 'PhanUnextractableAnnotation'],
Expand Down
8 changes: 6 additions & 2 deletions examples/uploads.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,9 @@
true,
true
);
$info = $phpFlickr->photos()->getInfo($result['photoid']);
echo "The new photo is: " . $info['urls']['url'][0]['_content'] . "\n";
if ($result['stat'] === 'fail') {
echo $result['message'] . "\n";
} else {
$info = $phpFlickr->photos()->getInfo($result['photoid']);
echo "The new photo is: " . $info['urls']['url'][0]['_content'] . "\n";
}
2 changes: 2 additions & 0 deletions src/Oauth/PhpFlickrService.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use OAuth\Common\Storage\TokenStorageInterface;
use OAuth\OAuth1\Service\Flickr;
use OAuth\OAuth1\Signature\SignatureInterface;
use OAuth\OAuth1\Token\TokenInterface;

class PhpFlickrService extends Flickr
{
Expand Down Expand Up @@ -71,6 +72,7 @@ public function service()
public function getAuthorizationForPostingToAlternateUrl($args, $uri)
{
$token = $this->storage->retrieveAccessToken($this->service());
assert($token instanceof TokenInterface);
$this->signature->setTokenSecret($token->getAccessTokenSecret());
$authParameters = $this->getBasicAuthorizationHeaderInfo();
if (isset($authParameters['oauth_callback'])) {
Expand Down
Loading