Skip to content

Commit 1730b7d

Browse files
Merge branch '4.1'
* 4.1: fix merge bumped Symfony version to 4.1.3 [PhpUnitBridge] Describe weak_vendors properly [HttpKernel] Fix merging bindings for controllers' locators updated VERSION for 4.1.2 updated CHANGELOG for 4.1.2 bumped Symfony version to 4.0.14 updated VERSION for 4.0.13 updated CHANGELOG for 4.0.13 bumped Symfony version to 3.4.14 updated VERSION for 3.4.13 updated CHANGELOG for 3.4.13 bumped Symfony version to 2.8.44 Chaining senders with their aliases should work
2 parents 0eea077 + 8305d61 commit 1730b7d

File tree

10 files changed

+143
-20
lines changed

10 files changed

+143
-20
lines changed

CHANGELOG-4.0.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,40 @@ in 4.0 minor versions.
77
To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash
88
To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v4.0.0...v4.0.1
99

10+
* 4.0.13 (2018-07-23)
11+
12+
* bug #28005 [HttpKernel] Fixed templateExists on parse error of the template name (yceruto)
13+
* bug #27997 Serbo-Croatian has Serbian plural rule (kylekatarnls)
14+
* bug #26193 Fix false-positive deprecation notices for TranslationLoader and WriteCheckSessionHandler (iquito)
15+
* bug #27941 [WebProfilerBundle] Fixed icon alignment issue using Bootstrap 4.1.2 (jmsche)
16+
* bug #27937 [HttpFoundation] reset callback on StreamedResponse when setNotModified() is called (rubencm)
17+
* bug #27927 [HttpFoundation] Suppress side effects in 'get' and 'has' methods of NamespacedAttributeBag (webnet-fr)
18+
* bug #27923 [Form/Profiler] Massively reducing memory footprint of form profiling pages... (VincentChalnot)
19+
* bug #27918 [Console] correctly return parameter's default value on "--" (seschwar)
20+
* bug #27904 [Filesystem] fix lock file permissions (fritzmg)
21+
* bug #27903 [Lock] fix lock file permissions (fritzmg)
22+
* bug #27889 [Form] Replace .initialism with .text-uppercase. (vudaltsov)
23+
* bug #27902 Fix the detection of the Process new argument (stof)
24+
* bug #27885 [HttpFoundation] don't encode cookie name for BC (nicolas-grekas)
25+
* bug #27782 [DI] Fix dumping ignore-on-uninitialized references to synthetic services (nicolas-grekas)
26+
* bug #27435 [OptionResolver] resolve arrays (Doctrs)
27+
* bug #27728 [TwigBridge] Fix missing path and separators in loader paths list on debug:twig output (yceruto)
28+
* bug #27837 [PropertyInfo] Fix dock block lookup fallback loop (DerManoMann)
29+
* bug #27758 [WebProfilerBundle] Prevent toolbar links color override by css (alcalyn)
30+
* bug #27847 [Security] Fix accepting null as $uidKey in LdapUserProvider (louhde)
31+
* bug #27834 [DI] Don't show internal service id on binding errors (nicolas-grekas)
32+
* bug #27831 Check for Hyper terminal on all operating systems. (azjezz)
33+
* bug #27794 Add color support for Hyper terminal . (azjezz)
34+
* bug #27809 [HttpFoundation] Fix tests: new message for status 425 (dunglas)
35+
* bug #27618 [PropertyInfo] added handling of nullable types in PhpDoc (oxan)
36+
* bug #27659 [HttpKernel] Make AbstractTestSessionListener compatible with CookieClearingLogoutHandler (thewilkybarkid)
37+
* bug #27752 [Cache] provider does not respect option maxIdLength with versioning enabled (Constantine Shtompel)
38+
* bug #27776 [ProxyManagerBridge] Fix support of private services (bis) (nicolas-grekas)
39+
* bug #27714 [HttpFoundation] fix session tracking counter (nicolas-grekas, dmaicher)
40+
* bug #27747 [HttpFoundation] fix registration of session proxies (nicolas-grekas)
41+
* bug #27722 Redesign the Debug error page in prod (javiereguiluz)
42+
* bug #27716 [DI] fix dumping deprecated service in yaml (nicolas-grekas)
43+
1044
* 4.0.12 (2018-06-25)
1145

