Skip to content

Commit 251ed12

Browse files
committed
[Scheduler] Fix usage without a Lock
1 parent 313644f commit 251ed12

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/Symfony/Component/Scheduler/Schedule.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Component\Scheduler;
1313

1414
use Symfony\Component\Lock\LockInterface;
15-
use Symfony\Component\Lock\NoLock;
1615
use Symfony\Contracts\Cache\CacheInterface;
1716

1817
/**
@@ -46,9 +45,9 @@ public function lock(LockInterface $lock): static
4645
return $this;
4746
}
4847

49-
public function getLock(): LockInterface
48+
public function getLock(): ?LockInterface
5049
{
51-
return $this->lock ?? new NoLock();
50+
return $this->lock;
5251
}
5352

5453
/**

0 commit comments

Comments
 (0)