Skip to content

Commit

Permalink
fix 8.4 deprecation notices
Browse files Browse the repository at this point in the history
  • Loading branch information
gerbenjacobs committed Dec 22, 2024
1 parent aec0df9 commit c7976f0
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Exceptions/HabboNotFoundException.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Check notice on line 9 in src/Exceptions/HabboNotFoundException.php

View check run for this annotation

codefactor.io / CodeFactor

src/Exceptions/HabboNotFoundException.php#L9

Possible useless method overriding detected. (Generic.CodeAnalysis.UselessOverridingMethod)
{
parent::__construct($message, $code, $previous);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptions/MaintenanceException.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Check notice on line 9 in src/Exceptions/MaintenanceException.php

View check run for this annotation

codefactor.io / CodeFactor

src/Exceptions/MaintenanceException.php#L9

Possible useless method overriding detected. (Generic.CodeAnalysis.UselessOverridingMethod)
{
parent::__construct($message, $code, $previous);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptions/UserInvalidException.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Check notice on line 9 in src/Exceptions/UserInvalidException.php

View check run for this annotation

codefactor.io / CodeFactor

src/Exceptions/UserInvalidException.php#L9

Possible useless method overriding detected. (Generic.CodeAnalysis.UselessOverridingMethod)
{
parent::__construct($message, $code, $previous);
}
Expand Down
2 changes: 1 addition & 1 deletion src/HabboAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -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<country code>-" (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);
}
Expand Down
4 changes: 2 additions & 2 deletions src/HabboParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/HabboParserInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

0 comments on commit c7976f0

Please sign in to comment.