1246
* bug #27626 [TwigBundle][DX] Only add the Twig WebLinkExtension if the WebLink component is enabled (thewilkybarkid)

CHANGELOG-4.1.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,53 @@ in 4.1 minor versions.
77
To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash
88
To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v4.1.0...v4.1.1
99

10+
* 4.1.2 (2018-07-23)
11+
12+
* bug #28005 [HttpKernel] Fixed templateExists on parse error of the template name (yceruto)
13+
* bug #28013 [Messenger] Add missing typehint on chain sender (sroze)
14+
* bug #27997 Serbo-Croatian has Serbian plural rule (kylekatarnls)
15+
* bug #26193 Fix false-positive deprecation notices for TranslationLoader and WriteCheckSessionHandler (iquito)
16+
* bug #27827 [Serializer] Supports nested abstract items (sroze)
17+
* bug #27958 [Form] Remaining changes for bootstrap 4 file fields (apfelbox)
18+
* bug #27919 [Form] Improve rendering of `file` field in bootstrap 4 (apfelbox)
19+
* bug #27941 [WebProfilerBundle] Fixed icon alignment issue using Bootstrap 4.1.2 (jmsche)
20+
* bug #27937 [HttpFoundation] reset callback on StreamedResponse when setNotModified() is called (rubencm)
21+
* bug #27927 [HttpFoundation] Suppress side effects in 'get' and 'has' methods of NamespacedAttributeBag (webnet-fr)
22+
* bug #27913 [EventDispatcher] Clear orphaned events on reset (acasademont)
23+
* bug #27923 [Form/Profiler] Massively reducing memory footprint of form profiling pages... (VincentChalnot)
24+
* bug #27918 [Console] correctly return parameter's default value on "--" (seschwar)
25+
* bug #27826 [Serializer] Fix serialization of items with groups across entities and discrimination map (sroze)
26+
* bug #27904 [Filesystem] fix lock file permissions (fritzmg)
27+
* bug #27903 [Lock] fix lock file permissions (fritzmg)
28+
* bug #27889 [Form] Replace .initialism with .text-uppercase. (vudaltsov)
29+
* bug #27902 Fix the detection of the Process new argument (stof)
30+
* bug #27885 [HttpFoundation] don't encode cookie name for BC (nicolas-grekas)
31+
* bug #27782 [DI] Fix dumping ignore-on-uninitialized references to synthetic services (nicolas-grekas)
32+
* bug #27435 [OptionResolver] resolve arrays (Doctrs)
33+
* bug #27728 [TwigBridge] Fix missing path and separators in loader paths list on debug:twig output (yceruto)
34+
* bug #27837 [PropertyInfo] Fix dock block lookup fallback loop (DerManoMann)
35+
* bug #27848 [Workflow] Fixed BC break (lyrixx)
36+
* bug #27758 [WebProfilerBundle] Prevent toolbar links color override by css (alcalyn)
37+
* bug #27847 [Security] Fix accepting null as $uidKey in LdapUserProvider (louhde)
38+
* bug #27820 [Messenger] Fix a bug when having more than one named handler per message subscriber (sroze)
39+
* bug #27834 [DI] Don't show internal service id on binding errors (nicolas-grekas)
40+
* bug #27831 Check for Hyper terminal on all operating systems. (azjezz)
41+
* bug #27794 Add color support for Hyper terminal . (azjezz)
42+
* bug #27809 [HttpFoundation] Fix tests: new message for status 425 (dunglas)
43+
* bug #27618 [PropertyInfo] added handling of nullable types in PhpDoc (oxan)
44+
* bug #27659 [HttpKernel] Make AbstractTestSessionListener compatible with CookieClearingLogoutHandler (thewilkybarkid)
45+
* bug #27752 [Cache] provider does not respect option maxIdLength with versioning enabled (Constantine Shtompel)
46+
* bug #27773 [Serializer] Class discriminator and serialization groups (sroze)
47+
* bug #27710 [DependencyInjection] fix handling of empty DI extension configs (xabbuh)
48+
* bug #27776 [ProxyManagerBridge] Fix support of private services (bis) (nicolas-grekas)
49+
* bug #27714 [HttpFoundation] fix session tracking counter (nicolas-grekas, dmaicher)
50+
* bug #27727 [Routing] Disallow object usage inside Route (paxal)
51+
* bug #27736 [Routing] fix too much greediness in host-matching regex (nicolas-grekas)
52+
* bug #27747 [HttpFoundation] fix registration of session proxies (nicolas-grekas)
53+
* bug #27754 [HttpFoundation] missing namespace for RedisProxy (Bonfante)
54+
* bug #27722 Redesign the Debug error page in prod (javiereguiluz)
55+
* bug #27716 [DI] fix dumping deprecated service in yaml (nicolas-grekas)
56+
1057
* 4.1.1 (2018-06-25)
1158

