Skip to content

Commit

Permalink
prevent PHP 8.4 deprecation for default null value without nullable t…
Browse files Browse the repository at this point in the history
…ype declaration
  • Loading branch information
ejunker committed Nov 23, 2024
1 parent d89e999 commit df37df1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [7.3, 7.4, 8.0, 8.1, 8.2, 8.3]
php: [7.3, 7.4, 8.0, 8.1, 8.2, 8.3, 8.4]
stability: [prefer-lowest, prefer-stable]

name: PHP ${{ matrix.php }} - ${{ matrix.stability }} Test
Expand Down
10 changes: 5 additions & 5 deletions src/Pusher.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class Pusher implements LoggerAwareInterface, PusherInterface
*
* @throws PusherException Throws exception if any required dependencies are missing
*/
public function __construct(string $auth_key, string $secret, string $app_id, array $options = [], ClientInterface $client = null)
public function __construct(string $auth_key, string $secret, string $app_id, array $options = [], ?ClientInterface $client = null)
{
$this->check_compatibility();

Expand Down Expand Up @@ -287,7 +287,7 @@ public static function build_auth_query_params(
string $request_path,
array $query_params = [],
string $auth_version = '1.0',
string $auth_timestamp = null
?string $auth_timestamp = null
): array {
$params = [];
$params['auth_key'] = $auth_key;
Expand Down Expand Up @@ -884,7 +884,7 @@ public function authenticateUser(string $socket_id, array $user_data): string
* @return string Json encoded authentication string.
* @throws PusherException Throws exception if $channel is invalid or above or $socket_id is invalid
*/
public function authorizeChannel(string $channel, string $socket_id, string $custom_data = null): string
public function authorizeChannel(string $channel, string $socket_id, ?string $custom_data = null): string
{
$this->validate_channel($channel);
$this->validate_socket_id($socket_id);
Expand Down Expand Up @@ -949,15 +949,15 @@ public function authorizePresenceChannel(string $channel, string $socket_id, str
/**
* @deprecated in favour of authorizeChannel
*/
public function socketAuth(string $channel, string $socket_id, string $custom_data = null): string
public function socketAuth(string $channel, string $socket_id, ?string $custom_data = null): string
{
return $this->authorizeChannel($channel, $socket_id, $custom_data);
}

/**
* @deprecated in favour of authorizeChannel
*/
public function socket_auth(string $channel, string $socket_id, string $custom_data = null): string
public function socket_auth(string $channel, string $socket_id, ?string $custom_data = null): string
{
return $this->authorizeChannel($channel, $socket_id, $custom_data);
}
Expand Down
4 changes: 2 additions & 2 deletions src/PusherInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public function get(string $path, array $params = [], bool $associative = false)
* @return string Json encoded authentication string.
* @throws PusherException Throws exception if $channel is invalid or above or $socket_id is invalid
*/
public function socketAuth(string $channel, string $socket_id, string $custom_data = null): string;
public function socketAuth(string $channel, string $socket_id, ?string $custom_data = null): string;

/**
* Creates a presence signature (an extension of socket signing).
Expand Down Expand Up @@ -229,7 +229,7 @@ public function get_users_info(string $channel): object;
* @return string Json encoded authentication string.
* @throws PusherException Throws exception if $channel is invalid or above or $socket_id is invalid
*/
public function socket_auth(string $channel, string $socket_id, string $custom_data = null): string;
public function socket_auth(string $channel, string $socket_id, ?string $custom_data = null): string;

/**
* Creates a presence signature (an extension of socket signing).
Expand Down

0 comments on commit df37df1

Please sign in to comment.