From d0a401322ea6f6b8bdebd4da03b90b3f51b942ae Mon Sep 17 00:00:00 2001 From: Tac Tacelosky Date: Sun, 15 Dec 2024 06:01:51 -0600 Subject: [PATCH] Drop PHP < 8.2, and get tests working with PHP 8.4 * ticketid is a string, not an int * allow later versions of Symfony * fix php 8.4 deprecations * bump to php 8.2 --- .github/workflows/ci.yml | 2 +- composer.json | 6 +++--- src/Oauth/PhpFlickrService.php | 2 +- src/PhotosApi.php | 4 ++-- src/PhpFlickr.php | 2 +- src/Uploader.php | 1 + 6 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0075d4f..4286276 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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}} diff --git a/composer.json b/composer.json index c510538..3490422 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ } }, "require": { - "php": "^7.3 || ^8.0", + "php": "^8.2", "ext-curl": "*", "ext-json": "*", "ext-libxml": "*", @@ -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" }, diff --git a/src/Oauth/PhpFlickrService.php b/src/Oauth/PhpFlickrService.php index 6bb3220..8e03122 100644 --- a/src/Oauth/PhpFlickrService.php +++ b/src/Oauth/PhpFlickrService.php @@ -21,7 +21,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/'); diff --git a/src/PhotosApi.php b/src/PhotosApi.php index 530498d..0e472c9 100644 --- a/src/PhotosApi.php +++ b/src/PhotosApi.php @@ -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)) { diff --git a/src/PhpFlickr.php b/src/PhpFlickr.php index b2c2a12..7b88d01 100644 --- a/src/PhpFlickr.php +++ b/src/PhpFlickr.php @@ -81,7 +81,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; diff --git a/src/Uploader.php b/src/Uploader.php index b8d544b..1690074 100644 --- a/src/Uploader.php +++ b/src/Uploader.php @@ -12,6 +12,7 @@ class Uploader /** @var PhpFlickr */ protected $flickr; + protected $response; /** @var string */ protected $uploadEndpoint = 'https://up.flickr.com/services/upload/';