1259
* bug #27626 [TwigBundle][DX] Only add the Twig WebLinkExtension if the WebLink component is enabled (thewilkybarkid)

src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class DeprecationErrorHandler
2929
*
3030
* The following reporting modes are supported:
3131
* - use "weak" to hide the deprecation report but keep a global count;
32-
* - use "weak_vendors" to act as "weak" but only for vendors;
32+
* - use "weak_vendors" to fail only on deprecations triggered in your own code;
3333
* - use "/some-regexp/" to stop the test suite whenever a deprecation
3434
* message matches the given regular expression;
3535
* - use a number to define the upper bound of allowed deprecations,
@@ -80,7 +80,7 @@ public static function register($mode = 0)
8080
return true;
8181
}
8282
foreach ($vendors as $vendor) {
83-
if (0 === strpos($realPath, $vendor) && false !== strpbrk(substr($realPath, strlen($vendor), 1), '/'.DIRECTORY_SEPARATOR)) {
83+
if (0 === strpos($realPath, $vendor) && false !== strpbrk(substr($realPath, strlen($vendor), 1), '/'.\DIRECTORY_SEPARATOR)) {
8484
return true;
8585
}
8686
}
@@ -159,7 +159,7 @@ public static function register($mode = 0)
159159
echo "\n".ucfirst($group).' deprecation triggered by '.$class.'::'.$method.':';
160160
echo "\n".$msg;
161161
echo "\nStack trace:";
162-
echo "\n".str_replace(' '.getcwd().DIRECTORY_SEPARATOR, ' ', $e->getTraceAsString());
162+
echo "\n".str_replace(' '.getcwd().\DIRECTORY_SEPARATOR, ' ', $e->getTraceAsString());
163163
echo "\n";
164164

165165
exit(1);
@@ -315,7 +315,7 @@ private static function hasColorSupport()
315315
return true;
316316
}
317317

