Skip to content

Commit

Permalink
Make more nullable types explicit
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Mar 19, 2024
1 parent 2114101 commit a69a4d0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Command/AbstractFailedMessagesCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ protected function printPendingMessagesMessage(ReceiverInterface $receiver, Symf
/**
* @param string|null $name
*/
protected function getReceiver(/* string $name = null */): ReceiverInterface
protected function getReceiver(/* ?string $name = null */): ReceiverInterface
{
if (1 > \func_num_args() && __CLASS__ !== static::class && __CLASS__ !== (new \ReflectionMethod($this, __FUNCTION__))->getDeclaringClass()->getName() && !$this instanceof \PHPUnit\Framework\MockObject\MockObject && !$this instanceof \Prophecy\Prophecy\ProphecySubjectInterface && !$this instanceof \Mockery\MockInterface) {
trigger_deprecation('symfony/messenger', '5.3', 'The "%s()" method will have a new "string $name" argument in version 6.0, not defining it is deprecated.', __METHOD__);
Expand Down
2 changes: 1 addition & 1 deletion Handler/BatchHandlerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ interface BatchHandlerInterface
* @return mixed The number of pending messages in the batch if $ack is not null,
* the result from handling the message otherwise
*/
// public function __invoke(object $message, Acknowledger $ack = null): mixed;
// public function __invoke(object $message, ?Acknowledger $ack = null): mixed;

/**
* Flushes any pending buffers.
Expand Down
4 changes: 2 additions & 2 deletions Retry/RetryStrategyInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ interface RetryStrategyInterface
/**
* @param \Throwable|null $throwable The cause of the failed handling
*/
public function isRetryable(Envelope $message/* , \Throwable $throwable = null */): bool;
public function isRetryable(Envelope $message/* , ?\Throwable $throwable = null */): bool;

/**
* @param \Throwable|null $throwable The cause of the failed handling
*
* @return int The time to delay/wait in milliseconds
*/
public function getWaitingTime(Envelope $message/* , \Throwable $throwable = null */): int;
public function getWaitingTime(Envelope $message/* , ?\Throwable $throwable = null */): int;
}

0 comments on commit a69a4d0

Please sign in to comment.