Skip to content

Commit

Permalink
Fix some calls to deprecated methods
Browse files Browse the repository at this point in the history
* Return PeopleApi::getInfo() to its previous structure.
* Remove deprecated methods.
* Remove unused use statements.
* Add symfony/var-dumper for use in debugging.
  • Loading branch information
samwilson authored Apr 25, 2023
1 parent a25e40a commit 5a2c3e5
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ Now, you can pass the storage into PhpFlickr, and start making requests:

```php
$flickr->setOauthStorage($storage);
$recent = $phpFlickr->photos_getContactsPhotos();
$recent = $phpFlickr->photos()->getContactsPhotos();
```

See the [Usage section](#usage) above for more details on the request methods,
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"mediawiki/minus-x": "^0.3 || ^1.0",
"phpunit/phpunit": "^9.5",
"symfony/cache": "^5.4",
"symfony/var-dumper": "^5.4",
"php-parallel-lint/php-parallel-lint": "^1.3",
"phan/phan": "^5.4"
},
Expand Down
2 changes: 1 addition & 1 deletion examples/recent_photos.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
// Display a list of photo titles.
echo '<ul>';
foreach ($recent as $photo) {
$owner = $phpFlickr->people_getInfo($photo['owner']);
$owner = $phpFlickr->people()->getInfo($photo['owner']);
$url = 'https://flic.kr/p/' . \Samwilson\PhpFlickr\Util::base58encode($photo['id']);
echo "<li> Photo: <a href='$url'>" . $photo['title'] . "</a>";
echo "; Owner: ";
Expand Down
2 changes: 1 addition & 1 deletion examples/unauthenticated_requests.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@

// Get the 10 most recent photos, with URLs for their 'small' size.
// For details of the size suffixes, see https://www.flickr.com/services/api/misc.urls.html
$recent = $flickr->photosGetRecent(['url_s'], 10);
$recent = $flickr->photos()->getRecent(['url_s'], 10);

print_r($recent);
3 changes: 2 additions & 1 deletion src/PeopleApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ public function getInfo($userId)
$params = [
'user_id' => $userId
];
return $this->flickr->request('flickr.people.getInfo', $params);
$response = $this->flickr->request('flickr.people.getInfo', $params);
return isset($response['person']) ? $response['person'] : null;
}

/**
Expand Down
3 changes: 0 additions & 3 deletions src/PhpFlickr.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,8 @@
namespace Samwilson\PhpFlickr;

use DateInterval;
use DateTime;
use Exception;
use OAuth\Common\Consumer\Credentials;
use OAuth\Common\Http\Client\CurlClient;
use OAuth\Common\Http\Exception\TokenResponseException;
use OAuth\Common\Http\Uri\Uri;
use OAuth\Common\Storage\Memory;
use OAuth\Common\Storage\TokenStorageInterface;
Expand Down

0 comments on commit 5a2c3e5

Please sign in to comment.