Skip to content

Commit

Permalink
Mark as nullable arguments with initial null value (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
acelaya authored Nov 30, 2024
1 parent a1777e6 commit 52ae1fb
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/Consumer.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ final class Consumer implements ConsumerInterface
private readonly ReceivedTaskFactoryInterface $receivedTaskFactory;

public function __construct(
WorkerInterface $worker = null,
ReceivedTaskFactoryInterface $receivedTaskFactory = null,
?WorkerInterface $worker = null,
?ReceivedTaskFactoryInterface $receivedTaskFactory = null,
) {
$this->worker = $worker ?? Worker::create();
$this->receivedTaskFactory = $receivedTaskFactory ?? new ReceivedTaskFactory($this->worker);
Expand Down
4 changes: 2 additions & 2 deletions src/Queue.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function withDefaultOptions(?OptionsInterface $options = null): self
public function push(
string $name,
string|\Stringable $payload,
OptionsInterface $options = null,
?OptionsInterface $options = null,
): QueuedTaskInterface {
return $this->dispatch(
$this->create($name, $payload, $options),
Expand All @@ -87,7 +87,7 @@ public function dispatch(PreparedTaskInterface $task): QueuedTaskInterface
public function create(
string $name,
string|\Stringable $payload,
OptionsInterface $options = null,
?OptionsInterface $options = null,
): PreparedTaskInterface {
if ($this->options !== null && \method_exists($this->options, 'mergeOptional')) {
/** @var OptionsInterface $options */
Expand Down
2 changes: 1 addition & 1 deletion src/QueueInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function withDefaultOptions(?OptionsInterface $options): self;
public function create(
string $name,
string|\Stringable $payload,
OptionsInterface $options = null,
?OptionsInterface $options = null,
): PreparedTaskInterface;

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Task/PreparedTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ final class PreparedTask extends Task implements PreparedTaskInterface, OptionsA
public function __construct(
string $name,
string|\Stringable $payload,
OptionsInterface $options = null,
?OptionsInterface $options = null,
array $headers = [],
) {
$this->options = $options ?? new Options();
Expand Down

0 comments on commit 52ae1fb

Please sign in to comment.