Skip to content

Commit

Permalink
Merge pull request #12 from vtsykun/fix/php8.4
Browse files Browse the repository at this point in the history
PHP 8.4 fix implicitly nullable parameter declarations deprecated
  • Loading branch information
vtsykun authored Mar 23, 2024
2 parents a9604af + 2d00b1d commit d6a0c64
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 17 deletions.
8 changes: 4 additions & 4 deletions src/Attribute/AsCron.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ final class AsCron

public function __construct(
string $cron,
bool $lock = null,
bool $async = null,
?bool $lock = null,
?bool $async = null,
array $options = [],
bool $messenger = null,
int $jitter = null,
?bool $messenger = null,
?int $jitter = null,
) {
// Replace when update PHP > 7.2
$this->async = $async;
Expand Down
8 changes: 4 additions & 4 deletions src/Attribute/AsPeriodicTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ class AsPeriodicTask

public function __construct(
/*int|string */ $interval,
bool $lock = null,
bool $async = null,
bool $messenger = null,
int $jitter = null,
?bool $lock = null,
?bool $async = null,
?bool $messenger = null,
?int $jitter = null,
array $options = [],
) {
$this->async = $async;
Expand Down
2 changes: 1 addition & 1 deletion src/Command/CronCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class CronCommand extends Command
* @param PsrClockInterface|null $clock
* @param string|null $timezone
*/
public function __construct(ScheduleRunnerInterface $scheduleRunner, ScheduleLoaderInterface $loader, EventDispatcherInterface $dispatcher = null, ScheduleLoopInterface $scheduleLoop = null, PsrClockInterface $clock = null, string $timezone = null)
public function __construct(ScheduleRunnerInterface $scheduleRunner, ScheduleLoaderInterface $loader, ?EventDispatcherInterface $dispatcher = null, ?ScheduleLoopInterface $scheduleLoop = null, ?PsrClockInterface $clock = null, ?string $timezone = null)
{
$this->scheduleRunner = $scheduleRunner;
$this->loader = $loader;
Expand Down
2 changes: 1 addition & 1 deletion src/Middleware/AsyncProcessEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ final class AsyncProcessEngine implements MiddlewareEngineInterface
{
private $tempDir;

public function __construct(string $sysTempDir = null)
public function __construct(?string $sysTempDir = null)
{
$this->tempDir = $sysTempDir ?: \sys_get_temp_dir();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Middleware/ConsoleCommandEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ final class ConsoleCommandEngine implements MiddlewareEngineInterface
*
* @param KernelInterface|null $kernel
*/
public function __construct(KernelInterface $kernel = null)
public function __construct(?KernelInterface $kernel = null)
{
$this->kernel = $kernel;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Middleware/CronMiddlewareEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ final class CronMiddlewareEngine implements MiddlewareEngineInterface
private $lastLoopTasks = [];
private $timers;

public function __construct(CronChecker $checker, string $timeZone = null, PsrClockInterface $clock = null, ScheduleLoopInterface $scheduleLoop = null, TimerStorage $timers = null)
public function __construct(CronChecker $checker, ?string $timeZone = null, ?PsrClockInterface $clock = null, ?ScheduleLoopInterface $scheduleLoop = null, ?TimerStorage $timers = null)
{
$this->timeZone = $timeZone;
$this->checker = $checker;
Expand Down
2 changes: 1 addition & 1 deletion src/Middleware/MessengerEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ final class MessengerEngine implements MiddlewareEngineInterface
{
private $messageBus;

public function __construct(MessageBusInterface $messageBus = null)
public function __construct(?MessageBusInterface $messageBus = null)
{
$this->messageBus = $messageBus;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Middleware/StackEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ final class StackEngine implements StackInterface, MiddlewareEngineInterface
/**
* @param \Iterator|null $iterator
*/
public function __construct(\Iterator $iterator = null)
public function __construct(?\Iterator $iterator = null)
{
$this->iterator = $iterator;
}
Expand Down
4 changes: 2 additions & 2 deletions src/React/ReactLoopAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ReactLoopAdapter implements ScheduleLoopInterface
private $loopTime;
private $timeZone;

public function __construct(LoopInterface $loop = null, string $timeZone = null)
public function __construct(?LoopInterface $loop = null, ?string $timeZone = null)
{
$this->loop = $loop;
$this->timeZone = $timeZone;
Expand Down Expand Up @@ -108,7 +108,7 @@ public function now(): \DateTimeImmutable
return $now;
}

public function setDefaultLoopTime(\DateTimeImmutable $loopTime = null): void
public function setDefaultLoopTime(?\DateTimeImmutable $loopTime = null): void
{
$this->loopTime = $loopTime;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Runner/StandaloneLoop.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class StandaloneLoop implements ScheduleLoopInterface
protected $needSort = false;
protected $running = false;

public function __construct(ClockInterface $clock = null, string $timeZone = null)
public function __construct(?ClockInterface $clock = null, ?string $timeZone = null)
{
$this->clock = $clock ?: new OkvpnLoopClock($timeZone);
}
Expand Down

0 comments on commit d6a0c64

Please sign in to comment.