8000 [Messenger][FrameworkBundle] Move collector, command into the component & minor tweaks by ogizanagi · Pull Request #26816 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Messenger][FrameworkBundle] Move collector, command into the component & minor tweaks #26816

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 6, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
[FrameworkBundle] Minor messenger component tweaks
8000
  • Loading branch information
ogizanagi committed Apr 5, 2018
commit 6aec62bad3d0636deb9e752947f2c712e94718b7
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
use Symfony\Component\Lock\Store\StoreFactory;
use Symfony\Component\Lock\StoreInterface;
use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
use Symfony\Component\Messenger\MessageBusInterface;
use Symfony\Component\Messenger\Transport\ReceiverInterface;
use Symfony\Component\Messenger\Transport\SenderInterface;
use Symfony\Component\PropertyAccess\PropertyAccessor;
Expand Down Expand Up @@ -1436,6 +1437,10 @@ private function registerLockConfiguration(array $config, ContainerBuilder $cont

private function registerMessengerConfiguration(array $config, ContainerBuilder $container, XmlFileLoader $loader)
{
if (!interface_exists(MessageBusInterface::class)) {
throw new LogicException('Messenger support cannot be enabled as the Messenger component is not installed.');
}

$loader->load('messenger.xml');

$senderLocatorMapping = array();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

$container->loadFromExtension('framework', array(
'validation' => array('enabled' => true),
'messenger' => array(
'middlewares' => array(
'validation' => array(
'enabled' => true,
),
),
),
));
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:framework="http://symfony.com/schema/dic/symfony"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">

<framework:config>
<framework:validation enabled="true"/>
<framework:messenger>
<framework:middlewares>
<framework:validation enabled="true"/>
</framework:middlewares>
</framework:messenger>
</framework:config>
</container>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
framework:
validation:
enabled: true
messenger:
middlewares:
validation:
enabled: true
D15D
Original file line number Diff line number Diff line change
Expand Up @@ -520,13 +520,15 @@ public function testMessenger()
$this->assertFalse($container->hasDefinition('messenger.middleware.doctrine_transaction'));
}

public function testMessengerValidationDisabled()
public function testMessengerValidationEnabled()
{
if (!class_exists(Validation::class)) {
self::markTestSkipped('Skipping tests since Validator component is not installed');
}
$container = $this->createContainerFromFile('messenger_validation_enabled');
$this->assertTrue($definition = $container->hasDefinition('messenger.middleware.validator'));
}

$container = $this->createContainerFromFile('messenger_validation');
public function testMessengerValidationDisabled()
{
$container = $this->createContainerFromFile('messenger_validation_disabled');
$this->assertFalse($container->hasDefinition('messenger.middleware.validator'));
}

Expand Down
1 change: 1 addition & 0 deletions src/Symfony/Bundle/FrameworkBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"symfony/security": "~3.4|~4.0",
"symfony/form": "^4.1",
"symfony/expression-language": "~3.4|~4.0",
"symfony/messenger": "^4.1",
"symfony/process": "~3.4|~4.0",
"symfony/security-core": "~3.4|~4.0",
"symfony/security-csrf": "~3.4|~4.0",
Expand Down
0