Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix 8.4 deprecation notices #60

Merged
merged 1 commit into from
Dec 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
}
Loading