Skip to content

Commit

Permalink
Merge branch 'samwilson:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
tacman authored Dec 16, 2024
2 parents 97b0fdf + 70f4ff9 commit 900652a
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
# All supported PHP versions https://www.php.net/supported-versions.php
php: [ '7.3', '7.4', '8.0', '8.1' ]
php: [ '8.2','8.3','8.4' ]

runs-on: ${{matrix.os}}

Expand Down
1 change: 1 addition & 0 deletions .phan/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
return [
'directory_list' => [
'src',
'vendor',
],
'exclude_file_regex' => '@^vendor/.*/(tests?|Tests?)/@',
'exclude_analysis_directory_list' => [
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
}
},
"require": {
"php": "^7.3 || ^8.0",
"php": "^8.2",
"ext-curl": "*",
"ext-json": "*",
"ext-libxml": "*",
Expand All @@ -26,8 +26,8 @@
"squizlabs/php_codesniffer": "^3.0",
"mediawiki/minus-x": "^0.3 || ^1.0",
"phpunit/phpunit": "^9.5",
"symfony/cache": "^5.4",
"symfony/var-dumper": "^5.4",
"symfony/cache": "^5.4|^6.4|^7.0",
"symfony/var-dumper": "^5.4|^6.4|^7.0",
"php-parallel-lint/php-parallel-lint": "^1.3",
"phan/phan": "^5.4"
},
Expand Down
9 changes: 4 additions & 5 deletions src/Oauth/PhpFlickrService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -21,7 +20,7 @@ public function __construct(
ClientInterface $httpClient,
TokenStorageInterface $storage,
SignatureInterface $signature,
UriInterface $baseApiUri = null
?UriInterface $baseApiUri = null
) {
if ($baseApiUri === null) {
$baseApiUri = new Uri(static::$baseUrl . '/rest/');
Expand All @@ -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');
}
Expand Down
4 changes: 2 additions & 2 deletions src/PhotosApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -847,9 +847,9 @@ public function setContentType($photoId, $contentType)
*/
public function setDates(
$photoId,
DateTime $dateTaken = null,
DateTime|null $dateTaken = null,
$dateTakenGranularity = null,
DateTime $datePosted = null
DateTime|null $datePosted = null
) {
$args = ['photo_id' => $photoId];
if (!empty($dateTaken)) {
Expand Down
9 changes: 5 additions & 4 deletions src/PhpFlickr.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -38,7 +39,7 @@
class PhpFlickr
{
/** PhpFlickr version. */
public const VERSION = '5.1.0';
public const VERSION = '6.0.1';

/** @param string */
protected $api_key;
Expand Down Expand Up @@ -81,7 +82,7 @@ class PhpFlickr
* @param string $apiKey
* @param string|null $secret
*/
public function __construct(string $apiKey, string $secret = null)
public function __construct(string $apiKey, string|null $secret = null)
{
$this->api_key = $apiKey;
$this->secret = $secret;
Expand Down Expand Up @@ -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;
}

Expand All @@ -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')
{
Expand Down
1 change: 1 addition & 0 deletions src/Uploader.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class Uploader
/** @var PhpFlickr */
protected $flickr;

protected $response;
/** @var string */
protected $uploadEndpoint = 'https://up.flickr.com/services/upload/';

Expand Down

0 comments on commit 900652a

Please sign in to comment.