diff --git a/CHANGELOG-4.0.md b/CHANGELOG-4.0.md index 72d24bf39e..2afe811abc 100644 --- a/CHANGELOG-4.0.md +++ b/CHANGELOG-4.0.md @@ -7,6 +7,40 @@ in 4.0 minor versions. To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v4.0.0...v4.0.1 +* 4.0.13 (2018-07-23) + + * bug #28005 [HttpKernel] Fixed templateExists on parse error of the template name (yceruto) + * bug #27997 Serbo-Croatian has Serbian plural rule (kylekatarnls) + * bug #26193 Fix false-positive deprecation notices for TranslationLoader and WriteCheckSessionHandler (iquito) + * bug #27941 [WebProfilerBundle] Fixed icon alignment issue using Bootstrap 4.1.2 (jmsche) + * bug #27937 [HttpFoundation] reset callback on StreamedResponse when setNotModified() is called (rubencm) + * bug #27927 [HttpFoundation] Suppress side effects in 'get' and 'has' methods of NamespacedAttributeBag (webnet-fr) + * bug #27923 [Form/Profiler] Massively reducing memory footprint of form profiling pages... (VincentChalnot) + * bug #27918 [Console] correctly return parameter's default value on "--" (seschwar) + * bug #27904 [Filesystem] fix lock file permissions (fritzmg) + * bug #27903 [Lock] fix lock file permissions (fritzmg) + * bug #27889 [Form] Replace .initialism with .text-uppercase. (vudaltsov) + * bug #27902 Fix the detection of the Process new argument (stof) + * bug #27885 [HttpFoundation] don't encode cookie name for BC (nicolas-grekas) + * bug #27782 [DI] Fix dumping ignore-on-uninitialized references to synthetic services (nicolas-grekas) + * bug #27435 [OptionResolver] resolve arrays (Doctrs) + * bug #27728 [TwigBridge] Fix missing path and separators in loader paths list on debug:twig output (yceruto) + * bug #27837 [PropertyInfo] Fix dock block lookup fallback loop (DerManoMann) + * bug #27758 [WebProfilerBundle] Prevent toolbar links color override by css (alcalyn) + * bug #27847 [Security] Fix accepting null as $uidKey in LdapUserProvider (louhde) + * bug #27834 [DI] Don't show internal service id on binding errors (nicolas-grekas) + * bug #27831 Check for Hyper terminal on all operating systems. (azjezz) + * bug #27794 Add color support for Hyper terminal . (azjezz) + * bug #27809 [HttpFoundation] Fix tests: new message for status 425 (dunglas) + * bug #27618 [PropertyInfo] added handling of nullable types in PhpDoc (oxan) + * bug #27659 [HttpKernel] Make AbstractTestSessionListener compatible with CookieClearingLogoutHandler (thewilkybarkid) + * bug #27752 [Cache] provider does not respect option maxIdLength with versioning enabled (Constantine Shtompel) + * bug #27776 [ProxyManagerBridge] Fix support of private services (bis) (nicolas-grekas) + * bug #27714 [HttpFoundation] fix session tracking counter (nicolas-grekas, dmaicher) + * bug #27747 [HttpFoundation] fix registration of session proxies (nicolas-grekas) + * bug #27722 Redesign the Debug error page in prod (javiereguiluz) + * bug #27716 [DI] fix dumping deprecated service in yaml (nicolas-grekas) + * 4.0.12 (2018-06-25) * bug #27626 [TwigBundle][DX] Only add the Twig WebLinkExtension if the WebLink component is enabled (thewilkybarkid) diff --git a/CHANGELOG-4.1.md b/CHANGELOG-4.1.md index b09b994c5c..e7126dcf6d 100644 --- a/CHANGELOG-4.1.md +++ b/CHANGELOG-4.1.md @@ -7,6 +7,53 @@ in 4.1 minor versions. To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v4.1.0...v4.1.1 +* 4.1.2 (2018-07-23) + + * bug #28005 [HttpKernel] Fixed templateExists on parse error of the template name (yceruto) + * bug #28013 [Messenger] Add missing typehint on chain sender (sroze) + * bug #27997 Serbo-Croatian has Serbian plural rule (kylekatarnls) + * bug #26193 Fix false-positive deprecation notices for TranslationLoader and WriteCheckSessionHandler (iquito) + * bug #27827 [Serializer] Supports nested abstract items (sroze) + * bug #27958 [Form] Remaining changes for bootstrap 4 file fields (apfelbox) + * bug #27919 [Form] Improve rendering of `file` field in bootstrap 4 (apfelbox) + * bug #27941 [WebProfilerBundle] Fixed icon alignment issue using Bootstrap 4.1.2 (jmsche) + * bug #27937 [HttpFoundation] reset callback on StreamedResponse when setNotModified() is called (rubencm) + * bug #27927 [HttpFoundation] Suppress side effects in 'get' and 'has' methods of NamespacedAttributeBag (webnet-fr) + * bug #27913 [EventDispatcher] Clear orphaned events on reset (acasademont) + * bug #27923 [Form/Profiler] Massively reducing memory footprint of form profiling pages... (VincentChalnot) + * bug #27918 [Console] correctly return parameter's default value on "--" (seschwar) + * bug #27826 [Serializer] Fix serialization of items with groups across entities and discrimination map (sroze) + * bug #27904 [Filesystem] fix lock file permissions (fritzmg) + * bug #27903 [Lock] fix lock file permissions (fritzmg) + * bug #27889 [Form] Replace .initialism with .text-uppercase. (vudaltsov) + * bug #27902 Fix the detection of the Process new argument (stof) + * bug #27885 [HttpFoundation] don't encode cookie name for BC (nicolas-grekas) + * bug #27782 [DI] Fix dumping ignore-on-uninitialized references to synthetic services (nicolas-grekas) + * bug #27435 [OptionResolver] resolve arrays (Doctrs) + * bug #27728 [TwigBridge] Fix missing path and separators in loader paths list on debug:twig output (yceruto) + * bug #27837 [PropertyInfo] Fix dock block lookup fallback loop (DerManoMann) + * bug #27848 [Workflow] Fixed BC break (lyrixx) + * bug #27758 [WebProfilerBundle] Prevent toolbar links color override by css (alcalyn) + * bug #27847 [Security] Fix accepting null as $uidKey in LdapUserProvider (louhde) + * bug #27820 [Messenger] Fix a bug when having more than one named handler per message subscriber (sroze) + * bug #27834 [DI] Don't show internal service id on binding errors (nicolas-grekas) + * bug #27831 Check for Hyper terminal on all operating systems. (azjezz) + * bug #27794 Add color support for Hyper terminal . (azjezz) + * bug #27809 [HttpFoundation] Fix tests: new message for status 425 (dunglas) + * bug #27618 [PropertyInfo] added handling of nullable types in PhpDoc (oxan) + * bug #27659 [HttpKernel] Make AbstractTestSessionListener compatible with CookieClearingLogoutHandler (thewilkybarkid) + * bug #27752 [Cache] provider does not respect option maxIdLength with versioning enabled (Constantine Shtompel) + * bug #27773 [Serializer] Class discriminator and serialization groups (sroze) + * bug #27710 [DependencyInjection] fix handling of empty DI extension configs (xabbuh) + * bug #27776 [ProxyManagerBridge] Fix support of private services (bis) (nicolas-grekas) + * bug #27714 [HttpFoundation] fix session tracking counter (nicolas-grekas, dmaicher) + * bug #27727 [Routing] Disallow object usage inside Route (paxal) + * bug #27736 [Routing] fix too much greediness in host-matching regex (nicolas-grekas) + * bug #27747 [HttpFoundation] fix registration of session proxies (nicolas-grekas) + * bug #27754 [HttpFoundation] missing namespace for RedisProxy (Bonfante) + * bug #27722 Redesign the Debug error page in prod (javiereguiluz) + * bug #27716 [DI] fix dumping deprecated service in yaml (nicolas-grekas) + * 4.1.1 (2018-06-25) * bug #27626 [TwigBundle][DX] Only add the Twig WebLinkExtension if the WebLink component is enabled (thewilkybarkid) diff --git a/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php b/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php index a2528db303..2836d9136d 100644 --- a/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php +++ b/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php @@ -29,7 +29,7 @@ class DeprecationErrorHandler * * The following reporting modes are supported: * - use "weak" to hide the deprecation report but keep a global count; - * - use "weak_vendors" to act as "weak" but only for vendors; + * - use "weak_vendors" to fail only on deprecations triggered in your own code; * - use "/some-regexp/" to stop the test suite whenever a deprecation * message matches the given regular expression; * - use a number to define the upper bound of allowed deprecations, @@ -80,7 +80,7 @@ class DeprecationErrorHandler return true; } foreach ($vendors as $vendor) { - if (0 === strpos($realPath, $vendor) && false !== strpbrk(substr($realPath, strlen($vendor), 1), '/'.DIRECTORY_SEPARATOR)) { + if (0 === strpos($realPath, $vendor) && false !== strpbrk(substr($realPath, strlen($vendor), 1), '/'.\DIRECTORY_SEPARATOR)) { return true; } } @@ -159,7 +159,7 @@ class DeprecationErrorHandler echo "\n".ucfirst($group).' deprecation triggered by '.$class.'::'.$method.':'; echo "\n".$msg; echo "\nStack trace:"; - echo "\n".str_replace(' '.getcwd().DIRECTORY_SEPARATOR, ' ', $e->getTraceAsString()); + echo "\n".str_replace(' '.getcwd().\DIRECTORY_SEPARATOR, ' ', $e->getTraceAsString()); echo "\n"; exit(1); @@ -315,7 +315,7 @@ class DeprecationErrorHandler return true; } - if (DIRECTORY_SEPARATOR === '\\') { + if (\DIRECTORY_SEPARATOR === '\\') { return (function_exists('sapi_windows_vt100_support') && sapi_windows_vt100_support(STDOUT)) || false !== getenv('ANSICON') diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index 9065ac1f30..28ad3bc887 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -1511,6 +1511,22 @@ class FrameworkExtension extends Extension throw new LogicException(sprintf('The default bus named "%s" is not defined. Define it or change the default bus name.', $config['default_bus'])); } + $senderAliases = array(); + foreach ($config['transports'] as $name => $transport) { + if (0 === strpos($transport['dsn'], 'amqp://') && !$container->hasDefinition('messenger.transport.amqp.factory')) { + 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".'); + } + + $transportDefinition = (new Definition(TransportInterface::class)) + ->setFactory(array(new Reference('messenger.transport_factory'), 'createTransport')) + ->setArguments(array($transport['dsn'], $transport['options'])) + ->addTag('messenger.receiver', array('alias' => $name)) + ->addTag('messenger.sender', array('alias' => $name)) + ; + $container->setDefinition($transportId = 'messenger.transport.'.$name, $transportDefinition); + $senderAliases[$name] = $transportId; + } + $messageToSenderIdMapping = array(); $messageToSendAndHandleMapping = array(); foreach ($config['routing'] as $message => $messageConfiguration) { @@ -1519,8 +1535,11 @@ class FrameworkExtension extends Extension } if (1 < \count($messageConfiguration['senders'])) { - $senders = array_map(function ($sender) { return new Reference($sender); }, $messageConfiguration['senders']); + $senders = array_map(function ($sender) use ($senderAliases) { + return new Reference($senderAliases[$sender] ?? $sender); + }, $messageConfiguration['senders']); $chainSenderDefinition = new Definition(ChainSender::class, array($senders)); + $chainSenderDefinition->addTag('messenger.sender'); $chainSenderId = '.messenger.chain_sender.'.$message; $container->setDefinition($chainSenderId, $chainSenderDefinition); $messageToSenderIdMapping[$message] = $chainSenderId; @@ -1533,20 +1552,6 @@ class FrameworkExtension extends Extension $container->getDefinition('messenger.asynchronous.routing.sender_locator')->replaceArgument(1, $messageToSenderIdMapping); $container->getDefinition('messenger.middleware.route_messages')->replaceArgument(1, $messageToSendAndHandleMapping); - - foreach ($config['transports'] as $name => $transport) { - if (0 === strpos($transport['dsn'], 'amqp://') && !$container->hasDefinition('messenger.transport.amqp.factory')) { - 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".'); - } - - $transportDefinition = (new Definition(TransportInterface::class)) - ->setFactory(array(new Reference('messenger.transport_factory'), 'createTransport')) - ->setArguments(array($transport['dsn'], $transport['options'])) - ->addTag('messenger.receiver', array('alias' => $name)) - ->addTag('messenger.sender', array('alias' => $name)) - ; - $container->setDefinition('messenger.transport.'.$name, $transportDefinition); - } } private function registerCacheConfiguration(array $config, ContainerBuilder $container) diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/messenger_routing.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/messenger_routing.php index 51b1184764..0d6af180fd 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/messenger_routing.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/messenger_routing.php @@ -1,7 +1,9 @@ loadFromExtension('framework', array( + 'serializer' => true, 'messenger' => array( + 'serializer' => true, 'routing' => array( 'Symfony\Component\Messenger\Tests\Fixtures\DummyMessage' => array('amqp', 'audit'), 'Symfony\Component\Messenger\Tests\Fixtures\SecondMessage' => array( @@ -10,5 +12,8 @@ $container->loadFromExtension('framework', array( ), '*' => 'amqp', ), + 'transports' => array( + 'amqp' => 'amqp://localhost/%2f/messages', + ), ), )); diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/messenger_routing.xml b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/messenger_routing.xml index 808b0ba9cd..f0747bff71 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/messenger_routing.xml +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/messenger_routing.xml @@ -6,7 +6,9 @@ http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> + + @@ -18,6 +20,7 @@ + diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/messenger_routing.yml b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/messenger_routing.yml index da096fcaed..a82a093aa7 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/messenger_routing.yml +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/messenger_routing.yml @@ -1,8 +1,12 @@ framework: + serializer: true messenger: + serializer: true routing: 'Symfony\Component\Messenger\Tests\Fixtures\DummyMessage': [amqp, audit] 'Symfony\Component\Messenger\Tests\Fixtures\SecondMessage': senders: [amqp, audit] send_and_handle: true '*': amqp + transports: + amqp: 'amqp://localhost/%2f/messages' diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php index c25aa2b4b5..7ebb45c00a 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php @@ -573,6 +573,7 @@ abstract class FrameworkExtensionTest extends TestCase $this->assertSame($messageToSenderIdsMapping, $senderLocatorDefinition->getArgument(1)); $this->assertSame($messageToSendAndHandleMapping, $sendMessageMiddlewareDefinition->getArgument(1)); + $this->assertEquals(array(new Reference('messenger.transport.amqp'), new Reference('audit')), $container->getDefinition('.messenger.chain_sender.'.DummyMessage::class)->getArgument(0)); } /** diff --git a/src/Symfony/Component/HttpKernel/DependencyInjection/RegisterControllerArgumentLocatorsPass.php b/src/Symfony/Component/HttpKernel/DependencyInjection/RegisterControllerArgumentLocatorsPass.php index c9387423b8..0f41cf9116 100644 --- a/src/Symfony/Component/HttpKernel/DependencyInjection/RegisterControllerArgumentLocatorsPass.php +++ b/src/Symfony/Component/HttpKernel/DependencyInjection/RegisterControllerArgumentLocatorsPass.php @@ -62,7 +62,7 @@ class RegisterControllerArgumentLocatorsPass implements CompilerPassInterface while ($def instanceof ChildDefinition) { $def = $container->findDefinition($def->getParent()); $class = $class ?: $def->getClass(); - $bindings = $def->getBindings(); + $bindings += $def->getBindings(); } $class = $parameterBag->resolveValue($class); diff --git a/src/Symfony/Component/HttpKernel/Tests/DependencyInjection/RegisterControllerArgumentLocatorsPassTest.php b/src/Symfony/Component/HttpKernel/Tests/DependencyInjection/RegisterControllerArgumentLocatorsPassTest.php index 189515496c..214962d545 100644 --- a/src/Symfony/Component/HttpKernel/Tests/DependencyInjection/RegisterControllerArgumentLocatorsPassTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/DependencyInjection/RegisterControllerArgumentLocatorsPassTest.php @@ -13,6 +13,7 @@ namespace Symfony\Component\HttpKernel\Tests\DependencyInjection; use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument; +use Symfony\Component\DependencyInjection\ChildDefinition; use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerAwareTrait; use Symfony\Component\DependencyInjection\ContainerBuilder; @@ -352,6 +353,29 @@ class RegisterControllerArgumentLocatorsPassTest extends TestCase yield array('$someArg'); yield array('string $someArg'); } + + public function testBindingsOnChildDefinitions() + { + $container = new ContainerBuilder(); + $resolver = $container->register('argument_resolver.service')->addArgument(array()); + + $container->register('parent', ArgumentWithoutTypeController::class); + + $container->setDefinition('child', (new ChildDefinition('parent')) + ->setBindings(array('$someArg' => new Reference('parent'))) + ->addTag('controller.service_arguments') + ); + + $pass = new RegisterControllerArgumentLocatorsPass(); + $pass->process($container); + + $locator = $container->getDefinition((string) $resolver->getArgument(0))->getArgument(0); + $this->assertInstanceOf(ServiceClosureArgument::class, $locator['child::fooAction']); + + $locator = $container->getDefinition((string) $locator['child::fooAction']->getValues()[0])->getArgument(0); + $this->assertInstanceOf(ServiceClosureArgument::class, $locator['someArg']); + $this->assertEquals(new Reference('parent'), $locator['someArg']->getValues()[0]); + } } class RegisterTestController