Skip to content

Commit 98d91e1

Browse files
Merge branch '6.3' into 6.4
* 6.3: [Scheduler] Fix `PeriodicalTrigger` from argument for stateful run dates cs fix [Messenger] Fix passing options set via tags to handler descriptors random_bytes length should be an int greater than 0 enforce UTC timezone in test [DependencyInjection] Fix autocasting null env values to empty string Fix executable bit Fix executable bit Readme: Replace Stack Overflow with GitHub Discussions [DoctrineBridge] Remove outdated comment [DependencyInjection] Fix annotation [DoctrineBridge] Improve subscriber deprecation message [SecurityBundle] Do not translate `Bearer` header’s `error_description` [Lock] add missing UPGRADE and CHANGELOG Lock mention #50689 [String] Fix Inflector for 'status' [DependencyInjection] Fix resource tracking for lazy services [EventDispatcher] [EventDispatcher] Throw exception when listener method cannot be resolved [Serializer] Fix type error not be accessed before initialization
2 parents 2ca1643 + dd83b18 commit 98d91e1

File tree

36 files changed

+186
-49
lines changed

36 files changed

+186
-49
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Community
5757
---------
5858

5959
* [Join the Symfony Community][11] and meet other members at the [Symfony events][12].
60-
* [Get Symfony support][13] on Stack Overflow, Slack, IRC, etc.
60+
* [Get Symfony support][13] on GitHub Discussions, Slack, etc.
6161
* Follow us on [GitHub][14], [Twitter][15] and [Facebook][16].
6262
* Read our [Code of Conduct][24] and meet the [CARE Team][25].
6363

UPGRADE-6.3.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ Lock
101101
----
102102

103103
* Deprecate the `gcProbablity` option to fix a typo in its name, use the `gcProbability` option instead
104+
* Add optional parameter `$isSameDatabase` to `DoctrineDbalStore::configureSchema()`
104105

105106
Messenger
106107
---------

src/Symfony/Bridge/Doctrine/ContainerAwareEventManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ private function initializeSubscribers(): void
189189
$listener = $this->container->get($listener);
190190
}
191191
// throw new \InvalidArgumentException(sprintf('Using Doctrine subscriber "%s" is not allowed, declare it as a listener instead.', \is_object($listener) ? $listener::class : $listener));
192-
trigger_deprecation('symfony/doctrine-bridge', '6.3', 'Using Doctrine subscribers as services is deprecated, declare listeners instead');
192+
trigger_deprecation('symfony/doctrine-bridge', '6.3', 'Registering "%s" as a Doctrine subscriber is deprecated. Register it as a listener instead, using e.g. the #[AsDoctrineListener] attribute.', \is_object($listener) ? get_debug_type($listener) : $listener);
193193
parent::addEventSubscriber($listener);
194194
}
195195
}

src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ private function addTaggedServices(ContainerBuilder $container): array
109109
$refs = $managerDef->getArguments()[1] ?? [];
110110
$listenerRefs[$con][$id] = new Reference($id);
111111
if ($subscriberTag === $tagName) {
112-
trigger_deprecation('symfony/doctrine-bridge', '6.3', 'Using Doctrine subscribers as services is deprecated, declare listeners instead');
112+
trigger_deprecation('symfony/doctrine-bridge', '6.3', 'Registering "%s" as a Doctrine subscriber is deprecated. Register it as a listener instead, using e.g. the #[AsDoctrineListener] attribute.', $id);
113113
$refs[] = $id;
114114
} else {
115115
$refs[] = [[$tag['event']], $id];

src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,6 @@ protected function loadChoices(): iterable
5757
: $this->manager->getRepository($this->class)->findAll();
5858
}
5959

60-
/**
61-
* @internal to be remove in Symfony 6
62-
*/
6360
protected function doLoadValuesForChoices(array $choices): array
6461
{
6562
// Optimize performance for single-field identifiers. We already

src/Symfony/Bridge/Doctrine/Tests/ContainerAwareEventManagerTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function testDispatchEventRespectOrderWithSubscribers()
5050
$this->container->set('sub1', $subscriber1 = new MySubscriber(['foo']));
5151
$this->container->set('sub2', $subscriber2 = new MySubscriber(['foo']));
5252

53-
$this->expectDeprecation('Since symfony/doctrine-bridge 6.3: Using Doctrine subscribers as services is deprecated, declare listeners instead');
53+
$this->expectDeprecation('Since symfony/doctrine-bridge 6.3: Registering "Symfony\Bridge\Doctrine\Tests\MySubscriber" as a Doctrine subscriber is deprecated. Register it as a listener instead, using e.g. the #[AsDoctrineListener] attribute.');
5454
$this->assertSame([$subscriber1, $subscriber2], array_values($this->evm->getListeners('foo')));
5555
}
5656

@@ -92,7 +92,7 @@ public function testDispatchEventWithSubscribers()
9292
$this->assertSame(0, $subscriber1->calledSubscribedEventsCount);
9393

