Skip to content

Commit 6899c9c

Browse files
Merge branch '4.2'
* 4.2: (27 commits) [VarExporter] dont call userland code with uninitialized objects Fix typos in doc blocks [Debug] ignore underscore vs backslash namespaces in DebugClassLoader [TwigBridge][Form] Prevent multiple rendering of form collection prototypes [FrameworkBundle] fix describing routes with no controllers [DI] move RegisterServiceSubscribersPass before DecoratorServicePass Update ValidationListener.php [Yaml] ensures that the mb_internal_encoding is reset to its initial value [Messenger] Restore message handlers laziness [WebLink] Fixed documentation link [Security] getTargetPath of TargetPathTrait must return string or null [Hackday][Serializer] Deserialization ignores argument type hint from phpdoc for array in constructor argument Optimize perf by replacing call_user_func with dynamic vars [Cache] Fix dsn parsing [Routing] fix dumping same-path routes with placeholders [WebProfilerBundle][TwigBundle] CSS fixes Add a docblock for FormFactoryInterface [Security] defer log message in guard authenticator [Validator] Added IBAN format for Vatican City State merge conflicts ...
2 parents 6514d71 + 0dc0dcf commit 6899c9c

File tree

5 files changed

+7
-12
lines changed

5 files changed

+7
-12
lines changed

Console/Descriptor/TextDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ protected function describeRouteCollection(RouteCollection $routes, array $optio
5757

5858
if ($showControllers) {
5959
$controller = $route->getDefault('_controller');
60-
$row[] = $this->formatCallable($controller);
60+
$row[] = $controller ? $this->formatCallable($controller) : '';
6161
}
6262

6363
$tableRows[] = $row;

Controller/AbstractController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
use Psr\Container\ContainerInterface;
1616
use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
1717
use Symfony\Component\DependencyInjection\ParameterBag\ContainerBagInterface;
18-
use Symfony\Component\DependencyInjection\ServiceSubscriberInterface;
1918
use Symfony\Component\Form\FormFactoryInterface;
2019
use Symfony\Component\HttpFoundation\RequestStack;
2120
use Symfony\Component\HttpFoundation\Session\SessionInterface;
@@ -27,6 +26,7 @@
2726
use Symfony\Component\Security\Csrf\CsrfTokenManagerInterface;
2827
use Symfony\Component\Serializer\SerializerInterface;
2928
use Symfony\Component\Templating\EngineInterface;
29+
use Symfony\Contracts\Service\ServiceSubscriberInterface;
3030
use Twig\Environment;
3131

3232
/**

Controller/RedirectController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function __construct(UrlGeneratorInterface $router = null, int $httpPort
5050
* @param string $route The route name to redirect to
5151
* @param bool $permanent Whether the redirection is permanent
5252
* @param bool|array $ignoreAttributes Whether to ignore attributes or an array of attributes to ignore
53-
* @param bool $keepRequestMethod Wheter redirect action should keep HTTP request method
53+
* @param bool $keepRequestMethod Whether redirect action should keep HTTP request method
5454
*
5555
* @throws HttpException In case the route name is empty
5656
*/
@@ -94,7 +94,7 @@ public function redirectAction(Request $request, string $route, bool $permanent
9494
* @param string|null $scheme The URL scheme (null to keep the current one)
9595
* @param int|null $httpPort The HTTP port (null to keep the current one for the same scheme or the default configured port)
9696
* @param int|null $httpsPort The HTTPS port (null to keep the current one for the same scheme or the default configured port)
97-
* @param bool $keepRequestMethod Wheter redirect action should keep HTTP request method
97+
* @param bool $keepRequestMethod Whether redirect action should keep HTTP request method
9898
*
9999
* @throws HttpException In case the path is empty
100100
*/

DependencyInjection/FrameworkExtension.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
use Symfony\Component\Console\Command\Command;
3838
use Symfony\Component\DependencyInjection\Alias;
3939
use Symfony\Component\DependencyInjection\Argument\IteratorArgument;
40-
use Symfony\Component\DependencyInjection\Argument\RewindableGenerator;
4140
use Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument;
4241
use Symfony\Component\DependencyInjection\ChildDefinition;
4342
use Symfony\Component\DependencyInjection\ContainerBuilder;
@@ -1602,12 +1601,7 @@ private function registerMessengerConfiguration(array $config, ContainerBuilder
16021601
$senders[$sender] = new Reference($senderAliases[$sender] ?? $sender);
16031602
}
16041603

1605-
$sendersId = 'messenger.senders.'.$message;
1606-
$container->register($sendersId, RewindableGenerator::class)
1607-
->setFactory('current')
1608-
->addArgument(array(new IteratorArgument($senders)));
1609-
$messageToSendersMapping[$message] = new Reference($sendersId);
1610-
1604+
$messageToSendersMapping[$message] = new IteratorArgument($senders);
16111605
$messagesToSendAndHandle[$message] = $messageConfiguration['send_and_handle'];
16121606
}
16131607

Tests/DependencyInjection/FrameworkExtensionTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,10 +651,11 @@ public function testMessengerRouting()
651651
);
652652

653653
$this->assertSame($messageToSendAndHandleMapping, $senderLocatorDefinition->getArgument(1));
654+
$sendersMapping = $senderLocatorDefinition->getArgument(0);
654655
$this->assertEquals(array(
655656
'amqp' => new Reference('messenger.transport.amqp'),
656657
'audit' => new Reference('audit'),
657-
), $container->getDefinition('messenger.senders.'.DummyMessage::class)->getArgument(0)[0]->getValues());
658+
), $sendersMapping[DummyMessage::class]->getValues());
658659
}
659660

660661
/**

0 commit comments

Comments
 (0)