8000 Remove the Doctrine middleware configuration from the FrameworkBundle · symfony/symfony@27a8b1d · GitHub
[go: up one dir, main page]

Skip to content

Commit 27a8b1d

Browse files
committed
Remove the Doctrine middleware configuration from the FrameworkBundle
1 parent f785bab commit 27a8b1d

File tree

9 files changed

+0
-77
lines changed

9 files changed

+0
-77
lines changed

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,12 +1005,6 @@ function ($a) {
10051005
->arrayNode('middlewares')
10061006
->addDefaultsIfNotSet()
10071007
->children()
1008-
->arrayNode('doctrine_transaction')
1009-
->canBeEnabled()
1010-
->children()
1011-
->scalarNode('entity_manager_name')->info('The name of the entity manager to use')->defaultNull()->end()
1012-
->end()
1013-
->end()
10141008
->arrayNode('validation')
10151009
->{!class_exists(FullStack::class) && class_exists(Validation::class) ? 'canBeDisabled' : 'canBeEnabled'}()
10161010
->end()

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

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
use Doctrine\Common\Annotations\Reader;
1515
use Doctrine\Common\Annotations\AnnotationRegistry;
16-
use Symfony\Bridge\Doctrine\Messenger\DoctrineTransactionMiddleware;
1716
use Symfony\Bridge\Monolog\Processor\DebugProcessor;
1817
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
1918
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
@@ -1454,15 +1453,6 @@ private function registerMessengerConfiguration(array $config, ContainerBuilder
14541453
$container->getDefinition('messenger.sender_locator')->replaceArgument(0, $senderLocatorMapping);
14551454
$container->getDefinition('messenger.asynchronous.routing.sender_locator')->replaceArgument(1, $messageToSenderIdsMapping);
14561455

1457-
if ($config['middlewares']['doctrine_transaction']['enabled']) {
1458-
if (!class_exists(DoctrineTransactionMiddleware::class)) {
1459-
throw new LogicException('The Doctrine transaction middleware is only available when the doctrine bridge is installed. Try running "composer require symfony/doctrine-bridge".');
1460-
}
1461-
$container->getDefinition('messenger.middleware.doctrine_transaction')->replaceArgument(1, $config['middlewares']['doctrine_transaction']['entity_manager_name']);
1462-
} else {
1463-
$container->removeDefinition('messenger.middleware.doctrine_transaction');
1464-
}
1465-
14661456
if ($config['middlewares']['validation']['enabled']) {
14671457
if (!$container->has('validator')) {
14681458
throw new LogicException('The Validation middleware is only available when the Validator component is installed and enabled. Try running "composer require symfony/validator".');

src/Symfony/Bundle/FrameworkBundle/Resources/config/messenger.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,6 @@
3131
<tag name="message_bus_middleware" priority="100" />
3232
</service>
3333

34-
<service id="messenger.middleware.doctrine_transaction" class="Symfony\Bridge\Doctrine\Messenger\DoctrineTransactionMiddleware">
35-
<argument type="service" id="doctrine" />
36-
<argument /> <!-- Entity manager name -->
37-
38-
<tag name="message_bus_middleware" priority="9" />
39-
</service>
40-
4134
<!-- Asynchronous -->
4235
<service id="messenger.asynchronous.routing.sender_locator" class="Symfony\Component\Messenger\Asynchronous\Routing\SenderLocator">
4336
<argument type="service" id="messenger.sender_locator" />

src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -370,16 +370,10 @@
370370

371371
<xsd:complexType name="messenger_middleware">
372372
<xsd:sequence>
373-
<xsd:element name="doctrine-transaction" type="messenger_doctrine_transaction" minOccurs="0" maxOccurs="1" />
374373
<xsd:element name="validation" type="messenger_validation" minOccurs="0" maxOccurs="1" />
375374
</xsd:sequence>
376375
</xsd:complexType>
377376

378-
<xsd:complexType name="messenger_doctrine_transaction">
379-
<xsd:attribute name="entity-manager-name" type="xsd:string" />
380-
<xsd:attribute name="enabled" type="xsd:boolean" />
381-
</xsd:complexType>
382-
383377
<xsd:complexType name="messenger_validation">
384378
<xsd:attribute name="enabled" type="xsd:boolean" />
385379
</xsd:complexType>

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,6 @@ class_exists(SemaphoreStore::class) && SemaphoreStore::isSupported() ? 'semaphor
254254
'enabled' => !class_exists(FullStack::class) && class_exists(MessageBusInterface::class),
255255
'routing' => array(),
256256
'middlewares' => array(
257-
'doctrine_transaction' => array(
258-
'enabled' => false,
259-
'entity_manager_name' => null,
260-
),
261257
'validation' => array(
262258
'enabled' => !class_exists(FullStack::class),
263259
),

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/messenger_doctrine.php

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/messenger_doctrine.xml

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/messenger_doctrine.yml

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection;
1313

1414
use Doctrine\Common\Annotations\Annotation;
15-
use Symfony\Bridge\Doctrine\ContainerAwareEventManager;
1615
use Symfony\Bundle\FullStack;
1716
use Symfony\Bundle\FrameworkBundle\Tests\TestCase;
1817
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\AddAnnotationsCachedReaderPass;
@@ -521,18 +520,6 @@ public function testMessenger()
521520
$this->assertFalse($container->hasDefinition('messenger.middleware.doctrine_transaction'));
522521
}
523522

524-
public function testMessengerDoctrine()
525-
{
526-
if (!class_exists(ContainerAwareEventManager::class)) {
527-
self::markTestSkipped('Skipping tests since Doctrine bridge is not installed');
528-
}
529-
530-
$container = $this->createContainerFromFile('messenger_doctrine');
531-
$this->assertTrue($container->hasDefinition('messenger.middleware.doctrine_transaction'));
532-
$def = $container->getDefinition('messenger.middleware.doctrine_transaction');
533-
$this->assertEquals('foobar', $def->getArgument(1));
534-
}
535-
536523
public function testMessengerValidationDisabled()
537524
{
538525
if (!class_exists(Validation::class)) {

0 commit comments

Comments
 (0)
0