Skip to content

Commit

Permalink
PHP 8.4: Implicitly nullable parameters deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
valzargaming committed Nov 21, 2024
1 parent 562cb8a commit 0a76a35
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/Discord/Helpers/RegisteredCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,14 +168,14 @@ public function getSubCommand(string $name): ?RegisteredCommand
* Adds a sub-command to the command.
*
* @param string|array $name
* @param callable $callback
* @param callable|null $callback
* @param callable|null $autocomplete_callback
*
* @throws \LogicException
*
* @return static
*/
public function addSubCommand($name, callable $callback = null, ?callable $autocomplete_callback = null): RegisteredCommand
public function addSubCommand($name, ?callable $callback = null, ?callable $autocomplete_callback = null): RegisteredCommand
{
if (is_array($name) && count($name) == 1) {
$name = array_shift($name);
Expand Down
2 changes: 1 addition & 1 deletion src/Discord/Parts/Channel/Channel.php
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,7 @@ protected function getDefaultReactionEmojiAttribute(): ?Reaction
*
* @since 10.0.0 Arguments for `$name`, `$private` and `$auto_archive_duration` are now inside `$options`
*/
public function startThread(array|string $options, string|null|bool $reason = null, int $_auto_archive_duration = 1440, ?string $_reason = null): PromiseInterface
public function startThread(array|string $options, string|bool|null $reason = null, int $_auto_archive_duration = 1440, ?string $_reason = null): PromiseInterface
{
// Old v7 signature
if (is_string($options)) {
Expand Down
2 changes: 1 addition & 1 deletion src/Discord/Repository/Guild/MemberRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function kick(Member $member, ?string $reason = null): PromiseInterface
*
* @param array $queryparams Query string params to add to the request, leave null to paginate all members (Warning: Be careful to use this on very large guild)
*/
public function freshen(array $queryparams = null): PromiseInterface
public function freshen(?array $queryparams = null): PromiseInterface
{
if (isset($queryparams)) {
return parent::freshen($queryparams);
Expand Down
2 changes: 1 addition & 1 deletion tests/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

const TIMEOUT = 10;

function wait(callable $callback, float $timeout = TIMEOUT, callable $timeoutFn = null)
function wait(callable $callback, float $timeout = TIMEOUT, ?callable $timeoutFn = null)
{
$discord = DiscordSingleton::get();

Expand Down

0 comments on commit 0a76a35

Please sign in to comment.