9494
$this->container->set('lazy1', $listener1 = new MyListener());
95-
$this->expectDeprecation('Since symfony/doctrine-bridge 6.3: Using Doctrine subscribers as services is deprecated, declare listeners instead');
95+
$this->expectDeprecation('Since symfony/doctrine-bridge 6.3: Registering "Symfony\Bridge\Doctrine\Tests\MySubscriber" as a Doctrine subscriber is deprecated. Register it as a listener instead, using e.g. the #[AsDoctrineListener] attribute.');
9696
$this->evm->addEventListener('foo', 'lazy1');
9797
$this->evm->addEventListener('foo', $listener2 = new MyListener());
9898
$this->evm->addEventSubscriber($subscriber2 = new MySubscriber(['bar']));
@@ -177,7 +177,7 @@ public function testAddEventListenerAndSubscriberAfterDispatchEvent()
177177
$this->assertSame(0, $subscriber1->calledSubscribedEventsCount);
178178

179179
$this->container->set('lazy1', $listener1 = new MyListener());
180-
$this->expectDeprecation('Since symfony/doctrine-bridge 6.3: Using Doctrine subscribers as services is deprecated, declare listeners instead');
180+
$this->expectDeprecation('Since symfony/doctrine-bridge 6.3: Registering "Symfony\Bridge\Doctrine\Tests\MySubscriber" as a Doctrine subscriber is deprecated. Register it as a listener instead, using e.g. the #[AsDoctrineListener] attribute.');
181181
$this->evm->addEventListener('foo', 'lazy1');
182182
$this->assertSame(1, $subscriber1->calledSubscribedEventsCount);
183183

@@ -238,7 +238,7 @@ public function testGetListenersForEventWhenSubscribersArePresent()
238238

239239
$this->container->set('lazy', $listener1 = new MyListener());
240240
$this->container->set('lazy2', $subscriber1 = new MySubscriber(['foo']));
241-
$this->expectDeprecation('Since symfony/doctrine-bridge 6.3: Using Doctrine subscribers as services is deprecated, declare listeners instead');
241+
$this->expectDeprecation('Since symfony/doctrine-bridge 6.3: Registering "Symfony\Bridge\Doctrine\Tests\MySubscriber" as a Doctrine subscriber is deprecated. Register it as a listener instead, using e.g. the #[AsDoctrineListener] attribute.');
242242
$this->evm->addEventListener('foo', 'lazy');
243243
$this->evm->addEventListener('foo', $listener2 = new MyListener());
244244

src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPassTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ public function testProcessEventSubscribersWithMultipleConnections()
238238
])
239239
;
240240

241-
$this->expectDeprecation('Since symfony/doctrine-bridge 6.3: Using Doctrine subscribers as services is deprecated, declare listeners instead');
241+
$this->expectDeprecation('Since symfony/doctrine-bridge 6.3: Registering "d" as a Doctrine subscriber is deprecated. Register it as a listener instead, using e.g. the #[AsDoctrineListener] attribute.');
242242
$this->process($container);
243243

244244
$eventManagerDef = $container->getDefinition('doctrine.dbal.default_connection.event_manager');
@@ -322,7 +322,7 @@ public function testProcessEventSubscribersWithPriorities()
322322
])
323323
;
324324

325-
$this->expectDeprecation('Since symfony/doctrine-bridge 6.3: Using Doctrine subscribers as services is deprecated, declare listeners instead');
325+
$this->expectDeprecation('Since symfony/doctrine-bridge 6.3: Registering "d" as a Doctrine subscriber is deprecated. Register it as a listener instead, using e.g. the #[AsDoctrineListener] attribute.');
326326
$this->process($container);
327327

328328
$eventManagerDef = $container->getDefinition('doctrine.dbal.default_connection.event_manager');
@@ -416,7 +416,7 @@ public function testProcessEventSubscribersAndListenersWithPriorities()
416416
])
417417
;
418418

419-
$this->expectDeprecation('Since symfony/doctrine-bridge 6.3: Using Doctrine subscribers as services is deprecated, declare listeners instead');
419+
$this->expectDeprecation('Since symfony/doctrine-bridge 6.3: Registering "d" as a Doctrine subscriber is deprecated. Register it as a listener instead, using e.g. the #[AsDoctrineListener] attribute.');
420420
$this->process($container);
421421

422422
$eventManagerDef = $container->getDefinition('doctrine.dbal.default_connection.event_manager');

src/Symfony/Bundle/SecurityBundle/Resources/config/security_authenticator_access_token.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
null,
4343
null,
4444
])
45-
->call('setTranslator', [service('translator')->ignoreOnInvalid()])
4645

4746
->set('security.authenticator.access_token.chain_extractor', ChainAccessTokenExtractor::class)
4847
->abstract()

src/Symfony/Component/DependencyInjection/Container.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,15 @@ protected function getEnv(string $name): mixed
372372
$prefix = 'string';
373373
$localName = $name;
374374
}
375-
$processor = $processors->has($prefix) ? $processors->get($prefix) : new EnvVarProcessor($this);
375+
376+
if ($processors->has($prefix)) {
377+
$processor = $processors->get($prefix);
378+
} else {
379+
$processor = new EnvVarProcessor($this);
380+
if (false === $i) {
381+
$prefix = '';
382+
}
383+
}
376384

377385
$this->resolving[$envName] = true;
378386
try {

src/Symfony/Component/DependencyInjection/ContainerAwareTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
trait ContainerAwareTrait
2424
{
2525
/**
26-
* @var ContainerInterface
26+
* @var ContainerInterface|null
2727
*/
2828
protected $container;
2929

0 commit comments

Comments
 (0)