From 7146b95303187d5859110741be07f88cda83919c Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Sun, 19 May 2019 07:50:55 -0300 Subject: [PATCH 01/47] [DI] fix using bindings with locators of service subscribers --- .../Compiler/ServiceLocatorTagPass.php | 12 +- .../Compiler/ServiceLocatorTagPassTest.php | 147 ++++++++++++++++++ .../Tests/Fixtures/TestDefinition2.php | 9 ++ 3 files changed, 167 insertions(+), 1 deletion(-) create mode 100644 src/Symfony/Component/DependencyInjection/Tests/Compiler/ServiceLocatorTagPassTest.php create mode 100644 src/Symfony/Component/DependencyInjection/Tests/Fixtures/TestDefinition2.php diff --git a/src/Symfony/Component/DependencyInjection/Compiler/ServiceLocatorTagPass.php b/src/Symfony/Component/DependencyInjection/Compiler/ServiceLocatorTagPass.php index 93e489c8f6a67..51de4d7ac0978 100644 --- a/src/Symfony/Component/DependencyInjection/Compiler/ServiceLocatorTagPass.php +++ b/src/Symfony/Component/DependencyInjection/Compiler/ServiceLocatorTagPass.php @@ -48,6 +48,12 @@ protected function processValue($value, $isRoot = false) if (!$v instanceof Reference) { throw new InvalidArgumentException(sprintf('Invalid definition for service "%s": an array of references is expected as first argument when the "container.service_locator" tag is set, "%s" found for key "%s".', $this->currentId, \is_object($v) ? \get_class($v) : \gettype($v), $k)); } + + if (\is_int($k)) { + unset($arguments[0][$k]); + + $k = (string) $v; + } $arguments[0][$k] = new ServiceClosureArgument($v); } ksort($arguments[0]); @@ -91,7 +97,11 @@ public static function register(ContainerBuilder $container, array $refMap, $cal ->setPublic(false) ->addTag('container.service_locator'); - if (!$container->has($id = 'service_locator.'.ContainerBuilder::hash($locator))) { + if (null !== $callerId && $container->hasDefinition($callerId)) { + $locator->setBindings($container->getDefinition($callerId)->getBindings()); + } + + if (!$container->hasDefinition($id = 'service_locator.'.ContainerBuilder::hash($locator))) { $container->setDefinition($id, $locator); } diff --git a/src/Symfony/Component/DependencyInjection/Tests/Compiler/ServiceLocatorTagPassTest.php b/src/Symfony/Component/DependencyInjection/Tests/Compiler/ServiceLocatorTagPassTest.php new file mode 100644 index 0000000000000..27ee7db533f6d --- /dev/null +++ b/src/Symfony/Component/DependencyInjection/Tests/Compiler/ServiceLocatorTagPassTest.php @@ -0,0 +1,147 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Tests\Compiler; + +use PHPUnit\Framework\TestCase; +use Symfony\Component\DependencyInjection\Argument\BoundArgument; +use Symfony\Component\DependencyInjection\Compiler\ServiceLocatorTagPass; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Reference; +use Symfony\Component\DependencyInjection\ServiceLocator; +use Symfony\Component\DependencyInjection\Tests\Fixtures\CustomDefinition; +use Symfony\Component\DependencyInjection\Tests\Fixtures\TestDefinition1; +use Symfony\Component\DependencyInjection\Tests\Fixtures\TestDefinition2; + +require_once __DIR__.'/../Fixtures/includes/classes.php'; + +class ServiceLocatorTagPassTest extends TestCase +{ + /** + * @expectedException \Symfony\Component\DependencyInjection\Exception\InvalidArgumentException + * @expectedExceptionMessage Invalid definition for service "foo": an array of references is expected as first argument when the "container.service_locator" tag is set. + */ + public function testNoServices() + { + $container = new ContainerBuilder(); + + $container->register('foo', ServiceLocator::class) + ->addTag('container.service_locator') + ; + + (new ServiceLocatorTagPass())->process($container); + } + + /** + * @expectedException \Symfony\Component\DependencyInjection\Exception\InvalidArgumentException + * @expectedExceptionMessage Invalid definition for service "foo": an array of references is expected as first argument when the "container.service_locator" tag is set, "string" found for key "0". + */ + public function testInvalidServices() + { + $container = new ContainerBuilder(); + + $container->register('foo', ServiceLocator::class) + ->setArguments([[ + 'dummy', + ]]) + ->addTag('container.service_locator') + ; + + (new ServiceLocatorTagPass())->process($container); + } + + public function testProcessValue() + { + $container = new ContainerBuilder(); + + $container->register('bar', CustomDefinition::class); + $container->register('baz', CustomDefinition::class); + + $container->register('foo', ServiceLocator::class) + ->setArguments([[ + new Reference('bar'), + new Reference('baz'), + 'some.service' => new Reference('bar'), + ]]) + ->addTag('container.service_locator') + ; + + (new ServiceLocatorTagPass())->process($container); + + /** @var ServiceLocator $locator */ + $locator = $container->get('foo'); + + $this->assertSame(CustomDefinition::class, \get_class($locator('bar'))); + $this->assertSame(CustomDefinition::class, \get_class($locator('baz'))); + $this->assertSame(CustomDefinition::class, \get_class($locator('some.service'))); + } + + public function testServiceWithKeyOverwritesPreviousInheritedKey() + { + $container = new ContainerBuilder(); + + $container->register('bar', TestDefinition1::class); + $container->register('baz', TestDefinition2::class); + + $container->register('foo', ServiceLocator::class) + ->setArguments([[ + new Reference('bar'), + 'bar' => new Reference('baz'), + ]]) + ->addTag('container.service_locator') + ; + + (new ServiceLocatorTagPass())->process($container); + + /** @var ServiceLocator $locator */ + $locator = $container->get('foo'); + + $this->assertSame(TestDefinition2::class, \get_class($locator('bar'))); + } + + public function testInheritedKeyOverwritesPreviousServiceWithKey() + { + $container = new ContainerBuilder(); + + $container->register('bar', TestDefinition1::class); + $container->register('baz', TestDefinition2::class); + + $container->register('foo', ServiceLocator::class) + ->setArguments([[ + 'bar' => new Reference('baz'), + new Reference('bar'), + ]]) + ->addTag('container.service_locator') + ; + + (new ServiceLocatorTagPass())->process($container); + + /** @var ServiceLocator $locator */ + $locator = $container->get('foo'); + + $this->assertSame(TestDefinition1::class, \get_class($locator('bar'))); + } + + public function testBindingsAreCopied() + { + $container = new ContainerBuilder(); + + $container->register('foo') + ->setBindings(['foo' => 'foo']); + + $locator = ServiceLocatorTagPass::register($container, ['foo' => new Reference('foo')], 'foo'); + $locator = $container->getDefinition($locator); + $locator = $container->getDefinition($locator->getFactory()[0]); + + $this->assertSame(['foo'], array_keys($locator->getBindings())); + $this->assertInstanceOf(BoundArgument::class, $locator->getBindings()['foo']); + } +} diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/TestDefinition2.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/TestDefinition2.php new file mode 100644 index 0000000000000..2ec8f9cf86879 --- /dev/null +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/TestDefinition2.php @@ -0,0 +1,9 @@ + Date: Wed, 22 May 2019 09:57:24 +0200 Subject: [PATCH 02/47] fix phpdoc --- .../Http/Authorization/AccessDeniedHandlerInterface.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Security/Http/Authorization/AccessDeniedHandlerInterface.php b/src/Symfony/Component/Security/Http/Authorization/AccessDeniedHandlerInterface.php index aea901181f601..871c877f57295 100644 --- a/src/Symfony/Component/Security/Http/Authorization/AccessDeniedHandlerInterface.php +++ b/src/Symfony/Component/Security/Http/Authorization/AccessDeniedHandlerInterface.php @@ -26,7 +26,7 @@ interface AccessDeniedHandlerInterface /** * Handles an access denied failure. * - * @return Response may return null + * @return Response|null */ public function handle(Request $request, AccessDeniedException $accessDeniedException); } From 1cd99eaaa83741e56d5b50529aaafb0072c9b387 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 22 May 2019 11:41:49 +0200 Subject: [PATCH 03/47] bumped Symfony version to 4.3.0 --- src/Symfony/Component/HttpKernel/Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index 379d0b32c4657..0dcdc717d9b22 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -73,12 +73,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl private $requestStackSize = 0; private $resetServices = false; - const VERSION = '4.3.0-BETA2'; + const VERSION = '4.3.0-DEV'; const VERSION_ID = 40300; const MAJOR_VERSION = 4; const MINOR_VERSION = 3; const RELEASE_VERSION = 0; - const EXTRA_VERSION = 'BETA2'; + const EXTRA_VERSION = 'DEV'; const END_OF_MAINTENANCE = '01/2020'; const END_OF_LIFE = '07/2020'; From 13ee1fa2b7be83e77cd9d3ebdd44da747b1999fe Mon Sep 17 00:00:00 2001 From: martijn Date: Wed, 1 May 2019 18:49:52 +0200 Subject: [PATCH 04/47] Use absolute URL for when the profiler's domain differs from the controller's domain which initialises the profiler. --- .../Bundle/WebProfilerBundle/Controller/ProfilerController.php | 2 +- .../Resources/views/Profiler/toolbar_item.html.twig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php b/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php index 4333c74d2ff82..55f343806affa 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php +++ b/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php @@ -164,7 +164,7 @@ public function toolbarAction(Request $request, $token) $url = null; try { - $url = $this->generator->generate('_profiler', ['token' => $token]); + $url = $this->generator->generate('_profiler', ['token' => $token], UrlGeneratorInterface::ABSOLUTE_URL); } catch (\Exception $e) { // the profiler is not enabled } diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_item.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_item.html.twig index 69872418cfb21..d81e877977667 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_item.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_item.html.twig @@ -1,5 +1,5 @@
- {% if link is not defined or link %}{% endif %} + {% if link is not defined or link %}{% endif %}
{{ icon|default('') }}
{% if link|default(false) %}
{% endif %}
{{ text|default('') }}
From f41069184281ff0ef3a046af87325fe752113a0f Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Wed, 22 May 2019 10:19:52 +0200 Subject: [PATCH 05/47] [Contracts] split in one package per sub-contracts --- src/Symfony/Contracts/Cache/LICENSE | 19 +++++++++++ src/Symfony/Contracts/Cache/README.md | 9 +++++ src/Symfony/Contracts/Cache/composer.json | 34 +++++++++++++++++++ src/Symfony/Contracts/EventDispatcher/LICENSE | 19 +++++++++++ .../Contracts/EventDispatcher/README.md | 9 +++++ .../Contracts/EventDispatcher/composer.json | 34 +++++++++++++++++++ src/Symfony/Contracts/HttpClient/LICENSE | 19 +++++++++++ src/Symfony/Contracts/HttpClient/README.md | 9 +++++ .../Contracts/HttpClient/composer.json | 33 ++++++++++++++++++ src/Symfony/Contracts/README.md | 16 --------- src/Symfony/Contracts/Service/LICENSE | 19 +++++++++++ src/Symfony/Contracts/Service/README.md | 9 +++++ src/Symfony/Contracts/Service/composer.json | 34 +++++++++++++++++++ src/Symfony/Contracts/Translation/LICENSE | 19 +++++++++++ src/Symfony/Contracts/Translation/README.md | 9 +++++ .../Contracts/Translation/composer.json | 33 ++++++++++++++++++ src/Symfony/Contracts/composer.json | 8 +++++ 17 files changed, 316 insertions(+), 16 deletions(-) create mode 100644 src/Symfony/Contracts/Cache/LICENSE create mode 100644 src/Symfony/Contracts/Cache/README.md create mode 100644 src/Symfony/Contracts/Cache/composer.json create mode 100644 src/Symfony/Contracts/EventDispatcher/LICENSE create mode 100644 src/Symfony/Contracts/EventDispatcher/README.md create mode 100644 src/Symfony/Contracts/EventDispatcher/composer.json create mode 100644 src/Symfony/Contracts/HttpClient/LICENSE create mode 100644 src/Symfony/Contracts/HttpClient/README.md create mode 100644 src/Symfony/Contracts/HttpClient/composer.json create mode 100644 src/Symfony/Contracts/Service/LICENSE create mode 100644 src/Symfony/Contracts/Service/README.md create mode 100644 src/Symfony/Contracts/Service/composer.json create mode 100644 src/Symfony/Contracts/Translation/LICENSE create mode 100644 src/Symfony/Contracts/Translation/README.md create mode 100644 src/Symfony/Contracts/Translation/composer.json diff --git a/src/Symfony/Contracts/Cache/LICENSE b/src/Symfony/Contracts/Cache/LICENSE new file mode 100644 index 0000000000000..3f853aaf35fe1 --- /dev/null +++ b/src/Symfony/Contracts/Cache/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2018-2019 Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/src/Symfony/Contracts/Cache/README.md b/src/Symfony/Contracts/Cache/README.md new file mode 100644 index 0000000000000..58c589e9ea6ed --- /dev/null +++ b/src/Symfony/Contracts/Cache/README.md @@ -0,0 +1,9 @@ +Symfony Cache Contracts +======================= + +A set of abstractions extracted out of the Symfony components. + +Can be used to build on semantics that the Symfony components proved useful - and +that already have battle tested implementations. + +See https://github.com/symfony/contracts/blob/master/README.md for more information. diff --git a/src/Symfony/Contracts/Cache/composer.json b/src/Symfony/Contracts/Cache/composer.json new file mode 100644 index 0000000000000..d5d7e99b9ffef --- /dev/null +++ b/src/Symfony/Contracts/Cache/composer.json @@ -0,0 +1,34 @@ +{ + "name": "symfony/cache-contracts", + "type": "library", + "description": "Generic abstractions related to caching", + "keywords": ["abstractions", "contracts", "decoupling", "interfaces", "interoperability", "standards"], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": "^7.1.3" + }, + "suggest": { + "psr/cache": "", + "symfony/cache-implementation": "" + }, + "autoload": { + "psr-4": { "Symfony\\Contracts\\Cache\\": "" } + }, + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + } +} diff --git a/src/Symfony/Contracts/EventDispatcher/LICENSE b/src/Symfony/Contracts/EventDispatcher/LICENSE new file mode 100644 index 0000000000000..3f853aaf35fe1 --- /dev/null +++ b/src/Symfony/Contracts/EventDispatcher/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2018-2019 Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/src/Symfony/Contracts/EventDispatcher/README.md b/src/Symfony/Contracts/EventDispatcher/README.md new file mode 100644 index 0000000000000..fb051c73fc74e --- /dev/null +++ b/src/Symfony/Contracts/EventDispatcher/README.md @@ -0,0 +1,9 @@ +Symfony EventDispatcher Contracts +================================= + +A set of abstractions extracted out of the Symfony components. + +Can be used to build on semantics that the Symfony components proved useful - and +that already have battle tested implementations. + +See https://github.com/symfony/contracts/blob/master/README.md for more information. diff --git a/src/Symfony/Contracts/EventDispatcher/composer.json b/src/Symfony/Contracts/EventDispatcher/composer.json new file mode 100644 index 0000000000000..55802a491da69 --- /dev/null +++ b/src/Symfony/Contracts/EventDispatcher/composer.json @@ -0,0 +1,34 @@ +{ + "name": "symfony/event-dispatcher-contracts", + "type": "library", + "description": "Generic abstractions related to dispatching event", + "keywords": ["abstractions", "contracts", "decoupling", "interfaces", "interoperability", "standards"], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": "^7.1.3" + }, + "suggest": { + "psr/event-dispatcher": "", + "symfony/event-dispatcher-implementation": "" + }, + "autoload": { + "psr-4": { "Symfony\\Contracts\\EventDispatcher\\": "" } + }, + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + } +} diff --git a/src/Symfony/Contracts/HttpClient/LICENSE b/src/Symfony/Contracts/HttpClient/LICENSE new file mode 100644 index 0000000000000..3f853aaf35fe1 --- /dev/null +++ b/src/Symfony/Contracts/HttpClient/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2018-2019 Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/src/Symfony/Contracts/HttpClient/README.md b/src/Symfony/Contracts/HttpClient/README.md new file mode 100644 index 0000000000000..01f8118949bd8 --- /dev/null +++ b/src/Symfony/Contracts/HttpClient/README.md @@ -0,0 +1,9 @@ +Symfony HttpClient Contracts +============================ + +A set of abstractions extracted out of the Symfony components. + +Can be used to build on semantics that the Symfony components proved useful - and +that already have battle tested implementations. + +See https://github.com/symfony/contracts/blob/master/README.md for more information. diff --git a/src/Symfony/Contracts/HttpClient/composer.json b/src/Symfony/Contracts/HttpClient/composer.json new file mode 100644 index 0000000000000..4dc9b2d38ce1e --- /dev/null +++ b/src/Symfony/Contracts/HttpClient/composer.json @@ -0,0 +1,33 @@ +{ + "name": "symfony/http-client-contracts", + "type": "library", + "description": "Generic abstractions related to HTTP clients", + "keywords": ["abstractions", "contracts", "decoupling", "interfaces", "interoperability", "standards"], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": "^7.1.3" + }, + "suggest": { + "symfony/http-client-implementation": "" + }, + "autoload": { + "psr-4": { "Symfony\\Contracts\\HttpClient\\": "" } + }, + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + } +} diff --git a/src/Symfony/Contracts/README.md b/src/Symfony/Contracts/README.md index 66a465f226d15..480c2a90e7da9 100644 --- a/src/Symfony/Contracts/README.md +++ b/src/Symfony/Contracts/README.md @@ -44,22 +44,6 @@ providing abstractions that are useful on their own while still compatible with implementations provided by Symfony. Although not the main target, we hope that the declared contracts will directly or indirectly contribute to the PHP-FIG. -### Why isn't this package split into several packages? - -Putting all interfaces in one package eases discoverability and dependency -management. Instead of dealing with a myriad of small packages and the -corresponding matrix of versions, you just need to deal with one package and one -version. Also when using IDE autocompletion or just reading the source code, it -makes it easier to figure out which contracts are provided. - -There are two downsides to this approach: you may have unused files in your -`vendor/` directory, and in the future, it will be impossible to use two -different sub-namespaces in different major versions of the package. For the -"unused files" downside, it has no practical consequences: their file sizes are -very small, and there is no performance overhead at all since they are never -loaded. For major versions, this package follows the Symfony BC + deprecation -policies, with an additional restriction to never remove deprecated interfaces. - Resources --------- diff --git a/src/Symfony/Contracts/Service/LICENSE b/src/Symfony/Contracts/Service/LICENSE new file mode 100644 index 0000000000000..3f853aaf35fe1 --- /dev/null +++ b/src/Symfony/Contracts/Service/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2018-2019 Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/src/Symfony/Contracts/Service/README.md b/src/Symfony/Contracts/Service/README.md new file mode 100644 index 0000000000000..d033a439b9a96 --- /dev/null +++ b/src/Symfony/Contracts/Service/README.md @@ -0,0 +1,9 @@ +Symfony Service Contracts +========================= + +A set of abstractions extracted out of the Symfony components. + +Can be used to build on semantics that the Symfony components proved useful - and +that already have battle tested implementations. + +See https://github.com/symfony/contracts/blob/master/README.md for more information. diff --git a/src/Symfony/Contracts/Service/composer.json b/src/Symfony/Contracts/Service/composer.json new file mode 100644 index 0000000000000..0832b82cb1514 --- /dev/null +++ b/src/Symfony/Contracts/Service/composer.json @@ -0,0 +1,34 @@ +{ + "name": "symfony/service-contracts", + "type": "library", + "description": "Generic abstractions related to writting services", + "keywords": ["abstractions", "contracts", "decoupling", "interfaces", "interoperability", "standards"], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": "^7.1.3" + }, + "suggest": { + "psr/container": "", + "symfony/service-implementation": "" + }, + "autoload": { + "psr-4": { "Symfony\\Contracts\\Service\\": "" } + }, + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + } +} diff --git a/src/Symfony/Contracts/Translation/LICENSE b/src/Symfony/Contracts/Translation/LICENSE new file mode 100644 index 0000000000000..3f853aaf35fe1 --- /dev/null +++ b/src/Symfony/Contracts/Translation/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2018-2019 Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/src/Symfony/Contracts/Translation/README.md b/src/Symfony/Contracts/Translation/README.md new file mode 100644 index 0000000000000..6c693ce0b35ff --- /dev/null +++ b/src/Symfony/Contracts/Translation/README.md @@ -0,0 +1,9 @@ +Symfony Translation Contracts +============================= + +A set of abstractions extracted out of the Symfony components. + +Can be used to build on semantics that the Symfony components proved useful - and +that already have battle tested implementations. + +See https://github.com/symfony/contracts/blob/master/README.md for more information. diff --git a/src/Symfony/Contracts/Translation/composer.json b/src/Symfony/Contracts/Translation/composer.json new file mode 100644 index 0000000000000..09749d35f585a --- /dev/null +++ b/src/Symfony/Contracts/Translation/composer.json @@ -0,0 +1,33 @@ +{ + "name": "symfony/translation-contracts", + "type": "library", + "description": "Generic abstractions related to translation", + "keywords": ["abstractions", "contracts", "decoupling", "interfaces", "interoperability", "standards"], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": "^7.1.3" + }, + "suggest": { + "symfony/translation-implementation": "" + }, + "autoload": { + "psr-4": { "Symfony\\Contracts\\Translation\\": "" } + }, + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + } +} diff --git a/src/Symfony/Contracts/composer.json b/src/Symfony/Contracts/composer.json index 0011480949423..f78ba697db26e 100644 --- a/src/Symfony/Contracts/composer.json +++ b/src/Symfony/Contracts/composer.json @@ -23,9 +23,17 @@ "psr/container": "^1.0", "symfony/polyfill-intl-idn": "^1.10" }, + "replace": { + "symfony/cache-contracts": "self.version", + "symfony/event-dispatcher-contracts": "self.version", + "symfony/http-client-contracts": "self.version", + "symfony/service-contracts": "self.version", + "symfony/translation-contracts": "self.version" + }, "suggest": { "psr/cache": "When using the Cache contracts", "psr/container": "When using the Service contracts", + "psr/event-dispatcher": "When using the EventDispatcher contracts", "symfony/cache-implementation": "", "symfony/event-dispatcher-implementation": "", "symfony/http-client-implementation": "", From 6b9ee1e1c569f61d1a871671c9e2d1cdffea217b Mon Sep 17 00:00:00 2001 From: mshavliuk Date: Wed, 22 May 2019 02:21:35 +0300 Subject: [PATCH 06/47] [Process] Fix infinite waiting for stopped process --- src/Symfony/Component/Process/Process.php | 1 + .../Process/Tests/ErrorProcessInitiator.php | 36 +++++++++++++++++++ .../Component/Process/Tests/ProcessTest.php | 9 +++++ 3 files changed, 46 insertions(+) create mode 100755 src/Symfony/Component/Process/Tests/ErrorProcessInitiator.php diff --git a/src/Symfony/Component/Process/Process.php b/src/Symfony/Component/Process/Process.php index 75395b66c587e..68cc6c65ae5a9 100644 --- a/src/Symfony/Component/Process/Process.php +++ b/src/Symfony/Component/Process/Process.php @@ -427,6 +427,7 @@ public function wait(callable $callback = null) } while ($running); while ($this->isRunning()) { + $this->checkTimeout(); usleep(1000); } diff --git a/src/Symfony/Component/Process/Tests/ErrorProcessInitiator.php b/src/Symfony/Component/Process/Tests/ErrorProcessInitiator.php new file mode 100755 index 0000000000000..c37aeb5c8ffd9 --- /dev/null +++ b/src/Symfony/Component/Process/Tests/ErrorProcessInitiator.php @@ -0,0 +1,36 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Process\Tests; + +use Symfony\Component\Process\Exception\ProcessTimedOutException; +use Symfony\Component\Process\Process; + +require \dirname(__DIR__).'/vendor/autoload.php'; + +list('e' => $php) = getopt('e:') + ['e' => 'php']; + +try { + $process = new Process("exec $php -r \"echo 'ready'; trigger_error('error', E_USER_ERROR);\""); + $process->start(); + $process->setTimeout(0.5); + while (false === strpos($process->getOutput(), 'ready')) { + usleep(1000); + } + $process->signal(SIGSTOP); + $process->wait(); + + return $process->getExitCode(); +} catch (ProcessTimedOutException $t) { + echo $t->getMessage().PHP_EOL; + + return 1; +} diff --git a/src/Symfony/Component/Process/Tests/ProcessTest.php b/src/Symfony/Component/Process/Tests/ProcessTest.php index a9ecbe8043f64..18fef4ff5ff17 100644 --- a/src/Symfony/Component/Process/Tests/ProcessTest.php +++ b/src/Symfony/Component/Process/Tests/ProcessTest.php @@ -1551,6 +1551,15 @@ public function testEnvArgument() $this->assertSame($env, $p->getEnv()); } + public function testWaitStoppedDeadProcess() + { + $process = $this->getProcess(self::$phpBin.' '.__DIR__.'/ErrorProcessInitiator.php -e '.self::$phpBin); + $process->start(); + $process->setTimeout(2); + $process->wait(); + $this->assertFalse($process->isRunning()); + } + /** * @param string $commandline * @param string|null $cwd From 67fbae1dbf74b00e9157b75a900744a0da3574f4 Mon Sep 17 00:00:00 2001 From: Farid Jalilov Date: Fri, 10 May 2019 14:20:45 +0400 Subject: [PATCH 07/47] [Mime][HttpFoundation] Added mime type audio/x-hx-aac-adts --- .../File/MimeType/MimeTypeExtensionGuesser.php | 1 + src/Symfony/Component/Mime/MimeTypes.php | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeExtensionGuesser.php b/src/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeExtensionGuesser.php index 55cf7d3f18199..651be070e122b 100644 --- a/src/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeExtensionGuesser.php +++ b/src/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeExtensionGuesser.php @@ -645,6 +645,7 @@ class MimeTypeExtensionGuesser implements ExtensionGuesserInterface 'audio/x-aiff' => 'aif', 'audio/x-caf' => 'caf', 'audio/x-flac' => 'flac', + 'audio/x-hx-aac-adts' => 'aac', 'audio/x-matroska' => 'mka', 'audio/x-mpegurl' => 'm3u', 'audio/x-ms-wax' => 'wax', diff --git a/src/Symfony/Component/Mime/MimeTypes.php b/src/Symfony/Component/Mime/MimeTypes.php index eefe1124f6d71..eea75fa2df28a 100644 --- a/src/Symfony/Component/Mime/MimeTypes.php +++ b/src/Symfony/Component/Mime/MimeTypes.php @@ -1157,6 +1157,7 @@ public function guessMimeType(string $path): ?string 'audio/x-flac' => ['flac'], 'audio/x-flac+ogg' => ['oga', 'ogg'], 'audio/x-gsm' => ['gsm'], + 'audio/x-hx-aac-adts' => ['aac', 'adts', 'ass'], 'audio/x-imelody' => ['imy', 'ime'], 'audio/x-iriver-pla' => ['pla'], 'audio/x-it' => ['it'], @@ -1631,7 +1632,7 @@ public function guessMimeType(string $path): ?string 'a78' => ['application/x-atari-7800-rom'], 'aa' => ['audio/vnd.audible', 'audio/vnd.audible.aax', 'audio/x-pn-audibleaudio'], 'aab' => ['application/x-authorware-bin'], - 'aac' => ['audio/aac', 'audio/x-aac'], + 'aac' => ['audio/aac', 'audio/x-aac', 'audio/x-hx-aac-adts'], 'aam' => ['application/x-authorware-map'], 'aas' => ['application/x-authorware-seg'], 'aax' => ['audio/vnd.audible', 'audio/vnd.audible.aax', 'audio/x-pn-audibleaudio'], @@ -1648,7 +1649,7 @@ public function guessMimeType(string $path): ?string 'adf' => ['application/x-amiga-disk-format'], 'adp' => ['audio/adpcm'], 'ads' => ['text/x-adasrc'], - 'adts' => ['audio/aac', 'audio/x-aac'], + 'adts' => ['audio/aac', 'audio/x-aac', 'audio/x-hx-aac-adts'], 'aep' => ['application/vnd.audiograph'], 'afm' => ['application/x-font-afm', 'application/x-font-type1'], 'afp' => ['application/vnd.ibm.modcap'], @@ -1687,7 +1688,7 @@ public function guessMimeType(string $path): ?string 'asm' => ['text/x-asm'], 'aso' => ['application/vnd.accpac.simply.aso'], 'asp' => ['application/x-asp'], - 'ass' => ['audio/aac', 'audio/x-aac', 'text/x-ssa'], + 'ass' => ['audio/aac', 'audio/x-aac', 'audio/x-hx-aac-adts', 'text/x-ssa'], 'asx' => ['application/x-ms-asx', 'audio/x-ms-asx', 'video/x-ms-asf', 'video/x-ms-wax', 'video/x-ms-wmx', 'video/x-ms-wvx'], 'atc' => ['application/vnd.acucorp'], 'atom' => ['application/atom+xml'], From 721915f8ec3b4ae8bf9bfc37ee7ddc03dd6d3a16 Mon Sep 17 00:00:00 2001 From: Amrouche Hamza Date: Wed, 22 May 2019 18:32:44 +0200 Subject: [PATCH 08/47] minor: fix phpdocs in the ldap component --- src/Symfony/Component/Ldap/Exception/ConnectionException.php | 2 +- .../Component/Ldap/Exception/DriverNotFoundException.php | 2 +- src/Symfony/Component/Ldap/Exception/LdapException.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Component/Ldap/Exception/ConnectionException.php b/src/Symfony/Component/Ldap/Exception/ConnectionException.php index cded4cf2a389a..7fa8e89f6f4a2 100644 --- a/src/Symfony/Component/Ldap/Exception/ConnectionException.php +++ b/src/Symfony/Component/Ldap/Exception/ConnectionException.php @@ -12,7 +12,7 @@ namespace Symfony\Component\Ldap\Exception; /** - * ConnectionException is throw if binding to ldap can not be established. + * ConnectionException is thrown if binding to ldap can not be established. * * @author Grégoire Pineau */ diff --git a/src/Symfony/Component/Ldap/Exception/DriverNotFoundException.php b/src/Symfony/Component/Ldap/Exception/DriverNotFoundException.php index 40258435bb6a7..382cdf5ca6686 100644 --- a/src/Symfony/Component/Ldap/Exception/DriverNotFoundException.php +++ b/src/Symfony/Component/Ldap/Exception/DriverNotFoundException.php @@ -12,7 +12,7 @@ namespace Symfony\Component\Ldap\Exception; /** - * LdapException is throw if php ldap module is not loaded. + * LdapException is thrown if php ldap module is not loaded. * * @author Charles Sarrazin */ diff --git a/src/Symfony/Component/Ldap/Exception/LdapException.php b/src/Symfony/Component/Ldap/Exception/LdapException.php index 4045f32cf44b5..df8eabfbcba88 100644 --- a/src/Symfony/Component/Ldap/Exception/LdapException.php +++ b/src/Symfony/Component/Ldap/Exception/LdapException.php @@ -12,7 +12,7 @@ namespace Symfony\Component\Ldap\Exception; /** - * LdapException is throw if php ldap module is not loaded. + * LdapException is thrown if php ldap module is not loaded. * * @author Grégoire Pineau */ From 93c2412652bc1ab5725764446c0faf79fa5bc7f9 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Wed, 22 May 2019 20:38:35 +0200 Subject: [PATCH 09/47] [FrameworkBundle] improve cs --- .../FrameworkBundle/DependencyInjection/FrameworkExtension.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index cee4b1d2883fa..755566f45bdfa 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -1671,7 +1671,7 @@ private function registerCacheConfiguration(array $config, ContainerBuilder $con } if ($pool['tags']) { - if ($config['pools'][$pool['tags']]['tags'] ?? false) { + if (true !== $pool['tags'] && ($config['pools'][$pool['tags']]['tags'] ?? false)) { $pool['tags'] = '.'.$pool['tags'].'.inner'; } $container->register($name, TagAwareAdapter::class) From 257f3f176e306f563eb49341e190d50bd443b6f1 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Wed, 22 May 2019 20:58:27 +0200 Subject: [PATCH 10/47] [Cache] improve logged messages --- .../Component/Cache/Adapter/AbstractTagAwareAdapter.php | 3 ++- .../Component/Cache/Adapter/RedisTagAwareAdapter.php | 2 +- src/Symfony/Component/Cache/Simple/AbstractCache.php | 9 +++++---- .../Component/Cache/Traits/AbstractAdapterTrait.php | 6 +++--- src/Symfony/Component/Cache/Traits/AbstractTrait.php | 7 ++++--- src/Symfony/Component/Cache/Traits/ArrayTrait.php | 6 +++--- 6 files changed, 18 insertions(+), 15 deletions(-) diff --git a/src/Symfony/Component/Cache/Adapter/AbstractTagAwareAdapter.php b/src/Symfony/Component/Cache/Adapter/AbstractTagAwareAdapter.php index 1f922d0fbd5cb..2eb5ce8c6ea54 100644 --- a/src/Symfony/Component/Cache/Adapter/AbstractTagAwareAdapter.php +++ b/src/Symfony/Component/Cache/Adapter/AbstractTagAwareAdapter.php @@ -253,7 +253,8 @@ public function deleteItems(array $keys) } } catch (\Exception $e) { } - CacheItem::log($this->logger, 'Failed to delete key "{key}"', ['key' => $key, 'exception' => $e]); + $message = 'Failed to delete key "{key}"'.($e instanceof \Exception ? ': '.$e->getMessage() : '.'); + CacheItem::log($this->logger, $message, ['key' => $key, 'exception' => $e]); $ok = false; } diff --git a/src/Symfony/Component/Cache/Adapter/RedisTagAwareAdapter.php b/src/Symfony/Component/Cache/Adapter/RedisTagAwareAdapter.php index d4ee186789a31..4e093872138fb 100644 --- a/src/Symfony/Component/Cache/Adapter/RedisTagAwareAdapter.php +++ b/src/Symfony/Component/Cache/Adapter/RedisTagAwareAdapter.php @@ -198,7 +198,7 @@ private function redisServerSupportSPOP(): bool $info = $host->info('Server'); $info = isset($info['Server']) ? $info['Server'] : $info; if (version_compare($info['redis_version'], '3.2', '<')) { - CacheItem::log($this->logger, 'Redis server needs to be version 3.2 or higher, your Redis server was detected as {version}', ['version' => $info['redis_version']]); + CacheItem::log($this->logger, 'Redis server needs to be version 3.2 or higher, your Redis server was detected as '.$info['redis_version']); return $this->redisServerSupportSPOP = false; } diff --git a/src/Symfony/Component/Cache/Simple/AbstractCache.php b/src/Symfony/Component/Cache/Simple/AbstractCache.php index 29fbd7719ecb8..312a7dbfd0d6e 100644 --- a/src/Symfony/Component/Cache/Simple/AbstractCache.php +++ b/src/Symfony/Component/Cache/Simple/AbstractCache.php @@ -56,7 +56,7 @@ public function get($key, $default = null) return $value; } } catch (\Exception $e) { - CacheItem::log($this->logger, 'Failed to fetch key "{key}"', ['key' => $key, 'exception' => $e]); + CacheItem::log($this->logger, 'Failed to fetch key "{key}": '.$e->getMessage(), ['key' => $key, 'exception' => $e]); } return $default; @@ -90,7 +90,7 @@ public function getMultiple($keys, $default = null) try { $values = $this->doFetch($ids); } catch (\Exception $e) { - CacheItem::log($this->logger, 'Failed to fetch requested values', ['keys' => $keys, 'exception' => $e]); + CacheItem::log($this->logger, 'Failed to fetch values: '.$e->getMessage(), ['keys' => $keys, 'exception' => $e]); $values = []; } $ids = array_combine($ids, $keys); @@ -129,7 +129,8 @@ public function setMultiple($values, $ttl = null) foreach (\is_array($e) ? $e : array_keys($valuesById) as $id) { $keys[] = substr($id, \strlen($this->namespace)); } - CacheItem::log($this->logger, 'Failed to save values', ['keys' => $keys, 'exception' => $e instanceof \Exception ? $e : null]); + $message = 'Failed to save values'.($e instanceof \Exception ? ': '.$e->getMessage() : '.'); + CacheItem::log($this->logger, $message, ['keys' => $keys, 'exception' => $e instanceof \Exception ? $e : null]); return false; } @@ -175,7 +176,7 @@ private function generateValues($values, &$keys, $default) yield $key => $value; } } catch (\Exception $e) { - CacheItem::log($this->logger, 'Failed to fetch requested values', ['keys' => array_values($keys), 'exception' => $e]); + CacheItem::log($this->logger, 'Failed to fetch values: '.$e->getMessage(), ['keys' => array_values($keys), 'exception' => $e]); } foreach ($keys as $key) { diff --git a/src/Symfony/Component/Cache/Traits/AbstractAdapterTrait.php b/src/Symfony/Component/Cache/Traits/AbstractAdapterTrait.php index f1d97abf2d2f8..eb464c319eff1 100644 --- a/src/Symfony/Component/Cache/Traits/AbstractAdapterTrait.php +++ b/src/Symfony/Component/Cache/Traits/AbstractAdapterTrait.php @@ -52,7 +52,7 @@ public function getItem($key) $isHit = true; } } catch (\Exception $e) { - CacheItem::log($this->logger, 'Failed to fetch key "{key}"', ['key' => $key, 'exception' => $e]); + CacheItem::log($this->logger, 'Failed to fetch key "{key}": '.$e->getMessage(), ['key' => $key, 'exception' => $e]); } return $f($key, $value, $isHit); @@ -74,7 +74,7 @@ public function getItems(array $keys = []) try { $items = $this->doFetch($ids); } catch (\Exception $e) { - CacheItem::log($this->logger, 'Failed to fetch requested items', ['keys' => $keys, 'exception' => $e]); + CacheItem::log($this->logger, 'Failed to fetch items: '.$e->getMessage(), ['keys' => $keys, 'exception' => $e]); $items = []; } $ids = array_combine($ids, $keys); @@ -129,7 +129,7 @@ private function generateItems($items, &$keys) yield $key => $f($key, $value, true); } } catch (\Exception $e) { - CacheItem::log($this->logger, 'Failed to fetch requested items', ['keys' => array_values($keys), 'exception' => $e]); + CacheItem::log($this->logger, 'Failed to fetch items: '.$e->getMessage(), ['keys' => array_values($keys), 'exception' => $e]); } foreach ($keys as $key) { diff --git a/src/Symfony/Component/Cache/Traits/AbstractTrait.php b/src/Symfony/Component/Cache/Traits/AbstractTrait.php index 2553ea75cb6a0..1d6c189c814c4 100644 --- a/src/Symfony/Component/Cache/Traits/AbstractTrait.php +++ b/src/Symfony/Component/Cache/Traits/AbstractTrait.php @@ -94,7 +94,7 @@ public function hasItem($key) try { return $this->doHave($id); } catch (\Exception $e) { - CacheItem::log($this->logger, 'Failed to check if key "{key}" is cached', ['key' => $key, 'exception' => $e]); + CacheItem::log($this->logger, 'Failed to check if key "{key}" is cached: '.$e->getMessage(), ['key' => $key, 'exception' => $e]); return false; } @@ -122,7 +122,7 @@ public function clear() try { return $this->doClear($this->namespace) || $cleared; } catch (\Exception $e) { - CacheItem::log($this->logger, 'Failed to clear the cache', ['exception' => $e]); + CacheItem::log($this->logger, 'Failed to clear the cache: '.$e->getMessage(), ['exception' => $e]); return false; } @@ -166,7 +166,8 @@ public function deleteItems(array $keys) } } catch (\Exception $e) { } - CacheItem::log($this->logger, 'Failed to delete key "{key}"', ['key' => $key, 'exception' => $e]); + $message = 'Failed to delete key "{key}"'.($e instanceof \Exception ? ': '.$e->getMessage() : '.'); + CacheItem::log($this->logger, $message, ['key' => $key, 'exception' => $e]); $ok = false; } diff --git a/src/Symfony/Component/Cache/Traits/ArrayTrait.php b/src/Symfony/Component/Cache/Traits/ArrayTrait.php index 182c74159edc0..8ae9cad59b1ae 100644 --- a/src/Symfony/Component/Cache/Traits/ArrayTrait.php +++ b/src/Symfony/Component/Cache/Traits/ArrayTrait.php @@ -128,8 +128,8 @@ private function freeze($value, $key) $serialized = serialize($value); } catch (\Exception $e) { $type = \is_object($value) ? \get_class($value) : \gettype($value); - $message = sprintf('Failed to save key "{key}" of type %s%s', $type, $e instanceof \Exception ? ': '.$e->getMessage() : '.'); - CacheItem::log($this->logger, $message, ['key' => substr($id, \strlen($this->namespace)), 'exception' => $e instanceof \Exception ? $e : null]); + $message = sprintf('Failed to save key "{key}" of type %s: %s', $type, $e->getMessage()); + CacheItem::log($this->logger, $message, ['key' => substr($id, \strlen($this->namespace)), 'exception' => $e]); return; } @@ -151,7 +151,7 @@ private function unfreeze(string $key, bool &$isHit) try { $value = unserialize($value); } catch (\Exception $e) { - CacheItem::log($this->logger, 'Failed to unserialize key "{key}"', ['key' => $key, 'exception' => $e]); + CacheItem::log($this->logger, 'Failed to unserialize key "{key}": '.$e->getMessage(), ['key' => $key, 'exception' => $e]); $value = false; } if (false === $value) { From d9082c2ae42f73db36c7c938dd639f9bce22d99d Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Wed, 22 May 2019 21:16:22 +0200 Subject: [PATCH 11/47] [FrameworkBundle] fix named autowiring aliases for TagAwareCacheInterface --- .../FrameworkExtension.php | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index f49e337a39622..9f90cac520f15 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -117,6 +117,7 @@ use Symfony\Component\Yaml\Command\LintCommand as BaseYamlLintCommand; use Symfony\Component\Yaml\Yaml; use Symfony\Contracts\Cache\CacheInterface; +use Symfony\Contracts\Cache\TagAwareCacheInterface; use Symfony\Contracts\HttpClient\HttpClientInterface; use Symfony\Contracts\Service\ResetInterface; use Symfony\Contracts\Service\ServiceSubscriberInterface; @@ -1819,10 +1820,6 @@ private function registerCacheConfiguration(array $config, ContainerBuilder $con $pool['adapter'] = '.'.$pool['adapter'].'.inner'; } $definition = new ChildDefinition($pool['adapter']); - if (!\in_array($name, ['cache.app', 'cache.system'], true)) { - $container->registerAliasForArgument($name, CacheInterface::class); - $container->registerAliasForArgument($name, CacheItemPoolInterface::class); - } if ($pool['tags']) { if ($config['pools'][$pool['tags']]['tags'] ?? false) { @@ -1837,7 +1834,21 @@ private function registerCacheConfiguration(array $config, ContainerBuilder $con $pool['name'] = $name; $pool['public'] = false; $name = '.'.$name.'.inner'; + + if (!\in_array($pool['name'], ['cache.app', 'cache.system'], true)) { + $container->registerAliasForArgument($pool['name'], TagAwareCacheInterface::class); + $container->registerAliasForArgument($name, CacheInterface::class, $pool['name']); + $container->registerAliasForArgument($name, CacheItemPoolInterface::class, $pool['name']); + } + } elseif (!\in_array($name, ['cache.app', 'cache.system'], true)) { + $container->register('.'.$name.'.taggable', TagAwareAdapter::class) + ->addArgument(new Reference($name)) + ; + $container->registerAliasForArgument('.'.$name.'.taggable', TagAwareCacheInterface::class, $name); + $container->registerAliasForArgument($name, CacheInterface::class); + $container->registerAliasForArgument($name, CacheItemPoolInterface::class); } + $definition->setPublic($pool['public']); unset($pool['adapter'], $pool['public'], $pool['tags']); From 3273109cbe67aa4431d4507ba58dcb153c03773e Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Wed, 22 May 2019 17:58:34 +0200 Subject: [PATCH 12/47] [HttpClient] display proper error message on TransportException when curl is used --- .../Component/HttpClient/Exception/HttpExceptionTrait.php | 4 ++-- src/Symfony/Component/HttpClient/Response/CurlResponse.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Component/HttpClient/Exception/HttpExceptionTrait.php b/src/Symfony/Component/HttpClient/Exception/HttpExceptionTrait.php index 3278af9be0d8e..76e650934b134 100644 --- a/src/Symfony/Component/HttpClient/Exception/HttpExceptionTrait.php +++ b/src/Symfony/Component/HttpClient/Exception/HttpExceptionTrait.php @@ -27,7 +27,7 @@ public function __construct(ResponseInterface $response) $this->response = $response; $code = $response->getInfo('http_code'); $url = $response->getInfo('url'); - $message = sprintf('HTTP %d returned for URL "%s".', $code, $url); + $message = sprintf('HTTP %d returned for "%s".', $code, $url); $httpCodeFound = false; $isJson = false; @@ -37,7 +37,7 @@ public function __construct(ResponseInterface $response) break; } - $message = sprintf('%s returned for URL "%s".', $h, $url); + $message = sprintf('%s returned for "%s".', $h, $url); $httpCodeFound = true; } diff --git a/src/Symfony/Component/HttpClient/Response/CurlResponse.php b/src/Symfony/Component/HttpClient/Response/CurlResponse.php index 2a4cd5546ae8a..a54ab6dc20169 100644 --- a/src/Symfony/Component/HttpClient/Response/CurlResponse.php +++ b/src/Symfony/Component/HttpClient/Response/CurlResponse.php @@ -245,7 +245,7 @@ private static function perform(CurlClientState $multi, array &$responses = null while ($info = curl_multi_info_read($multi->handle)) { $multi->handlesActivity[(int) $info['handle']][] = null; - $multi->handlesActivity[(int) $info['handle']][] = \in_array($info['result'], [\CURLE_OK, \CURLE_TOO_MANY_REDIRECTS], true) || (\CURLE_WRITE_ERROR === $info['result'] && 'destruct' === @curl_getinfo($info['handle'], CURLINFO_PRIVATE)) ? null : new TransportException(curl_error($info['handle'])); + $multi->handlesActivity[(int) $info['handle']][] = \in_array($info['result'], [\CURLE_OK, \CURLE_TOO_MANY_REDIRECTS], true) || (\CURLE_WRITE_ERROR === $info['result'] && 'destruct' === @curl_getinfo($info['handle'], CURLINFO_PRIVATE)) ? null : new TransportException(sprintf('%s for"%s".', curl_strerror($info['result']), curl_getinfo($info['handle'], CURLINFO_EFFECTIVE_URL))); } } finally { self::$performing = false; From c67632cd23d3d722891bab09322f259207586cc1 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Thu, 23 May 2019 14:32:47 +0200 Subject: [PATCH 13/47] Don't reference symfony/security --- src/Symfony/Bridge/Doctrine/composer.json | 2 +- src/Symfony/Bridge/Twig/composer.json | 7 +++++-- .../DependencyInjection/FrameworkExtension.php | 2 +- src/Symfony/Bundle/FrameworkBundle/composer.json | 3 +-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/Symfony/Bridge/Doctrine/composer.json b/src/Symfony/Bridge/Doctrine/composer.json index 4dfc1ec787ecb..300f903424adc 100644 --- a/src/Symfony/Bridge/Doctrine/composer.json +++ b/src/Symfony/Bridge/Doctrine/composer.json @@ -33,7 +33,7 @@ "symfony/property-access": "~3.4|~4.0", "symfony/property-info": "~3.4|~4.0", "symfony/proxy-manager-bridge": "~3.4|~4.0", - "symfony/security": "~3.4|~4.0", + "symfony/security-core": "~3.4|~4.0", "symfony/expression-language": "~3.4|~4.0", "symfony/validator": "~3.4|~4.0", "symfony/translation": "~3.4|~4.0", diff --git a/src/Symfony/Bridge/Twig/composer.json b/src/Symfony/Bridge/Twig/composer.json index f26ebd56955ca..026a9003c3c1f 100644 --- a/src/Symfony/Bridge/Twig/composer.json +++ b/src/Symfony/Bridge/Twig/composer.json @@ -34,8 +34,9 @@ "symfony/templating": "~3.4|~4.0", "symfony/translation": "~4.2", "symfony/yaml": "~3.4|~4.0", - "symfony/security": "~3.4|~4.0", "symfony/security-acl": "~2.8|~3.0", + "symfony/security-csrf": "~3.4|~4.0", + "symfony/security-http": "~3.4|~4.0", "symfony/stopwatch": "~3.4|~4.0", "symfony/console": "~3.4|~4.0", "symfony/var-dumper": "~3.4|~4.0", @@ -59,7 +60,9 @@ "symfony/templating": "For using the TwigEngine", "symfony/translation": "For using the TranslationExtension", "symfony/yaml": "For using the YamlExtension", - "symfony/security": "For using the SecurityExtension", + "symfony/security-core": "For using the SecurityExtension", + "symfony/security-csrf": "For using the CsrfExtension", + "symfony/security-http": "For using the LogoutUrlExtension", "symfony/stopwatch": "For using the StopwatchExtension", "symfony/var-dumper": "For using the DumpExtension", "symfony/expression-language": "For using the ExpressionExtension", diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index 9f90cac520f15..6f02c85756842 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -738,7 +738,7 @@ private function registerWorkflowConfiguration(array $config, ContainerBuilder $ } if (!class_exists(Security::class)) { - throw new LogicException('Cannot guard workflows as the Security component is not installed. Try running "composer require symfony/security".'); + throw new LogicException('Cannot guard workflows as the Security component is not installed. Try running "composer require symfony/security-core".'); } $guard = new Definition(Workflow\EventListener\GuardListener::class); diff --git a/src/Symfony/Bundle/FrameworkBundle/composer.json b/src/Symfony/Bundle/FrameworkBundle/composer.json index 1b8ffc1e665dc..12f744c2377e9 100644 --- a/src/Symfony/Bundle/FrameworkBundle/composer.json +++ b/src/Symfony/Bundle/FrameworkBundle/composer.json @@ -38,7 +38,6 @@ "symfony/css-selector": "~3.4|~4.0", "symfony/dom-crawler": "^4.3", "symfony/polyfill-intl-icu": "~1.0", - "symfony/security": "~3.4|~4.0", "symfony/form": "^4.3", "symfony/expression-language": "~3.4|~4.0", "symfony/http-client": "^4.3", @@ -46,8 +45,8 @@ "symfony/messenger": "^4.3", "symfony/mime": "^4.3", "symfony/process": "~3.4|~4.0", - "symfony/security-core": "~3.4|~4.0", "symfony/security-csrf": "~3.4|~4.0", + "symfony/security-http": "~3.4|~4.0", "symfony/serializer": "^4.3", "symfony/stopwatch": "~3.4|~4.0", "symfony/translation": "~4.2", From a1677c78a668b178e72c93f0a26ebcd2c25bf61f Mon Sep 17 00:00:00 2001 From: Matthias Althaus Date: Thu, 23 May 2019 15:37:34 +0200 Subject: [PATCH 14/47] [Translation] Fixed issue with new vs old TranslatorInterface in TranslationDataCollector --- src/Symfony/Component/Translation/DataCollectorTranslator.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Translation/DataCollectorTranslator.php b/src/Symfony/Component/Translation/DataCollectorTranslator.php index 68200a7f45c21..0284b77e9bcd6 100644 --- a/src/Symfony/Component/Translation/DataCollectorTranslator.php +++ b/src/Symfony/Component/Translation/DataCollectorTranslator.php @@ -68,10 +68,10 @@ public function transChoice($id, $number, array $parameters = [], $domain = null { if ($this->translator instanceof TranslatorInterface) { $trans = $this->translator->trans($id, ['%count%' => $number] + $parameters, $domain, $locale); + } else { + $trans = $this->translator->transChoice($id, $number, $parameters, $domain, $locale); } - $trans = $this->translator->transChoice($id, $number, $parameters, $domain, $locale); - $this->collectMessage($locale, $domain, $id, $trans, ['%count%' => $number] + $parameters); return $trans; From 2a9816f0b63b798ec99f3586e763414b03ba00dc Mon Sep 17 00:00:00 2001 From: mmokhi Date: Thu, 23 May 2019 12:47:28 +0200 Subject: [PATCH 15/47] Make tempfile path unique The temp-file that the test currently creates is `/tmp/log`. This may exist on many platforms already (including `platform.sh` app containers). With the proposed patch way the collision will be less likely. Sponsored-by: Platform.sh --- src/Symfony/Component/HttpKernel/Tests/Log/LoggerTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/HttpKernel/Tests/Log/LoggerTest.php b/src/Symfony/Component/HttpKernel/Tests/Log/LoggerTest.php index 7354000b16595..17865203f2c96 100644 --- a/src/Symfony/Component/HttpKernel/Tests/Log/LoggerTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/Log/LoggerTest.php @@ -34,7 +34,7 @@ class LoggerTest extends TestCase protected function setUp() { - $this->tmpFile = sys_get_temp_dir().\DIRECTORY_SEPARATOR.'log'; + $this->tmpFile = tempnam(sys_get_temp_dir(), 'log'); $this->logger = new Logger(LogLevel::DEBUG, $this->tmpFile); } From ce269367305661ac8d32c9e5cce5f07b8ae7ddf2 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Fri, 24 May 2019 10:15:37 +0200 Subject: [PATCH 16/47] [HttpClient] fix test --- .../HttpClient/Tests/CurlHttpClientTest.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Symfony/Component/HttpClient/Tests/CurlHttpClientTest.php b/src/Symfony/Component/HttpClient/Tests/CurlHttpClientTest.php index 0f75d1c359402..630c37b06322f 100644 --- a/src/Symfony/Component/HttpClient/Tests/CurlHttpClientTest.php +++ b/src/Symfony/Component/HttpClient/Tests/CurlHttpClientTest.php @@ -61,14 +61,14 @@ public function log($level, $message, array $context = []) $js->getHeaders(); $expected = [ - 'Request: GET https://http2-push.io/', - 'Queueing pushed response: https://http2-push.io/css/style.css', - 'Queueing pushed response: https://http2-push.io/js/http2-push.js', - 'Response: 200 https://http2-push.io/', - 'Connecting request to pushed response: GET https://http2-push.io/css/style.css', - 'Connecting request to pushed response: GET https://http2-push.io/js/http2-push.js', - 'Response: 200 https://http2-push.io/css/style.css', - 'Response: 200 https://http2-push.io/js/http2-push.js', + 'Request: "GET https://http2-push.io/"', + 'Queueing pushed response: "https://http2-push.io/css/style.css"', + 'Queueing pushed response: "https://http2-push.io/js/http2-push.js"', + 'Response: "200 https://http2-push.io/"', + 'Connecting request to pushed response: "GET https://http2-push.io/css/style.css"', + 'Connecting request to pushed response: "GET https://http2-push.io/js/http2-push.js"', + 'Response: "200 https://http2-push.io/css/style.css"', + 'Response: "200 https://http2-push.io/js/http2-push.js"', ]; $this->assertSame($expected, $logger->logs); } From 9b558fe1856f2cad369df45207baa18905191bb8 Mon Sep 17 00:00:00 2001 From: Saif Eddin G <29315886+azjezz@users.noreply.github.com> Date: Fri, 24 May 2019 13:25:55 +0100 Subject: [PATCH 17/47] [Finder] fix wrong method call casing --- src/Symfony/Component/Finder/Iterator/SortableIterator.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Finder/Iterator/SortableIterator.php b/src/Symfony/Component/Finder/Iterator/SortableIterator.php index 53f8e31c6c429..3c7157adb9258 100644 --- a/src/Symfony/Component/Finder/Iterator/SortableIterator.php +++ b/src/Symfony/Component/Finder/Iterator/SortableIterator.php @@ -39,7 +39,7 @@ public function __construct(\Traversable $iterator, $sort) if (self::SORT_BY_NAME === $sort) { $this->sort = function ($a, $b) { - return strcmp($a->getRealpath() ?: $a->getPathname(), $b->getRealpath() ?: $b->getPathname()); + return strcmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname()); }; } elseif (self::SORT_BY_TYPE === $sort) { $this->sort = function ($a, $b) { @@ -49,7 +49,7 @@ public function __construct(\Traversable $iterator, $sort) return 1; } - return strcmp($a->getRealpath() ?: $a->getPathname(), $b->getRealpath() ?: $b->getPathname()); + return strcmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname()); }; } elseif (self::SORT_BY_ACCESSED_TIME === $sort) { $this->sort = function ($a, $b) { From 288f2b76e30fc7f67cc402596f23279914809f0f Mon Sep 17 00:00:00 2001 From: Saif Eddin G <29315886+azjezz@users.noreply.github.com> Date: Fri, 24 May 2019 13:50:04 +0100 Subject: [PATCH 18/47] [Filesystem] fix wrong method call casing --- src/Symfony/Component/Filesystem/Filesystem.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Filesystem/Filesystem.php b/src/Symfony/Component/Filesystem/Filesystem.php index 9240a215c656b..224fbc5a342ad 100644 --- a/src/Symfony/Component/Filesystem/Filesystem.php +++ b/src/Symfony/Component/Filesystem/Filesystem.php @@ -572,7 +572,7 @@ public function mirror($originDir, $targetDir, \Traversable $iterator = null, $o $targetDirInfo = new \SplFileInfo($targetDir); foreach ($iterator as $file) { - if ($file->getPathName() === $targetDir || $file->getRealPath() === $targetDir || 0 === strpos($file->getRealPath(), $targetDirInfo->getRealPath())) { + if ($file->getPathname() === $targetDir || $file->getRealPath() === $targetDir || 0 === strpos($file->getRealPath(), $targetDirInfo->getRealPath())) { continue; } From 812b0172f46d391512e2633f86512dd9f9a938cf Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Fri, 24 May 2019 16:42:41 +0200 Subject: [PATCH 19/47] [HttpClient] fix handling exceptions thrown before first mock chunk --- src/Symfony/Component/HttpClient/Response/MockResponse.php | 6 ++++-- .../Component/HttpClient/Tests/MockHttpClientTest.php | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Component/HttpClient/Response/MockResponse.php b/src/Symfony/Component/HttpClient/Response/MockResponse.php index df38c7e5bb2ce..04b33a143aa20 100644 --- a/src/Symfony/Component/HttpClient/Response/MockResponse.php +++ b/src/Symfony/Component/HttpClient/Response/MockResponse.php @@ -25,7 +25,9 @@ */ class MockResponse implements ResponseInterface { - use ResponseTrait; + use ResponseTrait { + doDestruct as public __destruct; + } private $body; private $requestOptions = []; @@ -162,8 +164,8 @@ protected static function perform(ClientState $multi, array &$responses): void $offset = 0; $chunk[1]->getStatusCode(); $response->headers = $chunk[1]->getHeaders(false); - $multi->handlesActivity[$id][] = new FirstChunk(); self::readResponse($response, $chunk[0], $chunk[1], $offset); + $multi->handlesActivity[$id][] = new FirstChunk(); } catch (\Throwable $e) { $multi->handlesActivity[$id][] = null; $multi->handlesActivity[$id][] = $e; diff --git a/src/Symfony/Component/HttpClient/Tests/MockHttpClientTest.php b/src/Symfony/Component/HttpClient/Tests/MockHttpClientTest.php index e719428c81581..710d86a258da0 100644 --- a/src/Symfony/Component/HttpClient/Tests/MockHttpClientTest.php +++ b/src/Symfony/Component/HttpClient/Tests/MockHttpClientTest.php @@ -115,7 +115,7 @@ protected function getHttpClient(string $testCase): HttpClientInterface case 'testResolve': $responses[] = new MockResponse($body, ['response_headers' => $headers]); $responses[] = new MockResponse($body, ['response_headers' => $headers]); - $responses[] = $client->request('GET', 'http://symfony.com:8057/'); + $responses[] = new MockResponse((function () { throw new \Exception('Fake connection timeout'); yield ''; })(), ['response_headers' => $headers]); break; case 'testTimeoutOnStream': From 35811ed22dc31a8d1d33c9336615088640e2e068 Mon Sep 17 00:00:00 2001 From: Ricardo de Vries Date: Fri, 24 May 2019 07:33:34 +0200 Subject: [PATCH 20/47] [github] Implement the new security policy. --- .github/SECURITY.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .github/SECURITY.md diff --git a/.github/SECURITY.md b/.github/SECURITY.md new file mode 100644 index 0000000000000..60990950bf039 --- /dev/null +++ b/.github/SECURITY.md @@ -0,0 +1,10 @@ +Security Policy +=============== + +If you found any issues that might have security implications, +please send a report to security[at]symfony.com +DO NOT PUBLISH SECURITY REPORTS PUBLICLY. + +The full [Security Policy][1] is described in the official documentation. + + [1]: https://symfony.com/security From bc3f598bfed62110dd87cf8152a572f1d4e6c9d8 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Fri, 24 May 2019 22:20:57 +0200 Subject: [PATCH 21/47] Allow WrappedListener to describe uncallable listeners. --- .../Component/EventDispatcher/Debug/WrappedListener.php | 4 ++-- .../EventDispatcher/Tests/Debug/WrappedListenerTest.php | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Component/EventDispatcher/Debug/WrappedListener.php b/src/Symfony/Component/EventDispatcher/Debug/WrappedListener.php index 3991c0165fbe2..e047639081c78 100644 --- a/src/Symfony/Component/EventDispatcher/Debug/WrappedListener.php +++ b/src/Symfony/Component/EventDispatcher/Debug/WrappedListener.php @@ -41,7 +41,7 @@ class WrappedListener public function __construct($listener, ?string $name, Stopwatch $stopwatch, EventDispatcherInterface $dispatcher = null) { $this->listener = $listener; - $this->optimizedListener = $listener instanceof \Closure ? $listener : \Closure::fromCallable($listener); + $this->optimizedListener = $listener instanceof \Closure ? $listener : (\is_callable($listener) ? \Closure::fromCallable($listener) : null); $this->stopwatch = $stopwatch; $this->dispatcher = $dispatcher; $this->called = false; @@ -123,7 +123,7 @@ public function __invoke(Event $event, $eventName, EventDispatcherInterface $dis $e = $this->stopwatch->start($this->name, 'event_listener'); - ($this->optimizedListener)($event, $eventName, $dispatcher); + ($this->optimizedListener ?? $this->listener)($event, $eventName, $dispatcher); if ($e->isStarted()) { $e->stop(); diff --git a/src/Symfony/Component/EventDispatcher/Tests/Debug/WrappedListenerTest.php b/src/Symfony/Component/EventDispatcher/Tests/Debug/WrappedListenerTest.php index 56792fe33afb7..75e90120736ec 100644 --- a/src/Symfony/Component/EventDispatcher/Tests/Debug/WrappedListenerTest.php +++ b/src/Symfony/Component/EventDispatcher/Tests/Debug/WrappedListenerTest.php @@ -21,7 +21,7 @@ class WrappedListenerTest extends TestCase /** * @dataProvider provideListenersToDescribe */ - public function testListenerDescription(callable $listener, $expected) + public function testListenerDescription($listener, $expected) { $wrappedListener = new WrappedListener($listener, null, $this->getMockBuilder(Stopwatch::class)->getMock(), $this->getMockBuilder(EventDispatcherInterface::class)->getMock()); @@ -34,6 +34,7 @@ public function provideListenersToDescribe() [new FooListener(), 'Symfony\Component\EventDispatcher\Tests\Debug\FooListener::__invoke'], [[new FooListener(), 'listen'], 'Symfony\Component\EventDispatcher\Tests\Debug\FooListener::listen'], [['Symfony\Component\EventDispatcher\Tests\Debug\FooListener', 'listenStatic'], 'Symfony\Component\EventDispatcher\Tests\Debug\FooListener::listenStatic'], + [['Symfony\Component\EventDispatcher\Tests\Debug\FooListener', 'invalidMethod'], 'Symfony\Component\EventDispatcher\Tests\Debug\FooListener::invalidMethod'], ['var_dump', 'var_dump'], [function () {}, 'closure'], [\Closure::fromCallable([new FooListener(), 'listen']), 'Symfony\Component\EventDispatcher\Tests\Debug\FooListener::listen'], From 4c83f11024552144fb09d7386b68249ccadcd6e2 Mon Sep 17 00:00:00 2001 From: Robin Chalas Date: Sun, 26 May 2019 02:31:08 +0200 Subject: [PATCH 22/47] [Messenger] Fix incorrect error when symfony/serializer is missing --- .../Component/Messenger/Transport/Serialization/Serializer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Messenger/Transport/Serialization/Serializer.php b/src/Symfony/Component/Messenger/Transport/Serialization/Serializer.php index f009fb75518d3..798b9a55262cb 100644 --- a/src/Symfony/Component/Messenger/Transport/Serialization/Serializer.php +++ b/src/Symfony/Component/Messenger/Transport/Serialization/Serializer.php @@ -48,7 +48,7 @@ public function __construct(SymfonySerializerInterface $serializer = null, strin public static function create(): self { if (!class_exists(SymfonySerializer::class)) { - throw new LogicException(sprintf('The default Messenger Serializer requires Symfony\'s Serializer component. Try running "composer require symfony/serializer".')); + throw new LogicException(sprintf('The "%s" class requires Symfony\'s Serializer component. Try running "composer require symfony/serializer" or use "%s" instead.', __CLASS__, PhpSerializer::class)); } $encoders = [new XmlEncoder(), new JsonEncoder()]; From d27bc2a87df822df58524fb57506c9ceb18f1f8f Mon Sep 17 00:00:00 2001 From: Robin Chalas Date: Sat, 25 May 2019 19:07:58 +0200 Subject: [PATCH 23/47] [Messenger] Fix missing auto_setup for RedisTransport --- .../Transport/RedisExt/ConnectionTest.php | 12 +----- .../Transport/RedisExt/Connection.php | 39 +++++++++++++++---- 2 files changed, 34 insertions(+), 17 deletions(-) diff --git a/src/Symfony/Component/Messenger/Tests/Transport/RedisExt/ConnectionTest.php b/src/Symfony/Component/Messenger/Tests/Transport/RedisExt/ConnectionTest.php index 1a602f41f292b..177f6b90384c5 100644 --- a/src/Symfony/Component/Messenger/Tests/Transport/RedisExt/ConnectionTest.php +++ b/src/Symfony/Component/Messenger/Tests/Transport/RedisExt/ConnectionTest.php @@ -42,13 +42,13 @@ public function testFromDsn() public function testFromDsnWithOptions() { $this->assertEquals( - new Connection(['stream' => 'queue', 'group' => 'group1', 'consumer' => 'consumer1'], [ + new Connection(['stream' => 'queue', 'group' => 'group1', 'consumer' => 'consumer1', 'auto_setup' => false], [ 'host' => 'localhost', 'port' => 6379, ], [ 'serializer' => 2, ]), - Connection::fromDsn('redis://localhost/queue/group1/consumer1', ['serializer' => 2]) + Connection::fromDsn('redis://localhost/queue/group1/consumer1', ['serializer' => 2, 'auto_setup' => false]) ); } @@ -117,10 +117,6 @@ public function testGetAfterReject() { $redis = new \Redis(); $connection = Connection::fromDsn('redis://localhost/messenger-rejectthenget', [], $redis); - try { - $connection->setup(); - } catch (TransportException $e) { - } $connection->add('1', []); $connection->add('2', []); @@ -139,10 +135,6 @@ public function testGetNonBlocking() $redis = new \Redis(); $connection = Connection::fromDsn('redis://localhost/messenger-getnonblocking', [], $redis); - try { - $connection->setup(); - } catch (TransportException $e) { - } $this->assertNull($connection->get()); // no message, should return null immediately $connection->add('1', []); diff --git a/src/Symfony/Component/Messenger/Transport/RedisExt/Connection.php b/src/Symfony/Component/Messenger/Transport/RedisExt/Connection.php index b190f3105d5aa..5757f0be7f623 100644 --- a/src/Symfony/Component/Messenger/Transport/RedisExt/Connection.php +++ b/src/Symfony/Component/Messenger/Transport/RedisExt/Connection.php @@ -27,10 +27,18 @@ */ class Connection { + private const DEFAULT_OPTIONS = [ + 'stream' => 'messages', + 'group' => 'symfony', + 'consumer' => 'consumer', + 'auto_setup' => true, + ]; + private $connection; private $stream; private $group; private $consumer; + private $autoSetup; private $couldHavePendingMessages = true; public function __construct(array $configuration, array $connectionCredentials = [], array $redisOptions = [], \Redis $redis = null) @@ -38,9 +46,10 @@ public function __construct(array $configuration, array $connectionCredentials = $this->connection = $redis ?: new \Redis(); $this->connection->connect($connectionCredentials['host'] ?? '127.0.0.1', $connectionCredentials['port'] ?? 6379); $this->connection->setOption(\Redis::OPT_SERIALIZER, $redisOptions['serializer'] ?? \Redis::SERIALIZER_PHP); - $this->stream = $configuration['stream'] ?? '' ?: 'messages'; - $this->group = $configuration['group'] ?? '' ?: 'symfony'; - $this->consumer = $configuration['consumer'] ?? '' ?: 'consumer'; + $this->stream = $configuration['stream'] ?? self::DEFAULT_OPTIONS['stream']; + $this->group = $configuration['group'] ?? self::DEFAULT_OPTIONS['group']; + $this->consumer = $configuration['consumer'] ?? self::DEFAULT_OPTIONS['consumer']; + $this->autoSetup = $configuration['auto_setup'] ?? self::DEFAULT_OPTIONS['auto_setup']; } public static function fromDsn(string $dsn, array $redisOptions = [], \Redis $redis = null): self @@ -51,9 +60,9 @@ public static function fromDsn(string $dsn, array $redisOptions = [], \Redis $re $pathParts = explode('/', $parsedUrl['path'] ?? ''); - $stream = $pathParts[1] ?? ''; - $group = $pathParts[2] ?? ''; - $consumer = $pathParts[3] ?? ''; + $stream = $pathParts[1] ?? null; + $group = $pathParts[2] ?? null; + $consumer = $pathParts[3] ?? null; $connectionCredentials = [ 'host' => $parsedUrl['host'] ?? '127.0.0.1', @@ -64,11 +73,21 @@ public static function fromDsn(string $dsn, array $redisOptions = [], \Redis $re parse_str($parsedUrl['query'], $redisOptions); } - return new self(['stream' => $stream, 'group' => $group, 'consumer' => $consumer], $connectionCredentials, $redisOptions, $redis); + $autoSetup = null; + if (\array_key_exists('auto_setup', $redisOptions)) { + $autoSetup = filter_var($redisOptions['auto_setup'], FILTER_VALIDATE_BOOLEAN); + unset($redisOptions['auto_setup']); + } + + return new self(['stream' => $stream, 'group' => $group, 'consumer' => $consumer, 'auto_setup' => $autoSetup], $connectionCredentials, $redisOptions, $redis); } public function get(): ?array { + if ($this->autoSetup) { + $this->setup(); + } + $messageId = '>'; // will receive new messages if ($this->couldHavePendingMessages) { @@ -141,6 +160,10 @@ public function reject(string $id): void public function add(string $body, array $headers): void { + if ($this->autoSetup) { + $this->setup(); + } + $e = null; try { $added = $this->connection->xadd($this->stream, '*', ['message' => json_encode( @@ -161,5 +184,7 @@ public function setup(): void } catch (\RedisException $e) { throw new TransportException($e->getMessage(), 0, $e); } + + $this->autoSetup = false; } } From ad0619748ee54109c144d16eb99bf14de026c7bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Pineau?= Date: Wed, 22 May 2019 17:27:56 +0200 Subject: [PATCH 24/47] [Workflow] Do not trigger extra guard With this patch, guard are executed only on wanted transitions --- .../Component/Workflow/Tests/WorkflowTest.php | 39 +++++++++++++++++++ src/Symfony/Component/Workflow/Workflow.php | 26 +++++-------- 2 files changed, 49 insertions(+), 16 deletions(-) diff --git a/src/Symfony/Component/Workflow/Tests/WorkflowTest.php b/src/Symfony/Component/Workflow/Tests/WorkflowTest.php index 68ebaafcd9aa1..d6f6bae45cbf1 100644 --- a/src/Symfony/Component/Workflow/Tests/WorkflowTest.php +++ b/src/Symfony/Component/Workflow/Tests/WorkflowTest.php @@ -304,6 +304,45 @@ public function testApplyWithEventDispatcher() $this->assertSame($eventNameExpected, $eventDispatcher->dispatchedEvents); } + public function testApplyDoesNotTriggerExtraGuardWithEventDispatcher() + { + $transitions[] = new Transition('a-b', 'a', 'b'); + $transitions[] = new Transition('a-c', 'a', 'c'); + $definition = new Definition(['a', 'b', 'c'], $transitions); + + $subject = new \stdClass(); + $subject->marking = null; + $eventDispatcher = new EventDispatcherMock(); + $workflow = new Workflow($definition, new MultipleStateMarkingStore(), $eventDispatcher, 'workflow_name'); + + $eventNameExpected = [ + 'workflow.guard', + 'workflow.workflow_name.guard', + 'workflow.workflow_name.guard.a-b', + 'workflow.leave', + 'workflow.workflow_name.leave', + 'workflow.workflow_name.leave.a', + 'workflow.transition', + 'workflow.workflow_name.transition', + 'workflow.workflow_name.transition.a-b', + 'workflow.enter', + 'workflow.workflow_name.enter', + 'workflow.workflow_name.enter.b', + 'workflow.entered', + 'workflow.workflow_name.entered', + 'workflow.workflow_name.entered.b', + 'workflow.completed', + 'workflow.workflow_name.completed', + 'workflow.workflow_name.completed.a-b', + 'workflow.announce', + 'workflow.workflow_name.announce', + ]; + + $marking = $workflow->apply($subject, 'a-b'); + + $this->assertSame($eventNameExpected, $eventDispatcher->dispatchedEvents); + } + public function testEventName() { $definition = $this->createComplexWorkflowDefinition(); diff --git a/src/Symfony/Component/Workflow/Workflow.php b/src/Symfony/Component/Workflow/Workflow.php index a0500b3796bf3..18ca7f7969028 100644 --- a/src/Symfony/Component/Workflow/Workflow.php +++ b/src/Symfony/Component/Workflow/Workflow.php @@ -125,22 +125,20 @@ public function can($subject, $transitionName) */ public function apply($subject, $transitionName) { - $transitions = $this->getEnabledTransitions($subject); - - // We can shortcut the getMarking method in order to boost performance, - // since the "getEnabledTransitions" method already checks the Marking - // state - $marking = $this->markingStore->getMarking($subject); - - $applied = false; + $marking = $this->getMarking($subject); + $transitions = []; - foreach ($transitions as $transition) { - if ($transitionName !== $transition->getName()) { - continue; + foreach ($this->definition->getTransitions() as $transition) { + if ($transitionName === $transition->getName() && $this->doCan($subject, $marking, $transition)) { + $transitions[] = $transition; } + } - $applied = true; + if (!$transitions) { + throw new LogicException(sprintf('Unable to apply transition "%s" for workflow "%s".', $transitionName, $this->name)); + } + foreach ($transitions as $transition) { $this->leave($subject, $transition, $marking); $this->transition($subject, $transition, $marking); @@ -156,10 +154,6 @@ public function apply($subject, $transitionName) $this->announce($subject, $transition, $marking); } - if (!$applied) { - throw new LogicException(sprintf('Unable to apply transition "%s" for workflow "%s".', $transitionName, $this->name)); - } - return $marking; } From 8cbb8f89aded027141c08f1cdcbe4ee4756a527a Mon Sep 17 00:00:00 2001 From: Vincent Touzet Date: Sun, 26 May 2019 16:14:00 +0200 Subject: [PATCH 25/47] [Messenger] Disable the SchemaAssetsFilter when setup the transport --- .../Transport/Doctrine/ConnectionTest.php | 3 +++ .../Transport/Doctrine/Connection.php | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/src/Symfony/Component/Messenger/Tests/Transport/Doctrine/ConnectionTest.php b/src/Symfony/Component/Messenger/Tests/Transport/Doctrine/ConnectionTest.php index 8c4e8fcce9cce..1196be9f081e3 100644 --- a/src/Symfony/Component/Messenger/Tests/Transport/Doctrine/ConnectionTest.php +++ b/src/Symfony/Component/Messenger/Tests/Transport/Doctrine/ConnectionTest.php @@ -108,7 +108,10 @@ private function getDBALConnectionMock() $platform = $this->getMockBuilder(AbstractPlatform::class) ->getMock(); $platform->method('getWriteLockSQL')->willReturn('FOR UPDATE'); + $configuration = $this->getMockBuilder(\Doctrine\DBAL\Configuration::class) + ->getMock(); $driverConnection->method('getDatabasePlatform')->willReturn($platform); + $driverConnection->method('getConfiguration')->willReturn($configuration); return $driverConnection; } diff --git a/src/Symfony/Component/Messenger/Transport/Doctrine/Connection.php b/src/Symfony/Component/Messenger/Transport/Doctrine/Connection.php index 7011295ee81e1..bd528b5b431b0 100644 --- a/src/Symfony/Component/Messenger/Transport/Doctrine/Connection.php +++ b/src/Symfony/Component/Messenger/Transport/Doctrine/Connection.php @@ -197,7 +197,25 @@ public function reject(string $id): bool public function setup(): void { + $configuration = $this->driverConnection->getConfiguration(); + // Since Doctrine 2.9 the getFilterSchemaAssetsExpression is deprecated + $hasFilterCallback = method_exists($configuration, 'getSchemaAssetsFilter'); + + if ($hasFilterCallback) { + $assetFilter = $this->driverConnection->getConfiguration()->getSchemaAssetsFilter(); + $this->driverConnection->getConfiguration()->setSchemaAssetsFilter(null); + } else { + $assetFilter = $this->driverConnection->getConfiguration()->getFilterSchemaAssetsExpression(); + $this->driverConnection->getConfiguration()->setFilterSchemaAssetsExpression(null); + } + $this->schemaSynchronizer->updateSchema($this->getSchema(), true); + + if ($hasFilterCallback) { + $this->driverConnection->getConfiguration()->setSchemaAssetsFilter($assetFilter); + } else { + $this->driverConnection->getConfiguration()->setFilterSchemaAssetsExpression($assetFilter); + } } public function getMessageCount(): int From fbfe2dfa8a573c7a9289951685e9fd3f3baa3b65 Mon Sep 17 00:00:00 2001 From: Robin Chalas Date: Sun, 26 May 2019 22:33:59 +0200 Subject: [PATCH 26/47] [Messenger] Use real memory usage for --memory-limit --- .../Receiver/StopWhenMemoryUsageIsExceededReceiver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Messenger/Transport/Receiver/StopWhenMemoryUsageIsExceededReceiver.php b/src/Symfony/Component/Messenger/Transport/Receiver/StopWhenMemoryUsageIsExceededReceiver.php index 41e0df22bc501..e61fe5937af78 100644 --- a/src/Symfony/Component/Messenger/Transport/Receiver/StopWhenMemoryUsageIsExceededReceiver.php +++ b/src/Symfony/Component/Messenger/Transport/Receiver/StopWhenMemoryUsageIsExceededReceiver.php @@ -32,7 +32,7 @@ public function __construct(ReceiverInterface $decoratedReceiver, int $memoryLim $this->memoryLimit = $memoryLimit; $this->logger = $logger; $this->memoryResolver = $memoryResolver ?: function () { - return \memory_get_usage(); + return \memory_get_usage(true); }; } From ec098d6c5d5e6092ed91e43f34aa9d8942af4234 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20K=C3=A4fer?= Date: Sun, 26 May 2019 22:15:37 +0200 Subject: [PATCH 27/47] Small grammar mistake in documentation --- .../HttpKernel/Controller/ControllerResolverInterface.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/HttpKernel/Controller/ControllerResolverInterface.php b/src/Symfony/Component/HttpKernel/Controller/ControllerResolverInterface.php index afe9fb733748f..95c59036ff3b5 100644 --- a/src/Symfony/Component/HttpKernel/Controller/ControllerResolverInterface.php +++ b/src/Symfony/Component/HttpKernel/Controller/ControllerResolverInterface.php @@ -31,7 +31,7 @@ interface ControllerResolverInterface * As several resolvers can exist for a single application, a resolver must * return false when it is not able to determine the controller. * - * The resolver must only throw an exception when it should be able to load + * The resolver must only throw an exception when it should be able to load a * controller but cannot because of some errors made by the developer. * * @return callable|false A PHP callable representing the Controller, From 34d4fa66e71c3322bf1c5b533375fa0fc3aa9e68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20K=C3=A4fer?= Date: Sun, 26 May 2019 22:50:43 +0200 Subject: [PATCH 28/47] Fixes a small doc blocks syntax error --- src/Symfony/Component/HttpFoundation/Request.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/HttpFoundation/Request.php b/src/Symfony/Component/HttpFoundation/Request.php index ae3f51b1724fc..ea3f460c4692b 100644 --- a/src/Symfony/Component/HttpFoundation/Request.php +++ b/src/Symfony/Component/HttpFoundation/Request.php @@ -2050,7 +2050,7 @@ private function setPhpDefaultLocale($locale) } } - /* + /** * Returns the prefix as encoded in the string when the string starts with * the given prefix, false otherwise. * From 0a640c53cb56a10448c17cc1dc5930f1f29dd18e Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Mon, 27 May 2019 10:08:49 +0200 Subject: [PATCH 29/47] Reference individual contracts packages --- src/Symfony/Bridge/Doctrine/composer.json | 4 ++-- src/Symfony/Bridge/Monolog/composer.json | 2 +- src/Symfony/Bridge/Twig/composer.json | 1 - src/Symfony/Bundle/FrameworkBundle/composer.json | 1 - src/Symfony/Component/Cache/composer.json | 3 ++- src/Symfony/Component/Console/composer.json | 4 ++-- src/Symfony/Component/DependencyInjection/composer.json | 2 +- src/Symfony/Component/EventDispatcher/composer.json | 2 +- src/Symfony/Component/ExpressionLanguage/composer.json | 2 +- src/Symfony/Component/HttpClient/composer.json | 2 +- src/Symfony/Component/HttpKernel/composer.json | 1 - src/Symfony/Component/Security/Core/composer.json | 3 ++- src/Symfony/Component/Security/composer.json | 5 +++-- src/Symfony/Component/Stopwatch/composer.json | 2 +- .../Component/Translation/Tests/IdentityTranslatorTest.php | 2 +- src/Symfony/Component/Translation/composer.json | 4 ++-- src/Symfony/Component/Validator/composer.json | 4 ++-- .../Translation => Translation/Test}/TranslatorTest.php | 2 +- src/Symfony/Contracts/phpunit.xml.dist | 2 ++ 19 files changed, 25 insertions(+), 23 deletions(-) rename src/Symfony/Contracts/{Tests/Translation => Translation/Test}/TranslatorTest.php (99%) diff --git a/src/Symfony/Bridge/Doctrine/composer.json b/src/Symfony/Bridge/Doctrine/composer.json index 300f903424adc..b00634b0de1a0 100644 --- a/src/Symfony/Bridge/Doctrine/composer.json +++ b/src/Symfony/Bridge/Doctrine/composer.json @@ -19,9 +19,9 @@ "php": "^7.1.3", "doctrine/event-manager": "~1.0", "doctrine/persistence": "~1.0", - "symfony/contracts": "^1.0", "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-mbstring": "~1.0" + "symfony/polyfill-mbstring": "~1.0", + "symfony/service-contracts": "^1.1" }, "require-dev": { "symfony/stopwatch": "~3.4|~4.0", diff --git a/src/Symfony/Bridge/Monolog/composer.json b/src/Symfony/Bridge/Monolog/composer.json index 81e7b15cd0e15..e57ae259e9d78 100644 --- a/src/Symfony/Bridge/Monolog/composer.json +++ b/src/Symfony/Bridge/Monolog/composer.json @@ -18,7 +18,7 @@ "require": { "php": "^7.1.3", "monolog/monolog": "~1.19", - "symfony/contracts": "^1.0", + "symfony/service-contracts": "^1.1", "symfony/http-kernel": "^4.3" }, "require-dev": { diff --git a/src/Symfony/Bridge/Twig/composer.json b/src/Symfony/Bridge/Twig/composer.json index 026a9003c3c1f..c16b3ac871176 100644 --- a/src/Symfony/Bridge/Twig/composer.json +++ b/src/Symfony/Bridge/Twig/composer.json @@ -17,7 +17,6 @@ ], "require": { "php": "^7.1.3", - "symfony/contracts": "^1.0.2", "twig/twig": "^1.41|^2.10" }, "require-dev": { diff --git a/src/Symfony/Bundle/FrameworkBundle/composer.json b/src/Symfony/Bundle/FrameworkBundle/composer.json index 12f744c2377e9..bcfdf01fba719 100644 --- a/src/Symfony/Bundle/FrameworkBundle/composer.json +++ b/src/Symfony/Bundle/FrameworkBundle/composer.json @@ -20,7 +20,6 @@ "ext-xml": "*", "symfony/cache": "~4.3", "symfony/config": "~4.2", - "symfony/contracts": "^1.1", "symfony/dependency-injection": "^4.3", "symfony/http-foundation": "^4.3", "symfony/http-kernel": "^4.3", diff --git a/src/Symfony/Component/Cache/composer.json b/src/Symfony/Component/Cache/composer.json index 098cdadee02d7..05bed1cf75485 100644 --- a/src/Symfony/Component/Cache/composer.json +++ b/src/Symfony/Component/Cache/composer.json @@ -24,7 +24,8 @@ "php": "^7.1.3", "psr/cache": "~1.0", "psr/log": "~1.0", - "symfony/contracts": "^1.0", + "symfony/cache-contracts": "^1.1", + "symfony/service-contracts": "^1.1", "symfony/var-exporter": "^4.2" }, "require-dev": { diff --git a/src/Symfony/Component/Console/composer.json b/src/Symfony/Component/Console/composer.json index b8033b2272fec..5613467fd25a8 100644 --- a/src/Symfony/Component/Console/composer.json +++ b/src/Symfony/Component/Console/composer.json @@ -17,9 +17,9 @@ ], "require": { "php": "^7.1.3", - "symfony/contracts": "^1.1", "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.8" + "symfony/polyfill-php73": "^1.8", + "symfony/service-contracts": "^1.1" }, "require-dev": { "symfony/config": "~3.4|~4.0", diff --git a/src/Symfony/Component/DependencyInjection/composer.json b/src/Symfony/Component/DependencyInjection/composer.json index 282b52ed1f19f..8e19886da1175 100644 --- a/src/Symfony/Component/DependencyInjection/composer.json +++ b/src/Symfony/Component/DependencyInjection/composer.json @@ -18,7 +18,7 @@ "require": { "php": "^7.1.3", "psr/container": "^1.0", - "symfony/contracts": "^1.1" + "symfony/service-contracts": "^1.1" }, "require-dev": { "symfony/yaml": "~3.4|~4.0", diff --git a/src/Symfony/Component/EventDispatcher/composer.json b/src/Symfony/Component/EventDispatcher/composer.json index 6677e2b74f636..f5d1e72b9bd8e 100644 --- a/src/Symfony/Component/EventDispatcher/composer.json +++ b/src/Symfony/Component/EventDispatcher/composer.json @@ -17,7 +17,7 @@ ], "require": { "php": "^7.1.3", - "symfony/contracts": "^1.1" + "symfony/event-dispatcher-contracts": "^1.1" }, "require-dev": { "symfony/dependency-injection": "~3.4|~4.0", diff --git a/src/Symfony/Component/ExpressionLanguage/composer.json b/src/Symfony/Component/ExpressionLanguage/composer.json index 66581371f907f..bcab8160430a3 100644 --- a/src/Symfony/Component/ExpressionLanguage/composer.json +++ b/src/Symfony/Component/ExpressionLanguage/composer.json @@ -18,7 +18,7 @@ "require": { "php": "^7.1.3", "symfony/cache": "~3.4|~4.0", - "symfony/contracts": "^1.0" + "symfony/service-contracts": "^1.1" }, "autoload": { "psr-4": { "Symfony\\Component\\ExpressionLanguage\\": "" }, diff --git a/src/Symfony/Component/HttpClient/composer.json b/src/Symfony/Component/HttpClient/composer.json index b02ae3beea99d..4ffe7bfd82b54 100644 --- a/src/Symfony/Component/HttpClient/composer.json +++ b/src/Symfony/Component/HttpClient/composer.json @@ -21,7 +21,7 @@ "require": { "php": "^7.1.3", "psr/log": "^1.0", - "symfony/contracts": "^1.1", + "symfony/http-client-contracts": "^1.1", "symfony/polyfill-php73": "^1.11" }, "require-dev": { diff --git a/src/Symfony/Component/HttpKernel/composer.json b/src/Symfony/Component/HttpKernel/composer.json index 3edbf79cc32f7..7ddbd2f945cf6 100644 --- a/src/Symfony/Component/HttpKernel/composer.json +++ b/src/Symfony/Component/HttpKernel/composer.json @@ -17,7 +17,6 @@ ], "require": { "php": "^7.1.3", - "symfony/contracts": "^1.1", "symfony/event-dispatcher": "^4.3", "symfony/http-foundation": "^4.1.1", "symfony/debug": "~3.4|~4.0", diff --git a/src/Symfony/Component/Security/Core/composer.json b/src/Symfony/Component/Security/Core/composer.json index 05c1c3dbbe835..f2bbd449677bb 100644 --- a/src/Symfony/Component/Security/Core/composer.json +++ b/src/Symfony/Component/Security/Core/composer.json @@ -17,7 +17,8 @@ ], "require": { "php": "^7.1.3", - "symfony/contracts": "^1.1" + "symfony/event-dispatcher-contracts": "^1.1", + "symfony/service-contracts": "^1.1" }, "require-dev": { "psr/container": "^1.0", diff --git a/src/Symfony/Component/Security/composer.json b/src/Symfony/Component/Security/composer.json index 4f54140b55b43..6365520893de4 100644 --- a/src/Symfony/Component/Security/composer.json +++ b/src/Symfony/Component/Security/composer.json @@ -17,10 +17,11 @@ ], "require": { "php": "^7.1.3", - "symfony/contracts": "^1.1", + "symfony/event-dispatcher-contracts": "^1.1", "symfony/http-foundation": "~3.4|~4.0", "symfony/http-kernel": "^4.3", - "symfony/property-access": "~3.4|~4.0" + "symfony/property-access": "~3.4|~4.0", + "symfony/service-contracts": "^1.1" }, "replace": { "symfony/security-core": "self.version", diff --git a/src/Symfony/Component/Stopwatch/composer.json b/src/Symfony/Component/Stopwatch/composer.json index 2ac6e03e29c2c..68c4d9f2e0db3 100644 --- a/src/Symfony/Component/Stopwatch/composer.json +++ b/src/Symfony/Component/Stopwatch/composer.json @@ -17,7 +17,7 @@ ], "require": { "php": "^7.1.3", - "symfony/contracts": "^1.0" + "symfony/service-contracts": "^1.0" }, "autoload": { "psr-4": { "Symfony\\Component\\Stopwatch\\": "" }, diff --git a/src/Symfony/Component/Translation/Tests/IdentityTranslatorTest.php b/src/Symfony/Component/Translation/Tests/IdentityTranslatorTest.php index be0a548aa1f06..cf618d95a219e 100644 --- a/src/Symfony/Component/Translation/Tests/IdentityTranslatorTest.php +++ b/src/Symfony/Component/Translation/Tests/IdentityTranslatorTest.php @@ -12,7 +12,7 @@ namespace Symfony\Component\Translation\Tests; use Symfony\Component\Translation\IdentityTranslator; -use Symfony\Contracts\Tests\Translation\TranslatorTest; +use Symfony\Contracts\Translation\Test\TranslatorTest; class IdentityTranslatorTest extends TranslatorTest { diff --git a/src/Symfony/Component/Translation/composer.json b/src/Symfony/Component/Translation/composer.json index 2b1b6d84da2a8..e9997ba2901a4 100644 --- a/src/Symfony/Component/Translation/composer.json +++ b/src/Symfony/Component/Translation/composer.json @@ -17,8 +17,8 @@ ], "require": { "php": "^7.1.3", - "symfony/contracts": "^1.0.2", - "symfony/polyfill-mbstring": "~1.0" + "symfony/polyfill-mbstring": "~1.0", + "symfony/translation-contracts": "^1.1" }, "require-dev": { "symfony/config": "~3.4|~4.0", diff --git a/src/Symfony/Component/Validator/composer.json b/src/Symfony/Component/Validator/composer.json index b6eae402a8009..f221cc585f05e 100644 --- a/src/Symfony/Component/Validator/composer.json +++ b/src/Symfony/Component/Validator/composer.json @@ -17,9 +17,9 @@ ], "require": { "php": "^7.1.3", - "symfony/contracts": "^1.0.2", "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-mbstring": "~1.0" + "symfony/polyfill-mbstring": "~1.0", + "symfony/translation-contracts": "^1.1" }, "require-dev": { "symfony/http-client": "^4.3", diff --git a/src/Symfony/Contracts/Tests/Translation/TranslatorTest.php b/src/Symfony/Contracts/Translation/Test/TranslatorTest.php similarity index 99% rename from src/Symfony/Contracts/Tests/Translation/TranslatorTest.php rename to src/Symfony/Contracts/Translation/Test/TranslatorTest.php index ac5f9c7aebe18..48466300b5abf 100644 --- a/src/Symfony/Contracts/Tests/Translation/TranslatorTest.php +++ b/src/Symfony/Contracts/Translation/Test/TranslatorTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Symfony\Contracts\Tests\Translation; +namespace Symfony\Contracts\Translation\Test; use PHPUnit\Framework\TestCase; use Symfony\Contracts\Translation\TranslatorInterface; diff --git a/src/Symfony/Contracts/phpunit.xml.dist b/src/Symfony/Contracts/phpunit.xml.dist index e222d9f5a7ecf..4a9e8f0fc3240 100644 --- a/src/Symfony/Contracts/phpunit.xml.dist +++ b/src/Symfony/Contracts/phpunit.xml.dist @@ -15,6 +15,7 @@ ./Tests/ + ./Translation/Test/ @@ -23,6 +24,7 @@ ./ ./Tests + ./Translation/Test/ ./vendor From b27b4199fc70a798cae0887b83329ab0b054283c Mon Sep 17 00:00:00 2001 From: Chris Wilkinson Date: Mon, 27 May 2019 11:52:29 +0100 Subject: [PATCH 30/47] Fix typo --- src/Symfony/Contracts/Service/composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Contracts/Service/composer.json b/src/Symfony/Contracts/Service/composer.json index 0832b82cb1514..54341174ceb98 100644 --- a/src/Symfony/Contracts/Service/composer.json +++ b/src/Symfony/Contracts/Service/composer.json @@ -1,7 +1,7 @@ { "name": "symfony/service-contracts", "type": "library", - "description": "Generic abstractions related to writting services", + "description": "Generic abstractions related to writing services", "keywords": ["abstractions", "contracts", "decoupling", "interfaces", "interoperability", "standards"], "homepage": "https://symfony.com", "license": "MIT", From b6ff836a4925ad2c320b1f0e61f0591696a5d8d7 Mon Sep 17 00:00:00 2001 From: Andrii Popov Date: Mon, 27 May 2019 21:45:58 +0300 Subject: [PATCH 31/47] fix typo --- .../Component/HttpKernel/EventListener/FragmentListener.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/HttpKernel/EventListener/FragmentListener.php b/src/Symfony/Component/HttpKernel/EventListener/FragmentListener.php index 1333120e2dd10..997f260d334ee 100644 --- a/src/Symfony/Component/HttpKernel/EventListener/FragmentListener.php +++ b/src/Symfony/Component/HttpKernel/EventListener/FragmentListener.php @@ -24,7 +24,7 @@ * All URL paths starting with /_fragment are handled as * content fragments by this listener. * - * If throws an AccessDeniedHttpException exception if the request + * Throws an AccessDeniedHttpException exception if the request * is not signed or if it is not an internal sub-request. * * @author Fabien Potencier From 4bd85343e6487b728faaafd628b9eb65621bb0af Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 27 May 2019 21:38:51 +0200 Subject: [PATCH 32/47] [Messenger] Use real memory usage for --memory-limit --- .../Messenger/Worker/StopWhenMemoryUsageIsExceededWorker.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Messenger/Worker/StopWhenMemoryUsageIsExceededWorker.php b/src/Symfony/Component/Messenger/Worker/StopWhenMemoryUsageIsExceededWorker.php index 77e848898234d..293e6a5e9dcd1 100644 --- a/src/Symfony/Component/Messenger/Worker/StopWhenMemoryUsageIsExceededWorker.php +++ b/src/Symfony/Component/Messenger/Worker/StopWhenMemoryUsageIsExceededWorker.php @@ -33,7 +33,7 @@ public function __construct(WorkerInterface $decoratedWorker, int $memoryLimit, $this->memoryLimit = $memoryLimit; $this->logger = $logger; $this->memoryResolver = $memoryResolver ?: function () { - return \memory_get_usage(); + return \memory_get_usage(true); }; } From cfeb5bee072b419d2a034685edff6fa7e4922d7c Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 28 May 2019 09:50:59 +0200 Subject: [PATCH 33/47] fix tests --- src/Symfony/Bridge/Twig/composer.json | 2 +- .../Component/DependencyInjection/Tests/ServiceLocatorTest.php | 2 +- src/Symfony/Component/DependencyInjection/composer.json | 2 +- src/Symfony/Component/EventDispatcher/composer.json | 1 + src/Symfony/Component/HttpKernel/composer.json | 1 + src/Symfony/Component/Mailer/composer.json | 1 + src/Symfony/Component/Messenger/composer.json | 1 + src/Symfony/Component/Translation/composer.json | 2 +- .../{Tests/Service => Service/Test}/ServiceLocatorTest.php | 2 +- src/Symfony/Contracts/phpunit.xml.dist | 2 ++ 10 files changed, 11 insertions(+), 5 deletions(-) rename src/Symfony/Contracts/{Tests/Service => Service/Test}/ServiceLocatorTest.php (98%) diff --git a/src/Symfony/Bridge/Twig/composer.json b/src/Symfony/Bridge/Twig/composer.json index c16b3ac871176..c5dbb1247a07c 100644 --- a/src/Symfony/Bridge/Twig/composer.json +++ b/src/Symfony/Bridge/Twig/composer.json @@ -31,7 +31,7 @@ "symfony/polyfill-intl-icu": "~1.0", "symfony/routing": "~3.4|~4.0", "symfony/templating": "~3.4|~4.0", - "symfony/translation": "~4.2", + "symfony/translation": "^4.2.1", "symfony/yaml": "~3.4|~4.0", "symfony/security-acl": "~2.8|~3.0", "symfony/security-csrf": "~3.4|~4.0", diff --git a/src/Symfony/Component/DependencyInjection/Tests/ServiceLocatorTest.php b/src/Symfony/Component/DependencyInjection/Tests/ServiceLocatorTest.php index eb43029696f8c..2d3092ae0de87 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/ServiceLocatorTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/ServiceLocatorTest.php @@ -14,7 +14,7 @@ use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\ServiceLocator; use Symfony\Contracts\Service\ServiceSubscriberInterface; -use Symfony\Contracts\Tests\Service\ServiceLocatorTest as BaseServiceLocatorTest; +use Symfony\Contracts\Service\Test\ServiceLocatorTest as BaseServiceLocatorTest; class ServiceLocatorTest extends BaseServiceLocatorTest { diff --git a/src/Symfony/Component/DependencyInjection/composer.json b/src/Symfony/Component/DependencyInjection/composer.json index 8e19886da1175..d5182ab7a8a3a 100644 --- a/src/Symfony/Component/DependencyInjection/composer.json +++ b/src/Symfony/Component/DependencyInjection/composer.json @@ -18,7 +18,7 @@ "require": { "php": "^7.1.3", "psr/container": "^1.0", - "symfony/service-contracts": "^1.1" + "symfony/service-contracts": "^1.1.2" }, "require-dev": { "symfony/yaml": "~3.4|~4.0", diff --git a/src/Symfony/Component/EventDispatcher/composer.json b/src/Symfony/Component/EventDispatcher/composer.json index f5d1e72b9bd8e..8449c4785d93a 100644 --- a/src/Symfony/Component/EventDispatcher/composer.json +++ b/src/Symfony/Component/EventDispatcher/composer.json @@ -24,6 +24,7 @@ "symfony/expression-language": "~3.4|~4.0", "symfony/config": "~3.4|~4.0", "symfony/http-foundation": "^3.4|^4.0", + "symfony/service-contracts": "^1.1", "symfony/stopwatch": "~3.4|~4.0", "psr/log": "~1.0" }, diff --git a/src/Symfony/Component/HttpKernel/composer.json b/src/Symfony/Component/HttpKernel/composer.json index 7ddbd2f945cf6..e07b453b48113 100644 --- a/src/Symfony/Component/HttpKernel/composer.json +++ b/src/Symfony/Component/HttpKernel/composer.json @@ -38,6 +38,7 @@ "symfony/stopwatch": "~3.4|~4.0", "symfony/templating": "~3.4|~4.0", "symfony/translation": "~4.2", + "symfony/translation-contracts": "^1.1", "symfony/var-dumper": "^4.1.1", "psr/cache": "~1.0", "twig/twig": "^1.34|^2.4" diff --git a/src/Symfony/Component/Mailer/composer.json b/src/Symfony/Component/Mailer/composer.json index 48395d4f1fe9d..b9852124f19c2 100644 --- a/src/Symfony/Component/Mailer/composer.json +++ b/src/Symfony/Component/Mailer/composer.json @@ -25,6 +25,7 @@ "require-dev": { "symfony/amazon-mailer": "^4.3", "symfony/google-mailer": "^4.3", + "symfony/http-client-contracts": "^1.1", "symfony/mailgun-mailer": "^4.3", "symfony/mailchimp-mailer": "^4.3", "symfony/postmark-mailer": "^4.3", diff --git a/src/Symfony/Component/Messenger/composer.json b/src/Symfony/Component/Messenger/composer.json index 4b552c96437ba..798940ef5d36d 100644 --- a/src/Symfony/Component/Messenger/composer.json +++ b/src/Symfony/Component/Messenger/composer.json @@ -31,6 +31,7 @@ "symfony/process": "~3.4|~4.0", "symfony/property-access": "~3.4|~4.0", "symfony/serializer": "~3.4|~4.0", + "symfony/service-contracts": "^1.1", "symfony/stopwatch": "~3.4|~4.0", "symfony/validator": "~3.4|~4.0", "symfony/var-dumper": "~3.4|~4.0" diff --git a/src/Symfony/Component/Translation/composer.json b/src/Symfony/Component/Translation/composer.json index e9997ba2901a4..4cdf5a6aa13e5 100644 --- a/src/Symfony/Component/Translation/composer.json +++ b/src/Symfony/Component/Translation/composer.json @@ -18,7 +18,7 @@ "require": { "php": "^7.1.3", "symfony/polyfill-mbstring": "~1.0", - "symfony/translation-contracts": "^1.1" + "symfony/translation-contracts": "^1.1.2" }, "require-dev": { "symfony/config": "~3.4|~4.0", diff --git a/src/Symfony/Contracts/Tests/Service/ServiceLocatorTest.php b/src/Symfony/Contracts/Service/Test/ServiceLocatorTest.php similarity index 98% rename from src/Symfony/Contracts/Tests/Service/ServiceLocatorTest.php rename to src/Symfony/Contracts/Service/Test/ServiceLocatorTest.php index 22487a8992791..69594583f5985 100644 --- a/src/Symfony/Contracts/Tests/Service/ServiceLocatorTest.php +++ b/src/Symfony/Contracts/Service/Test/ServiceLocatorTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Symfony\Contracts\Tests\Service; +namespace Symfony\Contracts\Service\Test; use PHPUnit\Framework\TestCase; use Psr\Container\ContainerInterface; diff --git a/src/Symfony/Contracts/phpunit.xml.dist b/src/Symfony/Contracts/phpunit.xml.dist index 4a9e8f0fc3240..fd93d020f23f8 100644 --- a/src/Symfony/Contracts/phpunit.xml.dist +++ b/src/Symfony/Contracts/phpunit.xml.dist @@ -15,6 +15,7 @@ ./Tests/ + ./Service/Test/ ./Translation/Test/ @@ -24,6 +25,7 @@ ./ ./Tests + ./Service/Test/ ./Translation/Test/ ./vendor From 1214609b37e707cba8feaf320a58b981a32c6010 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Mon, 27 May 2019 20:15:39 +0200 Subject: [PATCH 34/47] [HttpClient] make $response->getInfo('debug') return extended logs about the HTTP transaction --- .../Component/HttpClient/NativeHttpClient.php | 12 ++++++++- .../HttpClient/Response/CurlResponse.php | 15 +++++++++++ .../HttpClient/Response/NativeResponse.php | 26 ++++++++++++++++--- .../HttpClient/Response/ResponseTrait.php | 10 +++++-- 4 files changed, 57 insertions(+), 6 deletions(-) diff --git a/src/Symfony/Component/HttpClient/NativeHttpClient.php b/src/Symfony/Component/HttpClient/NativeHttpClient.php index 3442b50ef3952..b8e39e9479ae9 100644 --- a/src/Symfony/Component/HttpClient/NativeHttpClient.php +++ b/src/Symfony/Component/HttpClient/NativeHttpClient.php @@ -108,6 +108,7 @@ public function request(string $method, string $url, array $options = []): Respo 'size_body' => \strlen($options['body']), 'primary_ip' => '', 'primary_port' => 'http:' === $url['scheme'] ? 80 : 443, + 'debug' => \extension_loaded('curl') ? '' : "* Enable the curl extension for better performance\n", ]; if ($onProgress = $options['on_progress']) { @@ -139,6 +140,8 @@ public function request(string $method, string $url, array $options = []): Respo $info['size_download'] = $dlNow; } elseif (STREAM_NOTIFY_CONNECT === $code) { $info['connect_time'] += $now - $info['fopen_time']; + $info['debug'] .= $info['request_header']; + unset($info['request_header']); } else { return; } @@ -160,13 +163,16 @@ public function request(string $method, string $url, array $options = []): Respo $options['request_headers'][] = 'host: '.$host.$port; } + if (!isset($options['headers']['user-agent'])) { + $options['request_headers'][] = 'user-agent: Symfony HttpClient/Native'; + } + $context = [ 'http' => [ 'protocol_version' => $options['http_version'] ?: '1.1', 'method' => $method, 'content' => $options['body'], 'ignore_errors' => true, - 'user_agent' => 'Symfony HttpClient/Native', 'curl_verify_ssl_peer' => $options['verify_peer'], 'curl_verify_ssl_host' => $options['verify_host'], 'auto_decode' => false, // Disable dechunk filter, it's incompatible with stream_select() @@ -296,6 +302,7 @@ private static function dnsResolve(array $url, NativeClientState $multi, array & $host = parse_url($url['authority'], PHP_URL_HOST); if (null === $ip = $multi->dnsCache[$host] ?? null) { + $info['debug'] .= "* Hostname was NOT found in DNS cache\n"; $now = microtime(true); if (!$ip = gethostbynamel($host)) { @@ -304,6 +311,9 @@ private static function dnsResolve(array $url, NativeClientState $multi, array & $info['namelookup_time'] += microtime(true) - $now; $multi->dnsCache[$host] = $ip = $ip[0]; + $info['debug'] .= "* Added {$host}:0:{$ip} to DNS cache\n"; + } else { + $info['debug'] .= "* Hostname was found in DNS cache\n"; } $info['primary_ip'] = $ip; diff --git a/src/Symfony/Component/HttpClient/Response/CurlResponse.php b/src/Symfony/Component/HttpClient/Response/CurlResponse.php index a54ab6dc20169..6af5f5af3d68b 100644 --- a/src/Symfony/Component/HttpClient/Response/CurlResponse.php +++ b/src/Symfony/Component/HttpClient/Response/CurlResponse.php @@ -28,6 +28,7 @@ final class CurlResponse implements ResponseInterface private static $performing = false; private $multi; + private $debugBuffer; /** * @internal @@ -38,6 +39,9 @@ public function __construct(CurlClientState $multi, $ch, array $options = null, if (\is_resource($ch)) { $this->handle = $ch; + $this->debugBuffer = fopen('php://temp', 'w+'); + curl_setopt($ch, CURLOPT_VERBOSE, true); + curl_setopt($ch, CURLOPT_STDERR, $this->debugBuffer); } else { $this->info['url'] = $ch; $ch = $this->handle; @@ -143,6 +147,13 @@ public function getInfo(string $type = null) { if (!$info = $this->finalInfo) { self::perform($this->multi); + + if ('debug' === $type) { + rewind($this->debugBuffer); + + return stream_get_contents($this->debugBuffer); + } + $info = array_merge($this->info, curl_getinfo($this->handle)); $info['url'] = $this->info['url'] ?? $info['url']; $info['redirect_url'] = $this->info['redirect_url'] ?? null; @@ -154,6 +165,10 @@ public function getInfo(string $type = null) } if (!\in_array(curl_getinfo($this->handle, CURLINFO_PRIVATE), ['headers', 'content'], true)) { + rewind($this->debugBuffer); + $info['debug'] = stream_get_contents($this->debugBuffer); + fclose($this->debugBuffer); + $this->debugBuffer = null; $this->finalInfo = $info; } } diff --git a/src/Symfony/Component/HttpClient/Response/NativeResponse.php b/src/Symfony/Component/HttpClient/Response/NativeResponse.php index 037dd5da889bc..8be4b0416368b 100644 --- a/src/Symfony/Component/HttpClient/Response/NativeResponse.php +++ b/src/Symfony/Component/HttpClient/Response/NativeResponse.php @@ -34,6 +34,7 @@ final class NativeResponse implements ResponseInterface private $buffer; private $inflate; private $multi; + private $debugBuffer; /** * @internal @@ -76,12 +77,19 @@ public function getInfo(string $type = null) { if (!$info = $this->finalInfo) { self::perform($this->multi); + + if ('debug' === $type) { + return $this->info['debug']; + } + $info = $this->info; $info['url'] = implode('', $info['url']); - unset($info['fopen_time'], $info['size_body']); + unset($info['fopen_time'], $info['size_body'], $info['request_header']); if (null === $this->buffer) { $this->finalInfo = $info; + } else { + unset($info['debug']); } } @@ -112,10 +120,23 @@ private function open(): void $url = $this->url; while (true) { + $context = stream_context_get_options($this->context); + + if ($proxy = $context['http']['proxy'] ?? null) { + $this->info['debug'] .= "* Establish HTTP proxy tunnel to {$proxy}\n"; + $this->info['request_header'] = $url; + } else { + $this->info['debug'] .= "* Trying {$this->info['primary_ip']}...\n"; + $this->info['request_header'] = $this->info['url']['path'].$this->info['url']['query']; + } + + $this->info['request_header'] = sprintf("> %s %s HTTP/%s \r\n", $context['http']['method'], $this->info['request_header'], $context['http']['protocol_version']); + $this->info['request_header'] .= implode("\r\n", $context['http']['header'])."\r\n\r\n"; + // Send request and follow redirects when needed $this->info['fopen_time'] = microtime(true); $this->handle = $h = fopen($url, 'r', false, $this->context); - self::addResponseHeaders($http_response_header, $this->info, $this->headers); + self::addResponseHeaders($http_response_header, $this->info, $this->headers, $this->info['debug']); $url = ($this->resolveRedirect)($this->multi, $this->headers['location'][0] ?? null, $this->context); if (null === $url) { @@ -136,7 +157,6 @@ private function open(): void } stream_set_blocking($h, false); - $context = stream_context_get_options($this->context); $this->context = $this->resolveRedirect = null; if (isset($context['ssl']['peer_certificate_chain'])) { diff --git a/src/Symfony/Component/HttpClient/Response/ResponseTrait.php b/src/Symfony/Component/HttpClient/Response/ResponseTrait.php index 98e96ea0a64ea..79cc40d5d847f 100644 --- a/src/Symfony/Component/HttpClient/Response/ResponseTrait.php +++ b/src/Symfony/Component/HttpClient/Response/ResponseTrait.php @@ -189,19 +189,25 @@ abstract protected static function perform(ClientState $multi, array &$responses */ abstract protected static function select(ClientState $multi, float $timeout): int; - private static function addResponseHeaders(array $responseHeaders, array &$info, array &$headers): void + private static function addResponseHeaders(array $responseHeaders, array &$info, array &$headers, string &$debug = ''): void { foreach ($responseHeaders as $h) { if (11 <= \strlen($h) && '/' === $h[4] && preg_match('#^HTTP/\d+(?:\.\d+)? ([12345]\d\d) .*#', $h, $m)) { - $headers = []; + if ($headers) { + $debug .= "< \r\n"; + $headers = []; + } $info['http_code'] = (int) $m[1]; } elseif (2 === \count($m = explode(':', $h, 2))) { $headers[strtolower($m[0])][] = ltrim($m[1]); } + $debug .= "< {$h}\r\n"; $info['response_headers'][] = $h; } + $debug .= "< \r\n"; + if (!$info['http_code']) { throw new TransportException('Invalid or missing HTTP status line.'); } From 0b0f7bf807a7dd6da06bbdec9874bd27984803be Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 28 May 2019 10:32:53 +0200 Subject: [PATCH 35/47] fix tests --- src/Symfony/Component/DependencyInjection/composer.json | 2 +- src/Symfony/Component/Translation/composer.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/DependencyInjection/composer.json b/src/Symfony/Component/DependencyInjection/composer.json index 6777ffed21fd2..0195421c1fd14 100644 --- a/src/Symfony/Component/DependencyInjection/composer.json +++ b/src/Symfony/Component/DependencyInjection/composer.json @@ -18,7 +18,7 @@ "require": { "php": "^7.1.3", "psr/container": "^1.0", - "symfony/contracts": "^1.0" + "symfony/contracts": "^1.1.1" }, "require-dev": { "symfony/yaml": "~3.4|~4.0", diff --git a/src/Symfony/Component/Translation/composer.json b/src/Symfony/Component/Translation/composer.json index f8cd3f2d58696..ca9e7f297d271 100644 --- a/src/Symfony/Component/Translation/composer.json +++ b/src/Symfony/Component/Translation/composer.json @@ -17,7 +17,7 @@ ], "require": { "php": "^7.1.3", - "symfony/contracts": "^1.0.2", + "symfony/contracts": "^1.1.1", "symfony/polyfill-mbstring": "~1.0" }, "require-dev": { From 2ba8b8f15eb157e95e180af35a73e74819f8e2d2 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 28 May 2019 11:03:44 +0200 Subject: [PATCH 36/47] [Bridge\Twig] lazy load TranslatorTrait --- .../Twig/Extension/TranslationExtension.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/Symfony/Bridge/Twig/Extension/TranslationExtension.php b/src/Symfony/Bridge/Twig/Extension/TranslationExtension.php index b8a0eb61546aa..46fdd9e7b779a 100644 --- a/src/Symfony/Bridge/Twig/Extension/TranslationExtension.php +++ b/src/Symfony/Bridge/Twig/Extension/TranslationExtension.php @@ -33,12 +33,6 @@ */ class TranslationExtension extends AbstractExtension { - use TranslatorTrait { - getLocale as private; - setLocale as private; - trans as private doTrans; - } - private $translator; private $translationNodeVisitor; @@ -115,7 +109,9 @@ public function trans($message, array $arguments = [], $domain = null, $locale = $arguments['%count%'] = $count; } if (null === $this->translator) { - return $this->doTrans($message, $arguments, $domain, $locale); + $this->translator = new class() implements TranslatorInterface { + use TranslatorTrait; + }; } return $this->translator->trans($message, $arguments, $domain, $locale); @@ -127,8 +123,11 @@ public function trans($message, array $arguments = [], $domain = null, $locale = public function transchoice($message, $count, array $arguments = [], $domain = null, $locale = null) { if (null === $this->translator) { - return $this->doTrans($message, array_merge(['%count%' => $count], $arguments), $domain, $locale); + $this->translator = new class() implements TranslatorInterface { + use TranslatorTrait; + }; } + if ($this->translator instanceof TranslatorInterface) { return $this->translator->trans($message, array_merge(['%count%' => $count], $arguments), $domain, $locale); } From a7bfe26fcc61b800f65016de1b3cf9f7d91de1d9 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 28 May 2019 11:05:44 +0200 Subject: [PATCH 37/47] fix tests --- .../Component/DependencyInjection/Tests/ServiceLocatorTest.php | 2 +- .../Component/Translation/Tests/IdentityTranslatorTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/DependencyInjection/Tests/ServiceLocatorTest.php b/src/Symfony/Component/DependencyInjection/Tests/ServiceLocatorTest.php index 9c0962880fc92..8d55936712f3c 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/ServiceLocatorTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/ServiceLocatorTest.php @@ -14,7 +14,7 @@ use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\ServiceLocator; use Symfony\Contracts\Service\ServiceSubscriberInterface; -use Symfony\Contracts\Tests\Service\ServiceLocatorTest as BaseServiceLocatorTest; +use Symfony\Contracts\Service\Test\ServiceLocatorTest as BaseServiceLocatorTest; class ServiceLocatorTest extends BaseServiceLocatorTest { diff --git a/src/Symfony/Component/Translation/Tests/IdentityTranslatorTest.php b/src/Symfony/Component/Translation/Tests/IdentityTranslatorTest.php index be0a548aa1f06..cf618d95a219e 100644 --- a/src/Symfony/Component/Translation/Tests/IdentityTranslatorTest.php +++ b/src/Symfony/Component/Translation/Tests/IdentityTranslatorTest.php @@ -12,7 +12,7 @@ namespace Symfony\Component\Translation\Tests; use Symfony\Component\Translation\IdentityTranslator; -use Symfony\Contracts\Tests\Translation\TranslatorTest; +use Symfony\Contracts\Translation\Test\TranslatorTest; class IdentityTranslatorTest extends TranslatorTest { From 90167c36f8f7858385bb282f7cd8d7db1b303671 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 28 May 2019 11:19:25 +0200 Subject: [PATCH 38/47] fix tests --- .../{Tests/Service => Service/Test}/ServiceLocatorTest.php | 2 +- .../Translation => Translation/Test}/TranslatorTest.php | 2 +- src/Symfony/Contracts/phpunit.xml.dist | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) rename src/Symfony/Contracts/{Tests/Service => Service/Test}/ServiceLocatorTest.php (98%) rename src/Symfony/Contracts/{Tests/Translation => Translation/Test}/TranslatorTest.php (99%) diff --git a/src/Symfony/Contracts/Tests/Service/ServiceLocatorTest.php b/src/Symfony/Contracts/Service/Test/ServiceLocatorTest.php similarity index 98% rename from src/Symfony/Contracts/Tests/Service/ServiceLocatorTest.php rename to src/Symfony/Contracts/Service/Test/ServiceLocatorTest.php index 22487a8992791..69594583f5985 100644 --- a/src/Symfony/Contracts/Tests/Service/ServiceLocatorTest.php +++ b/src/Symfony/Contracts/Service/Test/ServiceLocatorTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Symfony\Contracts\Tests\Service; +namespace Symfony\Contracts\Service\Test; use PHPUnit\Framework\TestCase; use Psr\Container\ContainerInterface; diff --git a/src/Symfony/Contracts/Tests/Translation/TranslatorTest.php b/src/Symfony/Contracts/Translation/Test/TranslatorTest.php similarity index 99% rename from src/Symfony/Contracts/Tests/Translation/TranslatorTest.php rename to src/Symfony/Contracts/Translation/Test/TranslatorTest.php index ac5f9c7aebe18..48466300b5abf 100644 --- a/src/Symfony/Contracts/Tests/Translation/TranslatorTest.php +++ b/src/Symfony/Contracts/Translation/Test/TranslatorTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Symfony\Contracts\Tests\Translation; +namespace Symfony\Contracts\Translation\Test; use PHPUnit\Framework\TestCase; use Symfony\Contracts\Translation\TranslatorInterface; diff --git a/src/Symfony/Contracts/phpunit.xml.dist b/src/Symfony/Contracts/phpunit.xml.dist index e222d9f5a7ecf..fd93d020f23f8 100644 --- a/src/Symfony/Contracts/phpunit.xml.dist +++ b/src/Symfony/Contracts/phpunit.xml.dist @@ -15,6 +15,8 @@ ./Tests/ + ./Service/Test/ + ./Translation/Test/ @@ -23,6 +25,8 @@ ./ ./Tests + ./Service/Test/ + ./Translation/Test/ ./vendor From 5a4781671513b7261dfb966b72d954374f83dc4a Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 28 May 2019 11:23:44 +0200 Subject: [PATCH 39/47] updated CHANGELOG for 3.4.28 --- CHANGELOG-3.4.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/CHANGELOG-3.4.md b/CHANGELOG-3.4.md index 5979db7bcdc5f..7b2094530cef7 100644 --- a/CHANGELOG-3.4.md +++ b/CHANGELOG-3.4.md @@ -7,6 +7,26 @@ in 3.4 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/v3.4.0...v3.4.1 +* 3.4.28 (2019-05-28) + + * bug #31584 [Workflow] Do not trigger extra guards (lyrixx) + * bug #31349 [WebProfilerBundle] Use absolute URL for profiler links (Alumbrados) + * bug #31541 [DI] fix using bindings with locators of service subscribers (nicolas-grekas) + * bug #31568 [Process] Fix infinite waiting for stopped process (mshavliuk) + * bug #31551 [ProxyManager] isProxyCandidate() does not take into account interfaces (andrerom) + * bug #31335 [Doctrine] Respect parent class contract in ContainerAwareEventManager (Koc) + * bug #31421 [Routing][AnnotationClassLoader] fix utf-8 encoding in default route name (przemyslaw-bogusz) + * bug #31510 Use the current working dir as default first arg in 'link' binary (lyrixx) + * bug #31535 [Debug] Wrap call to require_once in a try/catch (lyrixx) + * bug #31438 [Serializer] Fix denormalization of object with variadic constructor typed argument (ajgarlag) + * bug #31475 [HttpFoundation] Allow set 'None' on samesite cookie flag (markitosgv) + * bug #31261 [Console] Commands with an alias should not be recognized as ambiguous when using register (Simperfit) + * bug #31371 [DI] Removes number of elements information in debug mode (jschaedl) + * bug #31418 [FrameworkBundle] clarify the possible class/interface of the cache (xabbuh) + * bug #31411 [Intl] Fix root fallback locale (ro0NL) + * bug #31377 [Console] Fix auto-complete for ChoiceQuestion (multi-select answers) (battye) + * bug #31380 [WebProfilerBundle] Don't filter submitted IP values (javiereguiluz) + * 3.4.27 (2019-05-01) * bug #31338 Revert "bug #30620 [FrameworkBundle][HttpFoundation] make session service resettable (dmaicher)" (nicolas-grekas) From 8e3872f76dd18ef511208b2765384c18ae826932 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 28 May 2019 11:24:36 +0200 Subject: [PATCH 40/47] update CONTRIBUTORS for 3.4.28 --- CONTRIBUTORS.md | 73 ++++++++++++++++++++++++++++++------------------- 1 file changed, 45 insertions(+), 28 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index ec97d42d4b87b..fddccc428e7c9 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -39,8 +39,8 @@ Symfony is the result of the work of many people who made the code better - Benjamin Eberlei (beberlei) - Igor Wiedler (igorw) - Eriksen Costa (eriksencosta) - - Guilhem Niot (energetick) - Hamza Amrouche (simperfit) + - Guilhem Niot (energetick) - Sarah Khalil (saro0h) - Jonathan Wage (jwage) - Tobias Nyholm (tobias) @@ -66,34 +66,34 @@ Symfony is the result of the work of many people who made the code better - Diego Saint Esteben (dii3g0) - Konstantin Kudryashov (everzet) - Gábor Egyed (1ed) + - Grégoire Paris (greg0ire) - Bilal Amarni (bamarni) - Titouan Galopin (tgalopin) - - Grégoire Paris (greg0ire) - Mathieu Piot (mpiot) - David Maicher (dmaicher) - Florin Patan (florinpatan) - - Gabriel Ostrolucký (gadelat) - Valentin Udaltsov (vudaltsov) + - Konstantin Myakshin (koc) + - Gabriel Ostrolucký (gadelat) - Vladimir Reznichenko (kalessil) - Jáchym Toušek (enumag) - - Konstantin Myakshin (koc) - Michel Weimerskirch (mweimerskirch) - Andrej Hudec (pulzarraider) + - Issei Murasawa (issei_m) - Eric Clemmons (ericclemmons) - Charles Sarrazin (csarrazi) - Christian Raue - - Issei Murasawa (issei_m) - Arnout Boks (aboks) - Deni - Henrik Westphal (snc) - Dariusz Górecki (canni) - Douglas Greenshields (shieldo) + - David Buchmann (dbu) - Dariusz Ruminski - Lee McDermott - Brandon Turner - Luis Cordova (cordoval) - Graham Campbell (graham) - - David Buchmann (dbu) - Daniel Holmes (dholmes) - Toni Uebernickel (havvg) - Bart van den Burg (burgov) @@ -108,9 +108,9 @@ Symfony is the result of the work of many people who made the code better - Maxime STEINHAUSSER - Michal Piotrowski (eventhorizon) - Tim Nagel (merk) + - Chris Wilkinson (thewilkybarkid) - Brice BERNARD (brikou) - Baptiste Clavié (talus) - - Chris Wilkinson (thewilkybarkid) - marc.weistroff - Tomáš Votruba (tomas_votruba) - lenar @@ -152,6 +152,7 @@ Symfony is the result of the work of many people who made the code better - Arnaud Kleinpeter (nanocom) - Jannik Zschiesche (apfelbox) - Guilherme Blanco (guilhermeblanco) + - Jan Schädlich (jschaedl) - SpacePossum - Pablo Godel (pgodel) - Jérémie Augustin (jaugustin) @@ -162,13 +163,13 @@ Symfony is the result of the work of many people who made the code better - Rafael Dohms (rdohms) - jwdeitch - Mikael Pajunen + - François-Xavier de Guillebon (de-gui_f) - Niels Keurentjes (curry684) - Vyacheslav Pavlov - Richard van Laak (rvanlaak) - Richard Shank (iampersistent) - Thomas Rabaix (rande) - Rouven Weßling (realityking) - - François-Xavier de Guillebon (de-gui_f) - Clemens Tolboom - Helmer Aaviksoo - Alessandro Chitolina (alekitto) @@ -181,7 +182,7 @@ Symfony is the result of the work of many people who made the code better - Artur Kotyrba - Tyson Andre - GDIBass - - Jan Schädlich (jschaedl) + - Alexander Schranz (alexander-schranz) - jeremyFreeAgent (Jérémy Romey) (jeremyfreeagent) - James Halsall (jaitsu) - Matthieu Napoli (mnapoli) @@ -201,7 +202,7 @@ Symfony is the result of the work of many people who made the code better - Dennis Benkert (denderello) - DQNEO - Samuel NELA (snela) - - Alexander Schranz (alexander-schranz) + - Vincent Touzet (vincenttouzet) - Gregor Harlan (gharlan) - Gary PEGEOT (gary-p) - Ruben Gonzalez (rubenrua) @@ -226,7 +227,6 @@ Symfony is the result of the work of many people who made the code better - fivestar - Dominique Bongiraud - Jeremy Livingston (jeremylivingston) - - Vincent Touzet (vincenttouzet) - Michael Lee (zerustech) - Matthieu Auger (matthieuauger) - Leszek Prabucki (l3l0) @@ -253,6 +253,7 @@ Symfony is the result of the work of many people who made the code better - Mantis Development - Loïc Faugeron - Hidde Wieringa (hiddewie) + - Andre Rømcke (andrerom) - Marco Pivetta (ocramius) - Rob Frawley 2nd (robfrawley) - julien pauli (jpauli) @@ -268,7 +269,9 @@ Symfony is the result of the work of many people who made the code better - Elnur Abdurrakhimov (elnur) - Manuel Reinhard (sprain) - Danny Berger (dpb587) + - Antonio J. García Lagar (ajgarlag) - Adam Prager (padam87) + - Przemysław Bogusz (przemyslaw-bogusz) - Benoît Burnichon (bburnichon) - Roman Marintšenko (inori) - Xavier Montaña Carreras (xmontana) @@ -295,15 +298,16 @@ Symfony is the result of the work of many people who made the code better - Jan Sorgalla (jsor) - Ray - Chekote + - Antoine Makdessi (amakdessi) - Thomas Adam - Viktor Bocharskyi (bocharsky_bw) - Jhonny Lidfors (jhonne) - Diego Agulló (aeoris) - jdhoek + - David Prévot - Bob den Otter (bopp) - Thomas Schulz (king2500) - Frank de Jonge (frenkynet) - - Andre Rømcke (andrerom) - Nikita Konstantinov - Wodor Wodorski - Thomas Lallement (raziel057) @@ -318,9 +322,7 @@ Symfony is the result of the work of many people who made the code better - Robert Kiss (kepten) - Zan Baldwin (zanderbaldwin) - Roumen Damianoff (roumen) - - Antonio J. García Lagar (ajgarlag) - Kim Hemsø Rasmussen (kimhemsoe) - - Przemysław Bogusz (przemyslaw-bogusz) - Pascal Luna (skalpa) - Wouter Van Hecke - Jérôme Parmentier (lctrs) @@ -334,8 +336,10 @@ Symfony is the result of the work of many people who made the code better - Chad Sikorra (chadsikorra) - Chris Smith (cs278) - Florian Klein (docteurklein) + - Stadly - Manuel Kiessling (manuelkiessling) - Atsuhiro KUBO (iteman) + - Quynh Xuan Nguyen (xuanquynh) - rudy onfroy (ronfroy) - Serkan Yildiz (srknyldz) - Andrew Moore (finewolf) @@ -359,7 +363,6 @@ Symfony is the result of the work of many people who made the code better - Hidde Boomsma (hboomsma) - John Bafford (jbafford) - Raul Fraile (raulfraile) - - David Prévot - Adrian Rudnik (kreischweide) - Francesc Rosàs (frosas) - Romain Pierre (romain-pierre) @@ -412,9 +415,7 @@ Symfony is the result of the work of many people who made the code better - Grzegorz (Greg) Zdanowski (kiler129) - Iker Ibarguren (ikerib) - Kirill chEbba Chebunin (chebba) - - Stadly - Greg Thornton (xdissent) - - Quynh Xuan Nguyen (xuanquynh) - Martin Hujer (martinhujer) - Philipp Cordes - Costin Bereveanu (schniper) @@ -427,6 +428,7 @@ Symfony is the result of the work of many people who made the code better - Pavel Volokitin (pvolok) - Smaine Milianni (ismail1432) - Arthur de Moulins (4rthem) + - Matthias Althaus (althaus) - Nicolas Dewez (nicolas_dewez) - Endre Fejes - Tobias Naumann (tna) @@ -463,6 +465,7 @@ Symfony is the result of the work of many people who made the code better - Steffen Roßkamp - Alexandru Furculita (afurculita) - Valentin Jonovs (valentins-jonovs) + - Laurent VOULLEMIER (lvo) - Jeanmonod David (jeanmonod) - Christopher Davis (chrisguitarguy) - Webnet team (webnet) @@ -568,6 +571,7 @@ Symfony is the result of the work of many people who made the code better - Almog Baku (almogbaku) - Scott Arciszewski - Xavier HAUSHERR + - Christopher Hertel (chertel) - Norbert Orzechowicz (norzechowicz) - Denis Charrier (brucewouaigne) - Matthijs van den Bos (matthijs) @@ -593,7 +597,9 @@ Symfony is the result of the work of many people who made the code better - Martin Morávek (keeo) - Steven Surowiec - Kevin Saliou (kbsali) + - Ruud Kamphuis (ruudk) - Shawn Iwinski + - Gawain Lynch (gawain) - NothingWeAre - Ryan - Alexander Deruwe (aderuwe) @@ -622,7 +628,6 @@ Symfony is the result of the work of many people who made the code better - Sebastian Krebs - Piotr Stankowski - Baptiste Leduc (bleduc) - - Laurent VOULLEMIER (lvo) - Jean-Christophe Cuvelier [Artack] - Simon DELICATA - alcaeus @@ -647,6 +652,7 @@ Symfony is the result of the work of many people who made the code better - Desjardins Jérôme (jewome62) - Kévin THERAGE (kevin_therage) - Simeon Kolev (simeon_kolev9) + - Jonas Elfering - Nahuel Cuesta (ncuesta) - Chris Boden (cboden) - Christophe Villeger (seragan) @@ -704,6 +710,7 @@ Symfony is the result of the work of many people who made the code better - Ulumuddin Yunus (joenoez) - Johann Saunier (prophet777) - Sergey (upyx) + - Andreas Erhard - Michael Devery (mickadoo) - Antoine Corcy - Sascha Grossenbacher @@ -747,6 +754,7 @@ Symfony is the result of the work of many people who made the code better - RJ Garcia - Delf Tonder (leberknecht) - Raulnet + - Ondrej Exner - Mark Sonnabaum - Massimiliano Braglia (massimilianobraglia) - Richard Quadling @@ -756,6 +764,7 @@ Symfony is the result of the work of many people who made the code better - Alexander Volochnev (exelenz) - Michael Piecko - yclian + - Alan Poulain - Aleksey Prilipko - Tomas Norkūnas (norkunas) - Andrew Berry @@ -796,7 +805,6 @@ Symfony is the result of the work of many people who made the code better - Andrew Tchircoff (andrewtch) - michaelwilliams - 1emming - - Matthias Althaus - Leevi Graham (leevigraham) - Nykopol (nykopol) - Tri Pham (phamuyentri) @@ -815,7 +823,6 @@ Symfony is the result of the work of many people who made the code better - fedor.f - Yosmany Garcia (yosmanyga) - Wouter de Wild - - Antoine M (amakdessi) - Degory Valentine - izzyp - Benoit Lévêque (benoit_leveque) @@ -836,7 +843,6 @@ Symfony is the result of the work of many people who made the code better - Ben - Vincent Composieux (eko) - Jayson Xu (superjavason) - - Christopher Hertel (chertel) - Hubert Lenoir (hubert_lenoir) - fago - Harm van Tilborg @@ -888,13 +894,11 @@ Symfony is the result of the work of many people who made the code better - Patrick Allaert - Gustavo Falco (gfalco) - Matt Robinson (inanimatt) - - Ruud Kamphuis (ruudk) - Aleksey Podskrebyshev - Calin Mihai Pristavu - David Marín Carreño (davefx) - Fabien LUCAS (flucas2) - Omar Yepez (oyepez003) - - Gawain Lynch (gawain) - mwsaz - Jelle Kapitein - Benoît Bourgeois @@ -918,6 +922,7 @@ Symfony is the result of the work of many people who made the code better - Morgan Auchede (mauchede) - Sascha Dens (saschadens) - Don Pinkster + - Saif Eddin G - Maksim Muruev - Emil Einarsson - Thomas Landauer @@ -938,6 +943,7 @@ Symfony is the result of the work of many people who made the code better - Arno Geurts - Adán Lobato (adanlobato) - Ian Jenkins (jenkoian) + - Marcos Gómez Vilches (markitosgv) - Matthew Davis (mdavis1982) - Maks - Antoine LA @@ -980,7 +986,9 @@ Symfony is the result of the work of many people who made the code better - d-ph - Renan Taranto (renan-taranto) - Thomas Talbot (ioni) + - Dmitry Simushev - Rikijs Murgs + - Uladzimir Tsykun - Ben Ramsey (ramsey) - Amaury Leroux de Lens (amo__) - Christian Jul Jensen @@ -1005,7 +1013,6 @@ Symfony is the result of the work of many people who made the code better - Sander Marechal - Franz Wilding (killerpoke) - ProgMiner - - Jonas Elfering - Oleg Golovakhin (doc_tr) - Joost van Driel - Icode4Food (icode4food) @@ -1066,6 +1073,7 @@ Symfony is the result of the work of many people who made the code better - Máximo Cuadros (mcuadros) - Lukas Mencl - tamirvs + - gauss - julien.galenski - Christian Neff - Chris Tiearney @@ -1124,6 +1132,7 @@ Symfony is the result of the work of many people who made the code better - hugofonseca (fonsecas72) - Martynas Narbutas - Toon Verwerft (veewee) + - battye - Bailey Parker - Eddie Jaoude - Antanas Arvasevicius @@ -1159,6 +1168,7 @@ Symfony is the result of the work of many people who made the code better - Alexander Cheprasov - Rodrigo Díez Villamuera (rodrigodiez) - James Hudson + - Stephen Clouse - e-ivanov - Einenlum - Jochen Bayer (jocl) @@ -1219,6 +1229,7 @@ Symfony is the result of the work of many people who made the code better - Max Voloshin (maxvoloshin) - Nicolas Fabre (nfabre) - Raul Rodriguez (raul782) + - mshavliuk - WybrenKoelmans - Derek Lambert - MightyBranch @@ -1260,6 +1271,7 @@ Symfony is the result of the work of many people who made the code better - Jelte Steijaert (jelte) - Quique Porta (quiqueporta) - stoccc + - Andrea Quintino (dirk39) - Tomasz Szymczyk (karion) - Alex Vasilchenko - sez-open @@ -1281,7 +1293,6 @@ Symfony is the result of the work of many people who made the code better - Toni Peric (tperic) - Tatsuya Tsuruoka - Ross Tuck - - Andreas Erhard - Kévin Gomez (kevin) - Mihai Nica (redecs) - Soufian EZ-ZANTAR (soezz) @@ -1398,6 +1409,7 @@ Symfony is the result of the work of many people who made the code better - Samuel Gordalina (gordalina) - Max Romanovsky (maxromanovsky) - Nicolas Eeckeloo (neeckeloo) + - Andriy Prokopenko (sleepyboy) - Mathieu Morlon - Daniel Tschinder - Arnaud CHASSEUX @@ -1502,6 +1514,7 @@ Symfony is the result of the work of many people who made the code better - Gavin Staniforth - Alessandro Tagliapietra (alex88) - Biji (biji) + - Jérôme Tanghe (deuchnord) - Alex Teterin (errogaht) - Gunnar Lium (gunnarlium) - Tiago Garcia (tiagojsag) @@ -1512,7 +1525,6 @@ Symfony is the result of the work of many people who made the code better - Enrico Schultz - Evert Harmeling - mschop - - Alan Poulain - Martin Eckhardt - natechicago - Sergei Gorjunov @@ -1645,6 +1657,7 @@ Symfony is the result of the work of many people who made the code better - michalmarcinkowski - Warwick - Chris + - Farid Jalilov - Florent Olivaud - JakeFr - Simon Sargeant @@ -1815,6 +1828,7 @@ Symfony is the result of the work of many people who made the code better - Gabriel Birke - skafandri - Derek Bonner + - martijn - Alan Chen - insidestyles - Maerlyn @@ -1979,6 +1993,7 @@ Symfony is the result of the work of many people who made the code better - patrick-mcdougle - Dariusz Czech - Jack Wright + - MrNicodemuz - Anonymous User - Paweł Tomulik - Eric J. Duran @@ -2004,6 +2019,7 @@ Symfony is the result of the work of many people who made the code better - Tammy D - Daniel STANCU - Ryan Rud + - mmokhi - Ondrej Slinták - vlechemin - Brian Corrigan @@ -2013,6 +2029,7 @@ Symfony is the result of the work of many people who made the code better - fmarchalemisys - mieszko4 - Steve Preston + - Wojciech Skorodecki - Kevin Frantz - Neophy7e - bokonet @@ -2034,6 +2051,7 @@ Symfony is the result of the work of many people who made the code better - Ondřej Führer - Sema - Elan Ruusamäe + - Jon Dufresne - Thorsten Hallwas - Michael Squires - Egor Gorbachev @@ -2079,7 +2097,6 @@ Symfony is the result of the work of many people who made the code better - phc - Дмитрий Пацура - ilyes kooli - - Matthias Althaus - Michaël VEROUX - Julia - Lin Lu @@ -2141,7 +2158,6 @@ Symfony is the result of the work of many people who made the code better - Laurent Bachelier (laurentb) - Luís Cobucci (lcobucci) - Mehdi Achour (machour) - - Marcos Gómez Vilches (markitosgv) - Matthieu Mota (matthieumota) - Matthieu Moquet (mattketmo) - Moritz Borgmann (mborgmann) @@ -2223,6 +2239,7 @@ Symfony is the result of the work of many people who made the code better - Mohamed Karnichi (amiral) - Andrew Carter (andrewcarteruk) - Adam Elsodaney (archfizz) + - Pablo Lozano (arkadis) - Gregório Bonfante Borba (bonfante) - Bogdan Rancichi (devck) - Daniel Kolvik (dkvk) From af28e976dff2932b4aa9148cc97d8527762df242 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 28 May 2019 11:24:42 +0200 Subject: [PATCH 41/47] updated VERSION for 3.4.28 --- src/Symfony/Component/HttpKernel/Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index 686d4a9c55bff..01a0224cd99d1 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -67,12 +67,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl private $requestStackSize = 0; private $resetServices = false; - const VERSION = '3.4.28-DEV'; + const VERSION = '3.4.28'; const VERSION_ID = 30428; const MAJOR_VERSION = 3; const MINOR_VERSION = 4; const RELEASE_VERSION = 28; - const EXTRA_VERSION = 'DEV'; + const EXTRA_VERSION = ''; const END_OF_MAINTENANCE = '11/2020'; const END_OF_LIFE = '11/2021'; From bb9a67df3b7577cf02967ce30e9b6f113657542d Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 28 May 2019 11:38:37 +0200 Subject: [PATCH 42/47] bumped Symfony version to 3.4.29 --- src/Symfony/Component/HttpKernel/Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index 01a0224cd99d1..092fb6c762717 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -67,12 +67,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl private $requestStackSize = 0; private $resetServices = false; - const VERSION = '3.4.28'; - const VERSION_ID = 30428; + const VERSION = '3.4.29-DEV'; + const VERSION_ID = 30429; const MAJOR_VERSION = 3; const MINOR_VERSION = 4; - const RELEASE_VERSION = 28; - const EXTRA_VERSION = ''; + const RELEASE_VERSION = 29; + const EXTRA_VERSION = 'DEV'; const END_OF_MAINTENANCE = '11/2020'; const END_OF_LIFE = '11/2021'; From 5bc84778f97a63decf0290116d0990eddde7bd64 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 28 May 2019 11:47:34 +0200 Subject: [PATCH 43/47] fix deps --- composer.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 8049c9e468340..71c597d122df6 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ "psr/link": "^1.0", "psr/log": "~1.0", "psr/simple-cache": "^1.0", - "symfony/contracts": "^1.0.2", + "symfony/contracts": "^1.1.1", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-intl-icu": "~1.0", "symfony/polyfill-mbstring": "~1.0", @@ -115,9 +115,9 @@ "psr/container-implementation": "1.0", "psr/log-implementation": "1.0", "psr/simple-cache-implementation": "1.0", - "symfony/cache-contracts": "1.0", - "symfony/service-contracts": "1.0", - "symfony/translation-contracts": "1.0" + "symfony/cache-implementation": "1.0", + "symfony/service-implementation": "1.0", + "symfony/translation-implementation": "1.0" }, "autoload": { "psr-4": { From 3a508e32581c0b1c4214dca36deb65e529f3e11a Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 28 May 2019 13:49:01 +0200 Subject: [PATCH 44/47] Updated "experimental" annotations for 4.3 --- .../Bridge/Doctrine/Messenger/DoctrineTransactionMiddleware.php | 2 +- .../Component/Messenger/Command/ConsumeMessagesCommand.php | 2 +- src/Symfony/Component/Messenger/Command/DebugCommand.php | 2 +- .../Messenger/DataCollector/MessengerDataCollector.php | 2 +- .../Component/Messenger/DependencyInjection/MessengerPass.php | 2 +- src/Symfony/Component/Messenger/Envelope.php | 2 +- .../Component/Messenger/Exception/ExceptionInterface.php | 2 +- .../Component/Messenger/Exception/InvalidArgumentException.php | 2 +- src/Symfony/Component/Messenger/Exception/LogicException.php | 2 +- .../Messenger/Exception/NoHandlerForMessageException.php | 2 +- src/Symfony/Component/Messenger/Exception/RuntimeException.php | 2 +- .../Component/Messenger/Exception/TransportException.php | 2 +- .../Component/Messenger/Exception/ValidationFailedException.php | 2 +- src/Symfony/Component/Messenger/HandleTrait.php | 2 +- src/Symfony/Component/Messenger/Handler/HandlersLocator.php | 2 +- .../Component/Messenger/Handler/HandlersLocatorInterface.php | 2 +- .../Component/Messenger/Handler/MessageHandlerInterface.php | 2 +- .../Component/Messenger/Handler/MessageSubscriberInterface.php | 2 +- src/Symfony/Component/Messenger/MessageBus.php | 2 +- src/Symfony/Component/Messenger/MessageBusInterface.php | 2 +- .../Component/Messenger/Middleware/ActivationMiddleware.php | 2 +- .../Component/Messenger/Middleware/HandleMessageMiddleware.php | 2 +- .../Component/Messenger/Middleware/MiddlewareInterface.php | 2 +- .../Component/Messenger/Middleware/SendMessageMiddleware.php | 2 +- src/Symfony/Component/Messenger/Middleware/StackInterface.php | 2 +- src/Symfony/Component/Messenger/Middleware/StackMiddleware.php | 2 +- .../Component/Messenger/Middleware/TraceableMiddleware.php | 2 +- .../Component/Messenger/Middleware/ValidationMiddleware.php | 2 +- src/Symfony/Component/Messenger/Stamp/HandledStamp.php | 2 +- src/Symfony/Component/Messenger/Stamp/ReceivedStamp.php | 2 +- src/Symfony/Component/Messenger/Stamp/SentStamp.php | 2 +- src/Symfony/Component/Messenger/Stamp/SerializerStamp.php | 2 +- src/Symfony/Component/Messenger/Stamp/StampInterface.php | 2 +- src/Symfony/Component/Messenger/Stamp/ValidationStamp.php | 2 +- .../Component/Messenger/Test/Middleware/MiddlewareTestCase.php | 2 +- src/Symfony/Component/Messenger/TraceableMessageBus.php | 2 +- .../Component/Messenger/Transport/AmqpExt/AmqpFactory.php | 2 +- .../Component/Messenger/Transport/AmqpExt/AmqpReceiver.php | 2 +- .../Component/Messenger/Transport/AmqpExt/AmqpSender.php | 2 +- .../Component/Messenger/Transport/AmqpExt/AmqpTransport.php | 2 +- .../Messenger/Transport/AmqpExt/AmqpTransportFactory.php | 2 +- .../Component/Messenger/Transport/AmqpExt/Connection.php | 2 +- .../Messenger/Transport/Receiver/ReceiverInterface.php | 2 +- .../Component/Messenger/Transport/Sender/SenderInterface.php | 2 +- .../Component/Messenger/Transport/Sender/SendersLocator.php | 2 +- .../Messenger/Transport/Sender/SendersLocatorInterface.php | 2 +- .../Messenger/Transport/Serialization/PhpSerializer.php | 2 +- .../Component/Messenger/Transport/Serialization/Serializer.php | 2 +- .../Messenger/Transport/Serialization/SerializerInterface.php | 2 +- src/Symfony/Component/Messenger/Transport/TransportFactory.php | 2 +- .../Component/Messenger/Transport/TransportFactoryInterface.php | 2 +- .../Component/Messenger/Transport/TransportInterface.php | 2 +- src/Symfony/Component/Messenger/Worker.php | 2 +- 53 files changed, 53 insertions(+), 53 deletions(-) diff --git a/src/Symfony/Bridge/Doctrine/Messenger/DoctrineTransactionMiddleware.php b/src/Symfony/Bridge/Doctrine/Messenger/DoctrineTransactionMiddleware.php index 0c207567caf35..ad0d87b97c6be 100644 --- a/src/Symfony/Bridge/Doctrine/Messenger/DoctrineTransactionMiddleware.php +++ b/src/Symfony/Bridge/Doctrine/Messenger/DoctrineTransactionMiddleware.php @@ -22,7 +22,7 @@ * * @author Tobias Nyholm * - * @experimental in 4.2 + * @experimental in 4.3 */ class DoctrineTransactionMiddleware implements MiddlewareInterface { diff --git a/src/Symfony/Component/Messenger/Command/ConsumeMessagesCommand.php b/src/Symfony/Component/Messenger/Command/ConsumeMessagesCommand.php index 4ad5dfb278aef..0e91cfc795551 100644 --- a/src/Symfony/Component/Messenger/Command/ConsumeMessagesCommand.php +++ b/src/Symfony/Component/Messenger/Command/ConsumeMessagesCommand.php @@ -34,7 +34,7 @@ /** * @author Samuel Roze * - * @experimental in 4.2 + * @experimental in 4.3 */ class ConsumeMessagesCommand extends Command { diff --git a/src/Symfony/Component/Messenger/Command/DebugCommand.php b/src/Symfony/Component/Messenger/Command/DebugCommand.php index 592b4572075f8..2fba6f02f5122 100644 --- a/src/Symfony/Component/Messenger/Command/DebugCommand.php +++ b/src/Symfony/Component/Messenger/Command/DebugCommand.php @@ -23,7 +23,7 @@ * * @author Roland Franssen * - * @experimental in 4.2 + * @experimental in 4.3 */ class DebugCommand extends Command { diff --git a/src/Symfony/Component/Messenger/DataCollector/MessengerDataCollector.php b/src/Symfony/Component/Messenger/DataCollector/MessengerDataCollector.php index 5d33f735b24ae..f8356ce3e21d0 100644 --- a/src/Symfony/Component/Messenger/DataCollector/MessengerDataCollector.php +++ b/src/Symfony/Component/Messenger/DataCollector/MessengerDataCollector.php @@ -21,7 +21,7 @@ /** * @author Samuel Roze * - * @experimental in 4.2 + * @experimental in 4.3 */ class MessengerDataCollector extends DataCollector implements LateDataCollectorInterface { diff --git a/src/Symfony/Component/Messenger/DependencyInjection/MessengerPass.php b/src/Symfony/Component/Messenger/DependencyInjection/MessengerPass.php index 201688944d643..bc5f0290c337f 100644 --- a/src/Symfony/Component/Messenger/DependencyInjection/MessengerPass.php +++ b/src/Symfony/Component/Messenger/DependencyInjection/MessengerPass.php @@ -28,7 +28,7 @@ /** * @author Samuel Roze * - * @experimental in 4.2 + * @experimental in 4.3 */ class MessengerPass implements CompilerPassInterface { diff --git a/src/Symfony/Component/Messenger/Envelope.php b/src/Symfony/Component/Messenger/Envelope.php index 825ebf79e4dc6..be012fba944d4 100644 --- a/src/Symfony/Component/Messenger/Envelope.php +++ b/src/Symfony/Component/Messenger/Envelope.php @@ -18,7 +18,7 @@ * * @author Maxime Steinhausser * - * @experimental in 4.2 + * @experimental in 4.3 */ final class Envelope { diff --git a/src/Symfony/Component/Messenger/Exception/ExceptionInterface.php b/src/Symfony/Component/Messenger/Exception/ExceptionInterface.php index a09d87d797aa8..59f0e1e9813a4 100644 --- a/src/Symfony/Component/Messenger/Exception/ExceptionInterface.php +++ b/src/Symfony/Component/Messenger/Exception/ExceptionInterface.php @@ -16,7 +16,7 @@ * * @author Samuel Roze * - * @experimental in 4.2 + * @experimental in 4.3 */ interface ExceptionInterface extends \Throwable { diff --git a/src/Symfony/Component/Messenger/Exception/InvalidArgumentException.php b/src/Symfony/Component/Messenger/Exception/InvalidArgumentException.php index 2b34ef0210f86..1d0755f8c3c30 100644 --- a/src/Symfony/Component/Messenger/Exception/InvalidArgumentException.php +++ b/src/Symfony/Component/Messenger/Exception/InvalidArgumentException.php @@ -14,7 +14,7 @@ /** * @author Yonel Ceruto * - * @experimental in 4.2 + * @experimental in 4.3 */ class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface { diff --git a/src/Symfony/Component/Messenger/Exception/LogicException.php b/src/Symfony/Component/Messenger/Exception/LogicException.php index 72bd09438c6a7..6142bd300183d 100644 --- a/src/Symfony/Component/Messenger/Exception/LogicException.php +++ b/src/Symfony/Component/Messenger/Exception/LogicException.php @@ -14,7 +14,7 @@ /** * @author Roland Franssen * - * @experimental in 4.2 + * @experimental in 4.3 */ class LogicException extends \LogicException implements ExceptionInterface { diff --git a/src/Symfony/Component/Messenger/Exception/NoHandlerForMessageException.php b/src/Symfony/Component/Messenger/Exception/NoHandlerForMessageException.php index 6251787011819..a3fc0fa414ef7 100644 --- a/src/Symfony/Component/Messenger/Exception/NoHandlerForMessageException.php +++ b/src/Symfony/Component/Messenger/Exception/NoHandlerForMessageException.php @@ -14,7 +14,7 @@ /** * @author Samuel Roze * - * @experimental in 4.2 + * @experimental in 4.3 */ class NoHandlerForMessageException extends \LogicException implements ExceptionInterface { diff --git a/src/Symfony/Component/Messenger/Exception/RuntimeException.php b/src/Symfony/Component/Messenger/Exception/RuntimeException.php index 7253550ab3ccb..de9d7ade56637 100644 --- a/src/Symfony/Component/Messenger/Exception/RuntimeException.php +++ b/src/Symfony/Component/Messenger/Exception/RuntimeException.php @@ -14,7 +14,7 @@ /** * @author Fabien Potencier * - * @experimental in 4.2 + * @experimental in 4.3 */ class RuntimeException extends \RuntimeException implements ExceptionInterface { diff --git a/src/Symfony/Component/Messenger/Exception/TransportException.php b/src/Symfony/Component/Messenger/Exception/TransportException.php index e94daba20993b..aaef407b238a9 100644 --- a/src/Symfony/Component/Messenger/Exception/TransportException.php +++ b/src/Symfony/Component/Messenger/Exception/TransportException.php @@ -14,7 +14,7 @@ /** * @author Eric Masoero * - * @experimental in 4.2 + * @experimental in 4.3 */ class TransportException extends RuntimeException { diff --git a/src/Symfony/Component/Messenger/Exception/ValidationFailedException.php b/src/Symfony/Component/Messenger/Exception/ValidationFailedException.php index 414f8a6e92fbc..a05a213526464 100644 --- a/src/Symfony/Component/Messenger/Exception/ValidationFailedException.php +++ b/src/Symfony/Component/Messenger/Exception/ValidationFailedException.php @@ -16,7 +16,7 @@ /** * @author Tobias Nyholm * - * @experimental in 4.2 + * @experimental in 4.3 */ class ValidationFailedException extends \RuntimeException implements ExceptionInterface { diff --git a/src/Symfony/Component/Messenger/HandleTrait.php b/src/Symfony/Component/Messenger/HandleTrait.php index e452b82e24518..1cfec237c16e3 100644 --- a/src/Symfony/Component/Messenger/HandleTrait.php +++ b/src/Symfony/Component/Messenger/HandleTrait.php @@ -19,7 +19,7 @@ * * @author Maxime Steinhausser * - * @experimental in 4.2 + * @experimental in 4.3 */ trait HandleTrait { diff --git a/src/Symfony/Component/Messenger/Handler/HandlersLocator.php b/src/Symfony/Component/Messenger/Handler/HandlersLocator.php index fe83e9288e61f..dda15efba12dd 100644 --- a/src/Symfony/Component/Messenger/Handler/HandlersLocator.php +++ b/src/Symfony/Component/Messenger/Handler/HandlersLocator.php @@ -20,7 +20,7 @@ * @author Nicolas Grekas * @author Samuel Roze * - * @experimental in 4.2 + * @experimental in 4.3 */ class HandlersLocator implements HandlersLocatorInterface { diff --git a/src/Symfony/Component/Messenger/Handler/HandlersLocatorInterface.php b/src/Symfony/Component/Messenger/Handler/HandlersLocatorInterface.php index 80d7786aee555..8b80a649508f1 100644 --- a/src/Symfony/Component/Messenger/Handler/HandlersLocatorInterface.php +++ b/src/Symfony/Component/Messenger/Handler/HandlersLocatorInterface.php @@ -18,7 +18,7 @@ * * @author Nicolas Grekas * - * @experimental in 4.2 + * @experimental in 4.3 */ interface HandlersLocatorInterface { diff --git a/src/Symfony/Component/Messenger/Handler/MessageHandlerInterface.php b/src/Symfony/Component/Messenger/Handler/MessageHandlerInterface.php index 2ea9380e4eb11..00329bc7265a0 100644 --- a/src/Symfony/Component/Messenger/Handler/MessageHandlerInterface.php +++ b/src/Symfony/Component/Messenger/Handler/MessageHandlerInterface.php @@ -16,7 +16,7 @@ * * @author Samuel Roze * - * @experimental in 4.2 + * @experimental in 4.3 */ interface MessageHandlerInterface { diff --git a/src/Symfony/Component/Messenger/Handler/MessageSubscriberInterface.php b/src/Symfony/Component/Messenger/Handler/MessageSubscriberInterface.php index 2b85d46471f0b..f1fe29c568c6b 100644 --- a/src/Symfony/Component/Messenger/Handler/MessageSubscriberInterface.php +++ b/src/Symfony/Component/Messenger/Handler/MessageSubscriberInterface.php @@ -16,7 +16,7 @@ * * @author Samuel Roze * - * @experimental in 4.2 + * @experimental in 4.3 */ interface MessageSubscriberInterface extends MessageHandlerInterface { diff --git a/src/Symfony/Component/Messenger/MessageBus.php b/src/Symfony/Component/Messenger/MessageBus.php index 0698f8e81a250..1f0ff6ac12e84 100644 --- a/src/Symfony/Component/Messenger/MessageBus.php +++ b/src/Symfony/Component/Messenger/MessageBus.php @@ -19,7 +19,7 @@ * @author Matthias Noback * @author Nicolas Grekas * - * @experimental in 4.2 + * @experimental in 4.3 */ class MessageBus implements MessageBusInterface { diff --git a/src/Symfony/Component/Messenger/MessageBusInterface.php b/src/Symfony/Component/Messenger/MessageBusInterface.php index 58b7a631b5307..80a58613f2d35 100644 --- a/src/Symfony/Component/Messenger/MessageBusInterface.php +++ b/src/Symfony/Component/Messenger/MessageBusInterface.php @@ -16,7 +16,7 @@ /** * @author Samuel Roze * - * @experimental in 4.2 + * @experimental in 4.3 */ interface MessageBusInterface { diff --git a/src/Symfony/Component/Messenger/Middleware/ActivationMiddleware.php b/src/Symfony/Component/Messenger/Middleware/ActivationMiddleware.php index 39dcc423ea08a..88290fea9f94e 100644 --- a/src/Symfony/Component/Messenger/Middleware/ActivationMiddleware.php +++ b/src/Symfony/Component/Messenger/Middleware/ActivationMiddleware.php @@ -18,7 +18,7 @@ * * @author Maxime Steinhausser * - * @experimental in 4.2 + * @experimental in 4.3 */ class ActivationMiddleware implements MiddlewareInterface { diff --git a/src/Symfony/Component/Messenger/Middleware/HandleMessageMiddleware.php b/src/Symfony/Component/Messenger/Middleware/HandleMessageMiddleware.php index 25db71c6f0976..f018d5b6a1280 100644 --- a/src/Symfony/Component/Messenger/Middleware/HandleMessageMiddleware.php +++ b/src/Symfony/Component/Messenger/Middleware/HandleMessageMiddleware.php @@ -23,7 +23,7 @@ /** * @author Samuel Roze * - * @experimental in 4.2 + * @experimental in 4.3 */ class HandleMessageMiddleware implements MiddlewareInterface { diff --git a/src/Symfony/Component/Messenger/Middleware/MiddlewareInterface.php b/src/Symfony/Component/Messenger/Middleware/MiddlewareInterface.php index 674bca7e95651..ffa427ddef3cc 100644 --- a/src/Symfony/Component/Messenger/Middleware/MiddlewareInterface.php +++ b/src/Symfony/Component/Messenger/Middleware/MiddlewareInterface.php @@ -16,7 +16,7 @@ /** * @author Samuel Roze * - * @experimental in 4.2 + * @experimental in 4.3 */ interface MiddlewareInterface { diff --git a/src/Symfony/Component/Messenger/Middleware/SendMessageMiddleware.php b/src/Symfony/Component/Messenger/Middleware/SendMessageMiddleware.php index e7dc0baa2a9da..2d401bc850a22 100644 --- a/src/Symfony/Component/Messenger/Middleware/SendMessageMiddleware.php +++ b/src/Symfony/Component/Messenger/Middleware/SendMessageMiddleware.php @@ -26,7 +26,7 @@ * @author Samuel Roze * @author Tobias Schultze * - * @experimental in 4.2 + * @experimental in 4.3 */ class SendMessageMiddleware implements MiddlewareInterface { diff --git a/src/Symfony/Component/Messenger/Middleware/StackInterface.php b/src/Symfony/Component/Messenger/Middleware/StackInterface.php index 17f0acf4aba51..47c4c5922906a 100644 --- a/src/Symfony/Component/Messenger/Middleware/StackInterface.php +++ b/src/Symfony/Component/Messenger/Middleware/StackInterface.php @@ -16,7 +16,7 @@ * * Implementations must be cloneable, and each clone must unstack the stack independently. * - * @experimental in 4.2 + * @experimental in 4.3 */ interface StackInterface { diff --git a/src/Symfony/Component/Messenger/Middleware/StackMiddleware.php b/src/Symfony/Component/Messenger/Middleware/StackMiddleware.php index 4c1c597cf70aa..864a8612a178b 100644 --- a/src/Symfony/Component/Messenger/Middleware/StackMiddleware.php +++ b/src/Symfony/Component/Messenger/Middleware/StackMiddleware.php @@ -16,7 +16,7 @@ /** * @author Nicolas Grekas * - * @experimental in 4.2 + * @experimental in 4.3 */ class StackMiddleware implements MiddlewareInterface, StackInterface { diff --git a/src/Symfony/Component/Messenger/Middleware/TraceableMiddleware.php b/src/Symfony/Component/Messenger/Middleware/TraceableMiddleware.php index 771c14633eb83..ea017f3e951e5 100644 --- a/src/Symfony/Component/Messenger/Middleware/TraceableMiddleware.php +++ b/src/Symfony/Component/Messenger/Middleware/TraceableMiddleware.php @@ -19,7 +19,7 @@ * * @author Maxime Steinhausser * - * @experimental in 4.2 + * @experimental in 4.3 */ class TraceableMiddleware implements MiddlewareInterface { diff --git a/src/Symfony/Component/Messenger/Middleware/ValidationMiddleware.php b/src/Symfony/Component/Messenger/Middleware/ValidationMiddleware.php index 21693ebf347f9..81dfbe75342bc 100644 --- a/src/Symfony/Component/Messenger/Middleware/ValidationMiddleware.php +++ b/src/Symfony/Component/Messenger/Middleware/ValidationMiddleware.php @@ -19,7 +19,7 @@ /** * @author Tobias Nyholm * - * @experimental in 4.2 + * @experimental in 4.3 */ class ValidationMiddleware implements MiddlewareInterface { diff --git a/src/Symfony/Component/Messenger/Stamp/HandledStamp.php b/src/Symfony/Component/Messenger/Stamp/HandledStamp.php index c7987866f5458..2002d08fddb50 100644 --- a/src/Symfony/Component/Messenger/Stamp/HandledStamp.php +++ b/src/Symfony/Component/Messenger/Stamp/HandledStamp.php @@ -21,7 +21,7 @@ * * @author Maxime Steinhausser * - * @experimental in 4.2 + * @experimental in 4.3 */ final class HandledStamp implements StampInterface { diff --git a/src/Symfony/Component/Messenger/Stamp/ReceivedStamp.php b/src/Symfony/Component/Messenger/Stamp/ReceivedStamp.php index 07e998f720397..3296cde1d316c 100644 --- a/src/Symfony/Component/Messenger/Stamp/ReceivedStamp.php +++ b/src/Symfony/Component/Messenger/Stamp/ReceivedStamp.php @@ -23,7 +23,7 @@ * * @author Samuel Roze * - * @experimental in 4.2 + * @experimental in 4.3 */ final class ReceivedStamp implements StampInterface { diff --git a/src/Symfony/Component/Messenger/Stamp/SentStamp.php b/src/Symfony/Component/Messenger/Stamp/SentStamp.php index b0b8da8b16705..3f1a8f718661a 100644 --- a/src/Symfony/Component/Messenger/Stamp/SentStamp.php +++ b/src/Symfony/Component/Messenger/Stamp/SentStamp.php @@ -18,7 +18,7 @@ * * @author Maxime Steinhausser * - * @experimental in 4.2 + * @experimental in 4.3 */ final class SentStamp implements StampInterface { diff --git a/src/Symfony/Component/Messenger/Stamp/SerializerStamp.php b/src/Symfony/Component/Messenger/Stamp/SerializerStamp.php index 4b869e2b32470..0ab43950f4d0d 100644 --- a/src/Symfony/Component/Messenger/Stamp/SerializerStamp.php +++ b/src/Symfony/Component/Messenger/Stamp/SerializerStamp.php @@ -14,7 +14,7 @@ /** * @author Maxime Steinhausser * - * @experimental in 4.2 + * @experimental in 4.3 */ final class SerializerStamp implements StampInterface { diff --git a/src/Symfony/Component/Messenger/Stamp/StampInterface.php b/src/Symfony/Component/Messenger/Stamp/StampInterface.php index fc82ac75e40fc..8c29a444c18cd 100644 --- a/src/Symfony/Component/Messenger/Stamp/StampInterface.php +++ b/src/Symfony/Component/Messenger/Stamp/StampInterface.php @@ -18,7 +18,7 @@ * * @author Maxime Steinhausser * - * @experimental in 4.2 + * @experimental in 4.3 */ interface StampInterface { diff --git a/src/Symfony/Component/Messenger/Stamp/ValidationStamp.php b/src/Symfony/Component/Messenger/Stamp/ValidationStamp.php index e031f04d3ad42..bdd28ac4cc9b0 100644 --- a/src/Symfony/Component/Messenger/Stamp/ValidationStamp.php +++ b/src/Symfony/Component/Messenger/Stamp/ValidationStamp.php @@ -16,7 +16,7 @@ /** * @author Maxime Steinhausser * - * @experimental in 4.2 + * @experimental in 4.3 */ final class ValidationStamp implements StampInterface { diff --git a/src/Symfony/Component/Messenger/Test/Middleware/MiddlewareTestCase.php b/src/Symfony/Component/Messenger/Test/Middleware/MiddlewareTestCase.php index 5970cf285fc44..e02bd6e6d4dca 100644 --- a/src/Symfony/Component/Messenger/Test/Middleware/MiddlewareTestCase.php +++ b/src/Symfony/Component/Messenger/Test/Middleware/MiddlewareTestCase.php @@ -20,7 +20,7 @@ /** * @author Nicolas Grekas * - * @experimental in 4.2 + * @experimental in 4.3 */ abstract class MiddlewareTestCase extends TestCase { diff --git a/src/Symfony/Component/Messenger/TraceableMessageBus.php b/src/Symfony/Component/Messenger/TraceableMessageBus.php index f370c6d8aa028..e8ef5b0907d6b 100644 --- a/src/Symfony/Component/Messenger/TraceableMessageBus.php +++ b/src/Symfony/Component/Messenger/TraceableMessageBus.php @@ -14,7 +14,7 @@ /** * @author Samuel Roze * - * @experimental in 4.2 + * @experimental in 4.3 */ class TraceableMessageBus implements MessageBusInterface { diff --git a/src/Symfony/Component/Messenger/Transport/AmqpExt/AmqpFactory.php b/src/Symfony/Component/Messenger/Transport/AmqpExt/AmqpFactory.php index aa1dca15f126d..5ea6f6ccbedbe 100644 --- a/src/Symfony/Component/Messenger/Transport/AmqpExt/AmqpFactory.php +++ b/src/Symfony/Component/Messenger/Transport/AmqpExt/AmqpFactory.php @@ -12,7 +12,7 @@ namespace Symfony\Component\Messenger\Transport\AmqpExt; /** - * @experimental in 4.2 + * @experimental in 4.3 */ class AmqpFactory { diff --git a/src/Symfony/Component/Messenger/Transport/AmqpExt/AmqpReceiver.php b/src/Symfony/Component/Messenger/Transport/AmqpExt/AmqpReceiver.php index db2f1202f91ee..3c0f48eaa28dc 100644 --- a/src/Symfony/Component/Messenger/Transport/AmqpExt/AmqpReceiver.php +++ b/src/Symfony/Component/Messenger/Transport/AmqpExt/AmqpReceiver.php @@ -25,7 +25,7 @@ * * @author Samuel Roze * - * @experimental in 4.2 + * @experimental in 4.3 */ class AmqpReceiver implements ReceiverInterface, MessageCountAwareInterface { diff --git a/src/Symfony/Component/Messenger/Transport/AmqpExt/AmqpSender.php b/src/Symfony/Component/Messenger/Transport/AmqpExt/AmqpSender.php index b873312a6736c..c570c4cb33a7c 100644 --- a/src/Symfony/Component/Messenger/Transport/AmqpExt/AmqpSender.php +++ b/src/Symfony/Component/Messenger/Transport/AmqpExt/AmqpSender.php @@ -23,7 +23,7 @@ * * @author Samuel Roze * - * @experimental in 4.2 + * @experimental in 4.3 */ class AmqpSender implements SenderInterface { diff --git a/src/Symfony/Component/Messenger/Transport/AmqpExt/AmqpTransport.php b/src/Symfony/Component/Messenger/Transport/AmqpExt/AmqpTransport.php index 242a1382304ee..2c3e2c3d57b2f 100644 --- a/src/Symfony/Component/Messenger/Transport/AmqpExt/AmqpTransport.php +++ b/src/Symfony/Component/Messenger/Transport/AmqpExt/AmqpTransport.php @@ -21,7 +21,7 @@ /** * @author Nicolas Grekas * - * @experimental in 4.2 + * @experimental in 4.3 */ class AmqpTransport implements TransportInterface, SetupableTransportInterface, MessageCountAwareInterface { diff --git a/src/Symfony/Component/Messenger/Transport/AmqpExt/AmqpTransportFactory.php b/src/Symfony/Component/Messenger/Transport/AmqpExt/AmqpTransportFactory.php index d4293e12070dd..35cb4eb1c4e98 100644 --- a/src/Symfony/Component/Messenger/Transport/AmqpExt/AmqpTransportFactory.php +++ b/src/Symfony/Component/Messenger/Transport/AmqpExt/AmqpTransportFactory.php @@ -18,7 +18,7 @@ /** * @author Samuel Roze * - * @experimental in 4.2 + * @experimental in 4.3 */ class AmqpTransportFactory implements TransportFactoryInterface { diff --git a/src/Symfony/Component/Messenger/Transport/AmqpExt/Connection.php b/src/Symfony/Component/Messenger/Transport/AmqpExt/Connection.php index bdd04c56c964e..51ef98dd31929 100644 --- a/src/Symfony/Component/Messenger/Transport/AmqpExt/Connection.php +++ b/src/Symfony/Component/Messenger/Transport/AmqpExt/Connection.php @@ -20,7 +20,7 @@ * * @final * - * @experimental in 4.2 + * @experimental in 4.3 */ class Connection { diff --git a/src/Symfony/Component/Messenger/Transport/Receiver/ReceiverInterface.php b/src/Symfony/Component/Messenger/Transport/Receiver/ReceiverInterface.php index 6393c0d8c16a0..b053acbd5fdf6 100644 --- a/src/Symfony/Component/Messenger/Transport/Receiver/ReceiverInterface.php +++ b/src/Symfony/Component/Messenger/Transport/Receiver/ReceiverInterface.php @@ -18,7 +18,7 @@ * @author Samuel Roze * @author Ryan Weaver * - * @experimental in 4.2 + * @experimental in 4.3 */ interface ReceiverInterface { diff --git a/src/Symfony/Component/Messenger/Transport/Sender/SenderInterface.php b/src/Symfony/Component/Messenger/Transport/Sender/SenderInterface.php index 719442188ffbb..b0824f9fc98b0 100644 --- a/src/Symfony/Component/Messenger/Transport/Sender/SenderInterface.php +++ b/src/Symfony/Component/Messenger/Transport/Sender/SenderInterface.php @@ -16,7 +16,7 @@ /** * @author Samuel Roze * - * @experimental in 4.2 + * @experimental in 4.3 */ interface SenderInterface { diff --git a/src/Symfony/Component/Messenger/Transport/Sender/SendersLocator.php b/src/Symfony/Component/Messenger/Transport/Sender/SendersLocator.php index 2f7a1e971dca3..4c83d8a881953 100644 --- a/src/Symfony/Component/Messenger/Transport/Sender/SendersLocator.php +++ b/src/Symfony/Component/Messenger/Transport/Sender/SendersLocator.php @@ -23,7 +23,7 @@ * * @author Fabien Potencier * - * @experimental in 4.2 + * @experimental in 4.3 */ class SendersLocator implements SendersLocatorInterface { diff --git a/src/Symfony/Component/Messenger/Transport/Sender/SendersLocatorInterface.php b/src/Symfony/Component/Messenger/Transport/Sender/SendersLocatorInterface.php index bc9a87b17740f..9b63ebe225dc8 100644 --- a/src/Symfony/Component/Messenger/Transport/Sender/SendersLocatorInterface.php +++ b/src/Symfony/Component/Messenger/Transport/Sender/SendersLocatorInterface.php @@ -20,7 +20,7 @@ * @author Samuel Roze * @author Tobias Schultze * - * @experimental in 4.2 + * @experimental in 4.3 */ interface SendersLocatorInterface { diff --git a/src/Symfony/Component/Messenger/Transport/Serialization/PhpSerializer.php b/src/Symfony/Component/Messenger/Transport/Serialization/PhpSerializer.php index b65c0fcf63418..793da4a44802a 100644 --- a/src/Symfony/Component/Messenger/Transport/Serialization/PhpSerializer.php +++ b/src/Symfony/Component/Messenger/Transport/Serialization/PhpSerializer.php @@ -18,7 +18,7 @@ /** * @author Ryan Weaver * - * @experimental in 4.2 + * @experimental in 4.3 */ class PhpSerializer implements SerializerInterface { diff --git a/src/Symfony/Component/Messenger/Transport/Serialization/Serializer.php b/src/Symfony/Component/Messenger/Transport/Serialization/Serializer.php index 798b9a55262cb..c591acd05081e 100644 --- a/src/Symfony/Component/Messenger/Transport/Serialization/Serializer.php +++ b/src/Symfony/Component/Messenger/Transport/Serialization/Serializer.php @@ -28,7 +28,7 @@ /** * @author Samuel Roze * - * @experimental in 4.2 + * @experimental in 4.3 */ class Serializer implements SerializerInterface { diff --git a/src/Symfony/Component/Messenger/Transport/Serialization/SerializerInterface.php b/src/Symfony/Component/Messenger/Transport/Serialization/SerializerInterface.php index 01a4abc16e4bf..492e003f79f4e 100644 --- a/src/Symfony/Component/Messenger/Transport/Serialization/SerializerInterface.php +++ b/src/Symfony/Component/Messenger/Transport/Serialization/SerializerInterface.php @@ -17,7 +17,7 @@ /** * @author Samuel Roze * - * @experimental in 4.2 + * @experimental in 4.3 */ interface SerializerInterface { diff --git a/src/Symfony/Component/Messenger/Transport/TransportFactory.php b/src/Symfony/Component/Messenger/Transport/TransportFactory.php index 6614ef3a9053b..85bf85639e155 100644 --- a/src/Symfony/Component/Messenger/Transport/TransportFactory.php +++ b/src/Symfony/Component/Messenger/Transport/TransportFactory.php @@ -17,7 +17,7 @@ /** * @author Samuel Roze * - * @experimental in 4.2 + * @experimental in 4.3 */ class TransportFactory implements TransportFactoryInterface { diff --git a/src/Symfony/Component/Messenger/Transport/TransportFactoryInterface.php b/src/Symfony/Component/Messenger/Transport/TransportFactoryInterface.php index 7c3c3a65cdb0e..42bb4ed7bf31b 100644 --- a/src/Symfony/Component/Messenger/Transport/TransportFactoryInterface.php +++ b/src/Symfony/Component/Messenger/Transport/TransportFactoryInterface.php @@ -18,7 +18,7 @@ * * @author Samuel Roze * - * @experimental in 4.2 + * @experimental in 4.3 */ interface TransportFactoryInterface { diff --git a/src/Symfony/Component/Messenger/Transport/TransportInterface.php b/src/Symfony/Component/Messenger/Transport/TransportInterface.php index 7a46b332a6faa..f2e9c9430ef49 100644 --- a/src/Symfony/Component/Messenger/Transport/TransportInterface.php +++ b/src/Symfony/Component/Messenger/Transport/TransportInterface.php @@ -17,7 +17,7 @@ /** * @author Nicolas Grekas * - * @experimental in 4.2 + * @experimental in 4.3 */ interface TransportInterface extends ReceiverInterface, SenderInterface { diff --git a/src/Symfony/Component/Messenger/Worker.php b/src/Symfony/Component/Messenger/Worker.php index 4018755ff633b..4d52eb63ba772 100644 --- a/src/Symfony/Component/Messenger/Worker.php +++ b/src/Symfony/Component/Messenger/Worker.php @@ -30,7 +30,7 @@ /** * @author Samuel Roze * - * @experimental in 4.2 + * @experimental in 4.3 * * @final */ From 3c8d63ca82cfcad5744df0d9dafa090bde147504 Mon Sep 17 00:00:00 2001 From: Victor Bocharsky Date: Tue, 28 May 2019 14:30:37 +0300 Subject: [PATCH 45/47] Create an abstract HTTP transport and extend it in all HTTP transports --- .../Bridge/Amazon/Http/SesTransport.php | 9 ++-- .../Mailchimp/Http/MandrillTransport.php | 9 ++-- .../Bridge/Mailgun/Http/MailgunTransport.php | 9 ++-- .../Transport/Http/AbstractHttpTransport.php | 42 +++++++++++++++++++ 4 files changed, 51 insertions(+), 18 deletions(-) create mode 100644 src/Symfony/Component/Mailer/Transport/Http/AbstractHttpTransport.php diff --git a/src/Symfony/Component/Mailer/Bridge/Amazon/Http/SesTransport.php b/src/Symfony/Component/Mailer/Bridge/Amazon/Http/SesTransport.php index df635c4b1c172..fd3787a5c2314 100644 --- a/src/Symfony/Component/Mailer/Bridge/Amazon/Http/SesTransport.php +++ b/src/Symfony/Component/Mailer/Bridge/Amazon/Http/SesTransport.php @@ -13,10 +13,9 @@ use Psr\Log\LoggerInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface; -use Symfony\Component\HttpClient\HttpClient; use Symfony\Component\Mailer\Exception\TransportException; use Symfony\Component\Mailer\SentMessage; -use Symfony\Component\Mailer\Transport\AbstractTransport; +use Symfony\Component\Mailer\Transport\Http\AbstractHttpTransport; use Symfony\Contracts\HttpClient\HttpClientInterface; /** @@ -24,11 +23,10 @@ * * @experimental in 4.3 */ -class SesTransport extends AbstractTransport +class SesTransport extends AbstractHttpTransport { private const ENDPOINT = 'https://email.%region%.amazonaws.com'; - private $client; private $accessKey; private $secretKey; private $region; @@ -38,12 +36,11 @@ class SesTransport extends AbstractTransport */ public function __construct(string $accessKey, string $secretKey, string $region = null, HttpClientInterface $client = null, EventDispatcherInterface $dispatcher = null, LoggerInterface $logger = null) { - $this->client = $client ?? HttpClient::create(); $this->accessKey = $accessKey; $this->secretKey = $secretKey; $this->region = $region ?: 'eu-west-1'; - parent::__construct($dispatcher, $logger); + parent::__construct($client, $dispatcher, $logger); } protected function doSend(SentMessage $message): void diff --git a/src/Symfony/Component/Mailer/Bridge/Mailchimp/Http/MandrillTransport.php b/src/Symfony/Component/Mailer/Bridge/Mailchimp/Http/MandrillTransport.php index a54251d9b4749..ea8bcf4dbbba5 100644 --- a/src/Symfony/Component/Mailer/Bridge/Mailchimp/Http/MandrillTransport.php +++ b/src/Symfony/Component/Mailer/Bridge/Mailchimp/Http/MandrillTransport.php @@ -13,10 +13,9 @@ use Psr\Log\LoggerInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface; -use Symfony\Component\HttpClient\HttpClient; use Symfony\Component\Mailer\Exception\TransportException; use Symfony\Component\Mailer\SentMessage; -use Symfony\Component\Mailer\Transport\AbstractTransport; +use Symfony\Component\Mailer\Transport\Http\AbstractHttpTransport; use Symfony\Contracts\HttpClient\HttpClientInterface; /** @@ -24,18 +23,16 @@ * * @experimental in 4.3 */ -class MandrillTransport extends AbstractTransport +class MandrillTransport extends AbstractHttpTransport { private const ENDPOINT = 'https://mandrillapp.com/api/1.0/messages/send-raw.json'; - private $client; private $key; public function __construct(string $key, HttpClientInterface $client = null, EventDispatcherInterface $dispatcher = null, LoggerInterface $logger = null) { $this->key = $key; - $this->client = $client ?? HttpClient::create(); - parent::__construct($dispatcher, $logger); + parent::__construct($client, $dispatcher, $logger); } protected function doSend(SentMessage $message): void diff --git a/src/Symfony/Component/Mailer/Bridge/Mailgun/Http/MailgunTransport.php b/src/Symfony/Component/Mailer/Bridge/Mailgun/Http/MailgunTransport.php index 940cabc6ea8c8..2d3fe15a08eb9 100644 --- a/src/Symfony/Component/Mailer/Bridge/Mailgun/Http/MailgunTransport.php +++ b/src/Symfony/Component/Mailer/Bridge/Mailgun/Http/MailgunTransport.php @@ -13,10 +13,9 @@ use Psr\Log\LoggerInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface; -use Symfony\Component\HttpClient\HttpClient; use Symfony\Component\Mailer\Exception\TransportException; use Symfony\Component\Mailer\SentMessage; -use Symfony\Component\Mailer\Transport\AbstractTransport; +use Symfony\Component\Mailer\Transport\Http\AbstractHttpTransport; use Symfony\Component\Mime\Part\DataPart; use Symfony\Component\Mime\Part\Multipart\FormDataPart; use Symfony\Contracts\HttpClient\HttpClientInterface; @@ -26,20 +25,18 @@ * * @experimental in 4.3 */ -class MailgunTransport extends AbstractTransport +class MailgunTransport extends AbstractHttpTransport { private const ENDPOINT = 'https://api.mailgun.net/v3/%domain%/messages.mime'; private $key; private $domain; - private $client; public function __construct(string $key, string $domain, HttpClientInterface $client = null, EventDispatcherInterface $dispatcher = null, LoggerInterface $logger = null) { $this->key = $key; $this->domain = $domain; - $this->client = $client ?? HttpClient::create(); - parent::__construct($dispatcher, $logger); + parent::__construct($client, $dispatcher, $logger); } protected function doSend(SentMessage $message): void diff --git a/src/Symfony/Component/Mailer/Transport/Http/AbstractHttpTransport.php b/src/Symfony/Component/Mailer/Transport/Http/AbstractHttpTransport.php new file mode 100644 index 0000000000000..f431c2fe8530b --- /dev/null +++ b/src/Symfony/Component/Mailer/Transport/Http/AbstractHttpTransport.php @@ -0,0 +1,42 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Mailer\Transport\Http; + +use Psr\Log\LoggerInterface; +use Symfony\Component\EventDispatcher\EventDispatcherInterface; +use Symfony\Component\HttpClient\HttpClient; +use Symfony\Component\Mailer\Transport\AbstractTransport; +use Symfony\Contracts\HttpClient\HttpClientInterface; + +/** + * @author Victor Bocharsky + * + * @experimental in 4.3 + */ +abstract class AbstractHttpTransport extends AbstractTransport +{ + protected $client; + + public function __construct(HttpClientInterface $client = null, EventDispatcherInterface $dispatcher = null, LoggerInterface $logger = null) + { + $this->client = $client; + if (null === $client) { + if (!class_exists(HttpClient::class)) { + throw new \LogicException(sprintf('You cannot use "%s" as the HttpClient component is not installed. Try running "composer require symfony/http-client".', __CLASS__)); + } + + $this->client = HttpClient::create(); + } + + parent::__construct($dispatcher, $logger); + } +} From 7d3a8994fbd2dbeea8594e1eec4acbf962fd12f4 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 28 May 2019 14:31:56 +0200 Subject: [PATCH 46/47] updated CHANGELOG for 4.3.0-RC1 --- CHANGELOG-4.3.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/CHANGELOG-4.3.md b/CHANGELOG-4.3.md index 26e086b34eee5..9f06cb0767017 100644 --- a/CHANGELOG-4.3.md +++ b/CHANGELOG-4.3.md @@ -7,6 +7,26 @@ in 4.3 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.3.0...v4.3.1 +* 4.3.0-RC1 (2019-05-28) + + * bug #31650 Create an abstract HTTP transport and extend it in all HTTP transports (bocharsky-bw) + * feature #31641 [HttpClient] make $response->getInfo('debug') return extended logs about the HTTP transaction (nicolas-grekas) + * feature #31571 [Contracts] split in one package per sub-contracts (nicolas-grekas) + * bug #31625 [Messenger] Disable the SchemaAssetsFilter when setup the transport (vincenttouzet) + * bug #31621 [Messenger] Fix missing auto_setup for RedisTransport (chalasr) + * bug #31584 [Workflow] Do not trigger extra guards (lyrixx) + * bug #31632 [Messenger] Use "real" memory usage to honor --memory-limit (chalasr) + * bug #31610 [HttpClient] fix handling exceptions thrown before first mock chunk (nicolas-grekas) + * bug #31615 Allow WrappedListener to describe uncallable listeners (derrabus) + * bug #31599 [Translation] Fixed issue with new vs old TranslatorInterface in TranslationDataCollector (althaus) + * bug #31565 [Mime][HttpFoundation] Added mime type audio/x-hx-aac-adts (ifaridjalilov) + * bug #31591 [FrameworkBundle] fix named autowiring aliases for TagAwareCacheInterface (nicolas-grekas) + * bug #31590 [Cache] improve logged messages (nicolas-grekas) + * bug #31586 [HttpClient] display proper error message on TransportException when curl is used (nicolas-grekas) + * bug #31349 [WebProfilerBundle] Use absolute URL for profiler links (Alumbrados) + * bug #31541 [DI] fix using bindings with locators of service subscribers (nicolas-grekas) + * bug #31568 [Process] Fix infinite waiting for stopped process (mshavliuk) + * 4.3.0-BETA2 (2019-05-22) * bug #31569 [HttpClient] Only use CURLMOPT_MAX_HOST_CONNECTIONS & CURL_VERSION_HTTP2 if defined (GawainLynch) From 70c35d364304ef3a3f397997aafe79a23a603ac4 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 28 May 2019 14:33:09 +0200 Subject: [PATCH 47/47] updated VERSION for 4.3.0-RC1 --- src/Symfony/Component/HttpKernel/Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index 0dcdc717d9b22..785ce496f5d49 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -73,12 +73,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl private $requestStackSize = 0; private $resetServices = false; - const VERSION = '4.3.0-DEV'; + const VERSION = '4.3.0-RC1'; const VERSION_ID = 40300; const MAJOR_VERSION = 4; const MINOR_VERSION = 3; const RELEASE_VERSION = 0; - const EXTRA_VERSION = 'DEV'; + const EXTRA_VERSION = 'RC1'; const END_OF_MAINTENANCE = '01/2020'; const END_OF_LIFE = '07/2020';