Move properties above __construct() method

This commit is contained in:
Oskar Stark
2024-12-06 21:05:09 +01:00
parent 38a0d1edf5
commit 3a1d85dd69

View File

@@ -21,11 +21,6 @@ use Symfony\Contracts\Cache\CacheInterface;
final class Schedule implements ScheduleProviderInterface
{
public function __construct(
private readonly ?EventDispatcherInterface $dispatcher = null,
) {
}
/** @var array<string,RecurringMessage> */
private array $messages = [];
private ?LockInterface $lock = null;
@@ -33,6 +28,11 @@ final class Schedule implements ScheduleProviderInterface
private bool $shouldRestart = false;
private bool $onlyLastMissed = false;
public function __construct(
private readonly ?EventDispatcherInterface $dispatcher = null,
) {
}
public function with(RecurringMessage $message, RecurringMessage ...$messages): static
{
return static::doAdd(new self($this->dispatcher), $message, ...$messages);