From 90d1b059fddfbe4e12e63c297194ce1b5871c8ad Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Mon, 8 Jul 2019 13:53:30 -0400 Subject: [PATCH 1/7] Adding missing event_dispatcher wiring for messenger.middleware.send_message --- .../Bundle/FrameworkBundle/Resources/config/messenger.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/messenger.xml b/src/Symfony/Bundle/FrameworkBundle/Resources/config/messenger.xml index a060b723b8..5ef47e751e 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/messenger.xml +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/messenger.xml @@ -15,6 +15,7 @@ + From 6eee2a814484b5aa0668a60fe54e916004fc6a1f Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Thu, 11 Jul 2019 12:21:37 +0200 Subject: [PATCH 2/7] [HttpKernel] fix tests --- .../HttpKernel/Tests/Debug/TraceableEventDispatcherTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/HttpKernel/Tests/Debug/TraceableEventDispatcherTest.php b/src/Symfony/Component/HttpKernel/Tests/Debug/TraceableEventDispatcherTest.php index 60ad1b89c4..c66732a37c 100644 --- a/src/Symfony/Component/HttpKernel/Tests/Debug/TraceableEventDispatcherTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/Debug/TraceableEventDispatcherTest.php @@ -25,7 +25,7 @@ class TraceableEventDispatcherTest extends TestCase public function testStopwatchSections() { $dispatcher = new TraceableEventDispatcher(new EventDispatcher(), $stopwatch = new Stopwatch()); - $kernel = $this->getHttpKernel($dispatcher, function () { return new Response(); }); + $kernel = $this->getHttpKernel($dispatcher, function () { return new Response('', 200, ['X-Debug-Token' => '292e1e']); }); $request = Request::create('/'); $response = $kernel->handle($request); $kernel->terminate($request, $response); From c7141c82d1e62ef1320a4652283ddff4fdd5bd83 Mon Sep 17 00:00:00 2001 From: Thomas Calvet Date: Thu, 11 Jul 2019 20:09:53 +0200 Subject: [PATCH 3/7] [Debug][DebugClassLoader] Include found files instead of requiring them --- src/Symfony/Component/Debug/DebugClassLoader.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Debug/DebugClassLoader.php b/src/Symfony/Component/Debug/DebugClassLoader.php index 9ceac9af16..b63c6adee9 100644 --- a/src/Symfony/Component/Debug/DebugClassLoader.php +++ b/src/Symfony/Component/Debug/DebugClassLoader.php @@ -149,11 +149,11 @@ class DebugClassLoader if (!$file = $this->classLoader[0]->findFile($class) ?: false) { // no-op } elseif (\function_exists('opcache_is_script_cached') && @opcache_is_script_cached($file)) { - require $file; + include $file; return; } else { - require $file; + include $file; } } else { \call_user_func($this->classLoader, $class); From c5ee4bedc2bd4208b6677078029c40332ef73ee5 Mon Sep 17 00:00:00 2001 From: Paulo Ribeiro Date: Thu, 11 Jul 2019 16:09:41 -0300 Subject: [PATCH 4/7] [FrameworkBundle] Fix descriptor of routes described as callable array --- .../FrameworkBundle/Console/Descriptor/TextDescriptor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php index 796beaee01..18b13a215c 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php +++ b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php @@ -540,7 +540,7 @@ class TextDescriptor extends Descriptor try { if (\is_array($controller)) { - $r = new \ReflectionMethod($controller); + $r = new \ReflectionMethod($controller[0], $controller[1]); } elseif ($controller instanceof \Closure) { $r = new \ReflectionFunction($controller); } elseif (method_exists($controller, '__invoke')) { From ee5e5de9e031fa037bf099ef12e485d583e36fcd Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 12 Jul 2019 08:50:39 +0300 Subject: [PATCH 5/7] fixed CS --- .../Tests/DependencyInjection/FrameworkExtensionTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php index b0356b3c14..c114f38177 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php @@ -23,7 +23,6 @@ use Symfony\Component\Cache\Adapter\DoctrineAdapter; use Symfony\Component\Cache\Adapter\FilesystemAdapter; use Symfony\Component\Cache\Adapter\ProxyAdapter; use Symfony\Component\Cache\Adapter\RedisAdapter; -use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException; use Symfony\Component\DependencyInjection\ChildDefinition; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; From 2f3b47a9e4513e301bdac2d1f793e2adad001d0f Mon Sep 17 00:00:00 2001 From: Konstantin Myakshin Date: Mon, 15 Jul 2019 22:23:03 +0300 Subject: [PATCH 6/7] [Mailer] Allow register mailer configuration in xml format --- .../Resources/config/schema/symfony-1.0.xsd | 5 +++++ .../DependencyInjection/Fixtures/php/mailer.php | 7 +++++++ .../DependencyInjection/Fixtures/xml/mailer.xml | 12 ++++++++++++ .../DependencyInjection/Fixtures/yml/mailer.yml | 3 +++ .../DependencyInjection/FrameworkExtensionTest.php | 9 ++++++++- 5 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/mailer.php create mode 100644 src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/mailer.xml create mode 100644 src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/mailer.yml diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd b/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd index 04157511dc..69deb492a2 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd @@ -33,6 +33,7 @@ + @@ -543,4 +544,8 @@ + + + + diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/mailer.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/mailer.php new file mode 100644 index 0000000000..74f6856c29 --- /dev/null +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/mailer.php @@ -0,0 +1,7 @@ +loadFromExtension('framework', [ + 'mailer' => [ + 'dsn' => 'smtp://example.com', + ], +]); diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/mailer.xml b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/mailer.xml new file mode 100644 index 0000000000..5faa09d36d --- /dev/null +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/mailer.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/mailer.yml b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/mailer.yml new file mode 100644 index 0000000000..0fca3e83e0 --- /dev/null +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/mailer.yml @@ -0,0 +1,3 @@ +framework: + mailer: + dsn: 'smtp://example.com' diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php index 877e79c889..76e4a086f4 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php @@ -55,7 +55,6 @@ use Symfony\Component\Translation\TranslatorInterface; use Symfony\Component\Validator\DependencyInjection\AddConstraintValidatorsPass; use Symfony\Component\Validator\Mapping\Loader\PropertyInfoLoader; use Symfony\Component\Validator\Util\LegacyTranslatorProxy; -use Symfony\Component\Validator\Validation; use Symfony\Component\Workflow; abstract class FrameworkExtensionTest extends TestCase @@ -1552,6 +1551,14 @@ abstract class FrameworkExtensionTest extends TestCase ], $defaultOptions['peer_fingerprint']); } + public function testMailer(): void + { + $container = $this->createContainerFromFile('mailer'); + + $this->assertTrue($container->hasAlias('mailer')); + $this->assertTrue($container->hasDefinition('mailer.default_transport')); + } + protected function createContainer(array $data = []) { return new ContainerBuilder(new ParameterBag(array_merge([ From a0d2c429b1711c1dc9fce965266a967af449ae93 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 16 Jul 2019 08:12:19 +0200 Subject: [PATCH 7/7] added missing test --- .../Tests/DependencyInjection/FrameworkExtensionTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php index 76e4a086f4..b850d7c8c3 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php @@ -1557,6 +1557,7 @@ abstract class FrameworkExtensionTest extends TestCase $this->assertTrue($container->hasAlias('mailer')); $this->assertTrue($container->hasDefinition('mailer.default_transport')); + $this->assertSame('smtp://example.com', $container->getDefinition('mailer.default_transport')->getArgument(0)); } protected function createContainer(array $data = [])