From c7976f0fe262d91088cd6c2bc5bc462ecbc0586f Mon Sep 17 00:00:00 2001 From: Gerben Jacobs Date: Sun, 22 Dec 2024 22:52:09 +0100 Subject: [PATCH] fix 8.4 deprecation notices --- src/Exceptions/HabboNotFoundException.php | 2 +- src/Exceptions/MaintenanceException.php | 2 +- src/Exceptions/UserInvalidException.php | 2 +- src/HabboAPI.php | 2 +- src/HabboParser.php | 4 ++-- src/HabboParserInterface.php | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Exceptions/HabboNotFoundException.php b/src/Exceptions/HabboNotFoundException.php index 8327590..02ee811 100644 --- a/src/Exceptions/HabboNotFoundException.php +++ b/src/Exceptions/HabboNotFoundException.php @@ -6,7 +6,7 @@ class HabboNotFoundException extends Exception { - public function __construct($message, $code = 0, Exception $previous = null) + public function __construct($message, $code = 0, ?Exception $previous = null) { parent::__construct($message, $code, $previous); } diff --git a/src/Exceptions/MaintenanceException.php b/src/Exceptions/MaintenanceException.php index 67c5d5d..ff9d973 100644 --- a/src/Exceptions/MaintenanceException.php +++ b/src/Exceptions/MaintenanceException.php @@ -6,7 +6,7 @@ class MaintenanceException extends Exception { - public function __construct($message, $code = 0, Exception $previous = null) + public function __construct($message, $code = 0, ?Exception $previous = null) { parent::__construct($message, $code, $previous); } diff --git a/src/Exceptions/UserInvalidException.php b/src/Exceptions/UserInvalidException.php index af5890c..3af63e8 100644 --- a/src/Exceptions/UserInvalidException.php +++ b/src/Exceptions/UserInvalidException.php @@ -6,7 +6,7 @@ class UserInvalidException extends Exception { - public function __construct($message, $code = 0, Exception $previous = null) + public function __construct($message, $code = 0, ?Exception $previous = null) { parent::__construct($message, $code, $previous); } diff --git a/src/HabboAPI.php b/src/HabboAPI.php index ddf25bf..928a1c1 100644 --- a/src/HabboAPI.php +++ b/src/HabboAPI.php @@ -62,7 +62,7 @@ public function getProfile(string $id): Profile * @param string|null $id The unique ID Habbo uses for their api. Starts with "hh-" (i.e. "hhus-") * @return Photo[] Array of Photo objects */ - public function getPhotos(string $id = null): array + public function getPhotos(?string $id = null): array { return $this->parser->parsePhotos($id); } diff --git a/src/HabboParser.php b/src/HabboParser.php index a10a689..f14c46e 100644 --- a/src/HabboParser.php +++ b/src/HabboParser.php @@ -131,11 +131,11 @@ public function parseProfile($id): Profile * parsePhotos will collect the public photos for an HHID * If no $id is given, it will grab the latest photos of the entire hotel * - * @param int|null $id + * @param string|null $id * @return Photo[] * @throws Exception */ - public function parsePhotos($id = null): array + public function parsePhotos(?string $id = null): array { $url = (isset($id)) ? '/extradata/public/users/' . $id . '/photos' : '/extradata/public/photos'; list($data) = $this->_callUrl($this->api_base . $url); diff --git a/src/HabboParserInterface.php b/src/HabboParserInterface.php index 93622c3..ece2825 100644 --- a/src/HabboParserInterface.php +++ b/src/HabboParserInterface.php @@ -9,7 +9,7 @@ public function parseHabbo(string $identifier, bool $useUniqueId = false); public function parseProfile(string $id); - public function parsePhotos(string $id = null); + public function parsePhotos(?string $id = null); public function parseAchievements(string $id); } \ No newline at end of file