8000 bug #49731 [FrameworkBundle] Fix registration of the Scheduler compon… · symfony/symfony@7fc526e · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit 7fc526e

Browse files
committed
bug #49731 [FrameworkBundle] Fix registration of the Scheduler component (fabpot)
This PR was squashed before being merged into the 6.3 branch. Discussion ---------- [FrameworkBundle] Fix registration of the Scheduler component | Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | n/a | License | MIT | Doc PR | n/a Commits ------- 251ed12 [Scheduler] Fix usage without a Lock 313644f [FrameworkBundle] Fix registration of the Scheduler component
2 parents ecd57a6 + 251ed12 commit 7fc526e

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
use Symfony\Component\PropertyInfo\PropertyInfoExtractorInterface;
3838
use Symfony\Component\RateLimiter\Policy\TokenBucketLimiter;
3939
use Symfony\Component\RemoteEvent\RemoteEvent;
40-
use Symfony\Component\Scheduler\Messenger\SchedulerTransportFactory;
40+
use Symfony\Component\Scheduler\Schedule;
4141
use Symfony\Component\Semaphore\Semaphore;
4242
use Symfony\Component\Serializer\Serializer;
4343
use Symfony\Component\Translation\Translator;
@@ -1614,7 +1614,7 @@ private function addSchedulerSection(ArrayNodeDefinition $rootNode, callable $en
16141614
->children()
16151615
->arrayNode('scheduler')
16161616
->info('Scheduler configuration')
1617-
->{$enableIfStandalone('symfony/scheduler', SchedulerTransportFactory::class)}()
1617+
->{$enableIfStandalone('symfony/scheduler', Schedule::class)}()
16181618
->end()
16191619
->end()
16201620
;

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2015,10 +2015,6 @@ private function registerSchedulerConfiguration(array $config, ContainerBuilder
20152015
throw new LogicException('Scheduler support cannot be enabled as the Scheduler component is not installed. Try running "composer require symfony/scheduler".');
20162016
}
20172017

2018-
if (!interface_exists(MessageBusInterface::class)) {
2019-
throw new LogicException('Scheduler support cannot be enabled as the Messenger component is not installed. Try running "composer require symfony/messenger".');
2020-
}
2021-
20222018
$loader->load('scheduler.php');
20232019
}
20242020

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)
0