318-
if (DIRECTORY_SEPARATOR === '\\') {
318+
if (\DIRECTORY_SEPARATOR === '\\') {
319319
return (function_exists('sapi_windows_vt100_support')
320320
&& sapi_windows_vt100_support(STDOUT))
321321
|| false !== getenv('ANSICON')

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

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1511,6 +1511,22 @@ private function registerMessengerConfiguration(array $config, ContainerBuilder
15111511
throw new LogicException(sprintf('The default bus named "%s" is not defined. Define it or change the default bus name.', $config['default_bus']));
15121512
}
15131513

1514+
$senderAliases = array();
1515+
foreach ($config['transports'] as $name => $transport) {
1516+
if (0 === strpos($transport['dsn'], 'amqp://') && !$container->hasDefinition('messenger.transport.amqp.factory')) {
1517+
throw new LogicException('The default AMQP transport is not available. Make sure you have installed and enabled the Serializer component. Try enable it or install it by running "composer require symfony/serializer-pack".');
1518+
}
1519+
1520+
$transportDefinition = (new Definition(TransportInterface::class))
1521+
->setFactory(array(new Reference('messenger.transport_factory'), 'createTransport'))
1522+
->setArguments(array($transport['dsn'], $transport['options']))
1523+
->addTag('messenger.receiver', array('alias' => $name))
1524+
->addTag('messenger.sender', array('alias' => $name))
1525+
;
1526+
$container->setDefinition($transportId = 'messenger.transport.'.$name, $transportDefinition);
1527+
$senderAliases[$name] = $transportId;
1528+
}
1529+
15141530
$messageToSenderIdMapping = array();
15151531
$messageToSendAndHandleMapping = array();
15161532
foreach ($config['routing'] as $message => $messageConfiguration) {
@@ -1519,8 +1535,11 @@ private function registerMessengerConfiguration(array $config, ContainerBuilder
15191535
}
15201536

15211537
if (1 < \count($messageConfiguration['senders'])) {
1522-
$senders = array_map(function ($sender) { return new Reference($sender); }, $messageConfiguration['senders']);
1538+
$senders = array_map(function ($sender) use ($senderAliases) {
1539+
return new Reference($senderAliases[$sender] ?? $sender);
1540+
}, $messageConfiguration['senders']);
15231541
$chainSenderDefinition = new Definition(ChainSender::class, array($senders));
1542+
$chainSenderDefinition->addTag('messenger.sender');
15241543
$chainSenderId = '.messenger.chain_sender.'.$message;
15251544
$container->setDefinition($chainSenderId, $chainSenderDefinition);
15261545
$messageToSenderIdMapping[$message] = $chainSenderId;
@@ -1533,20 +1552,6 @@ private function registerMessengerConfiguration(array $config, ContainerBuilder
15331552

15341553
$container->getDefinition('messenger.asynchronous.routing.sender_locator')->replaceArgument(1, $messageToSenderIdMapping);
15351554
$container->getDefinition('messenger.middleware.route_messages')->replaceArgument(1, $messageToSendAndHandleMapping);
1536-
1537-
foreach ($config['transports'] as $name => $transport) {
1538-
if (0 === strpos($transport['dsn'], 'amqp://') && !$container->hasDefinition('messenger.transport.amqp.factory')) {
1539-
throw new LogicException('The default AMQP transport is not available. Make sure you have installed and enabled the Serializer component. Try enable it or install it by running "composer require symfony/serializer-pack".');
1540-
}
1541-
1542-
$transportDefinition = (new Definition(TransportInterface::class))
1543-
->setFactory(array(new Reference('messenger.transport_factory'), 'createTransport'))
1544-
->setArguments(array($transport['dsn'], $transport['options']))
1545-
->addTag('messenger.receiver', array('alias' => $name))
1546-
->addTag('messenger.sender', array('alias' => $name))
1547-
;
1548-
$container->setDefinition('messenger.transport.'.$name, $transportDefinition);
1549-
}
15501555
}
15511556

15521557
private function registerCacheConfiguration(array $config, ContainerBuilder $container)

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
<?php
22

33
$container->loadFromExtension('framework', array(
4+
'serializer' => true,
45
'messenger' => array(
6+
'serializer' => true,
57
'routing' => array(
68
'Symfony\Component\Messenger\Tests\Fixtures\DummyMessage' => array('amqp', 'audit'),
79
'Symfony\Component\Messenger\Tests\Fixtures\SecondMessage' => array(
@@ -10,5 +12,8 @@
1012
),
1113
'*' => 'amqp',
1214
),
15+
'transports' => array(
16+
'amqp' => 'amqp://localhost/%2f/messages',
17+
),
1318
),
1419
));

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
77

88
<framework:config>
9+
<framework:serializer enabled="true" />
910
<framework:messenger>
11+
<framework:serializer enabled="true" />
1012
<framework:routing message-class="Symfony\Component\Messenger\Tests\Fixtures\DummyMessage">
1113
<framework:sender service="amqp" />
1214
<framework:sender service="audit" />
@@ -18,6 +20,7 @@
1820
<framework:routing message-class="*">
1921
<framework:sender service="amqp" />
2022
</framework:routing>
23+
<framework:transport name="amqp" dsn="amqp://localhost/%2f/messages" />
2124
</framework:messenger>
2225
</framework:config>
2326
</container>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
framework:
2+
serializer: true
23
messenger:
4+
serializer: true
35
routing:
46
'Symfony\Component\Messenger\Tests\Fixtures\DummyMessage': [amqp, audit]
57
'Symfony\Component\Messenger\Tests\Fixtures\SecondMessage':
68
senders: [amqp, audit]
79
send_and_handle: true
810
'*': amqp
11+
transports:
12+
amqp: 'amqp://localhost/%2f/messages'

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,7 @@ public function testMessengerRouting()
573573

574574
$this->assertSame($messageToSenderIdsMapping, $senderLocatorDefinition->getArgument(1));
575575
$this->assertSame($messageToSendAndHandleMapping, $sendMessageMiddlewareDefinition->getArgument(1));
576+
$this->assertEquals(array(new Reference('messenger.transport.amqp'), new Reference('audit')), $container->getDefinition('.messenger.chain_sender.'.DummyMessage::class)->getArgument(0));
576577
}
577578

578579
/**

src/Symfony/Component/HttpKernel/DependencyInjection/RegisterControllerArgumentLocatorsPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function process(ContainerBuilder $container)
6262
while ($def instanceof ChildDefinition) {
6363
$def = $container->findDefinition($def->getParent());
6464
$class = $class ?: $def->getClass();
65-
$bindings = $def->getBindings();
65+
$bindings += $def->getBindings();
6666
}
6767
$class = $parameterBag->resolveValue($class);
6868

src/Symfony/Component/HttpKernel/Tests/DependencyInjection/RegisterControllerArgumentLocatorsPassTest.php

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

1414
use PHPUnit\Framework\TestCase;
1515
use Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument;
16+
use Symfony\Component\DependencyInjection\ChildDefinition;
1617
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
1718
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
1819
use Symfony\Component\DependencyInjection\ContainerBuilder;
@@ -352,6 +353,29 @@ public function provideBindScalarValueToControllerArgument()
352353
yield array('$someArg');
353354
yield array('string $someArg');
354355
}
356+
357+
public function testBindingsOnChildDefinitions()
358+
{
359+
$container = new ContainerBuilder();
360+
$resolver = $container->register('argument_resolver.service')->addArgument(array());
361+
362+
$container->register('parent', ArgumentWithoutTypeController::class);
363+
364+
$container->setDefinition('child', (new ChildDefinition('parent'))
365+
->setBindings(array('$someArg' => new Reference('parent')))
366+
->addTag('controller.service_arguments')
367+
);
368+
369+
$pass = new RegisterControllerArgumentLocatorsPass();
370+
$pass->process($container);
371+
372+
$locator = $container->getDefinition((string) $resolver->getArgument(0))->getArgument(0);
373+
$this->assertInstanceOf(ServiceClosureArgument::class, $locator['child::fooAction']);
374+
375+
$locator = $container->getDefinition((string) $locator['child::fooAction']->getValues()[0])->getArgument(0);
376+
$this->assertInstanceOf(ServiceClosureArgument::class, $locator['someArg']);
377+
$this->assertEquals(new Reference('parent'), $locator['someArg']->getValues()[0]);
378+
}
355379
}
356380

357381
class RegisterTestController

0 commit comments

Comments
 (0)