From 24150370c3cad7564bed19d112fb4c8dd281d32a Mon Sep 17 00:00:00 2001 From: Thomas Calvet Date: Wed, 15 Apr 2020 11:19:47 +0200 Subject: [PATCH 01/15] [DependencyInjection][ServiceSubscriber] Support late aliases --- .../DependencyInjection/Dumper/PhpDumper.php | 6 ++++- .../RegisterServiceSubscribersPassTest.php | 3 +++ .../Tests/Dumper/PhpDumperTest.php | 17 +++++++++++++ .../Tests/Fixtures/TestServiceSubscriber.php | 1 + .../Fixtures/php/services_subscriber.php | 24 +++++++++++++++---- 5 files changed, 46 insertions(+), 5 deletions(-) diff --git a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php index 982472f5ad..4a84cd1a24 100644 --- a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php +++ b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php @@ -1700,7 +1700,11 @@ EOF; if (!$v) { continue; } - $definition = $this->container->findDefinition($id = (string) $v); + $id = (string) $v; + while ($this->container->hasAlias($id)) { + $id = (string) $this->container->getAlias($id); + } + $definition = $this->container->getDefinition($id); $load = !($definition->hasErrors() && $e = $definition->getErrors()) ? $this->asFiles && !$this->inlineFactories && !$this->isHotPath($definition) : reset($e); $serviceMap .= sprintf("\n %s => [%s, %s, %s, %s],", $this->export($k), diff --git a/src/Symfony/Component/DependencyInjection/Tests/Compiler/RegisterServiceSubscribersPassTest.php b/src/Symfony/Component/DependencyInjection/Tests/Compiler/RegisterServiceSubscribersPassTest.php index 77b1969f60..d8e7d62d47 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Compiler/RegisterServiceSubscribersPassTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Compiler/RegisterServiceSubscribersPassTest.php @@ -88,6 +88,7 @@ class RegisterServiceSubscribersPassTest extends TestCase CustomDefinition::class => new ServiceClosureArgument(new TypedReference(CustomDefinition::class, CustomDefinition::class, ContainerInterface::IGNORE_ON_INVALID_REFERENCE)), 'bar' => new ServiceClosureArgument(new TypedReference(CustomDefinition::class, CustomDefinition::class, ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE, 'bar')), 'baz' => new ServiceClosureArgument(new TypedReference(CustomDefinition::class, CustomDefinition::class, ContainerInterface::IGNORE_ON_INVALID_REFERENCE, 'baz')), + 'late_alias' => new ServiceClosureArgument(new TypedReference(TestDefinition1::class, TestDefinition1::class, ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE, 'late_alias')), ]; $this->assertEquals($expected, $container->getDefinition((string) $locator->getFactory()[0])->getArgument(0)); @@ -118,6 +119,7 @@ class RegisterServiceSubscribersPassTest extends TestCase CustomDefinition::class => new ServiceClosureArgument(new TypedReference(CustomDefinition::class, CustomDefinition::class, ContainerInterface::IGNORE_ON_INVALID_REFERENCE)), 'bar' => new ServiceClosureArgument(new TypedReference('bar', CustomDefinition::class, ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE, 'bar')), 'baz' => new ServiceClosureArgument(new TypedReference(CustomDefinition::class, CustomDefinition::class, ContainerInterface::IGNORE_ON_INVALID_REFERENCE, 'baz')), + 'late_alias' => new ServiceClosureArgument(new TypedReference(TestDefinition1::class, TestDefinition1::class, ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE, 'late_alias')), ]; $this->assertEquals($expected, $container->getDefinition((string) $locator->getFactory()[0])->getArgument(0)); @@ -260,6 +262,7 @@ class RegisterServiceSubscribersPassTest extends TestCase CustomDefinition::class => new ServiceClosureArgument(new TypedReference(CustomDefinition::class, CustomDefinition::class, ContainerInterface::IGNORE_ON_INVALID_REFERENCE)), 'bar' => new ServiceClosureArgument(new TypedReference(CustomDefinition::class, CustomDefinition::class, ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE, 'bar')), 'baz' => new ServiceClosureArgument(new TypedReference(CustomDefinition::class, CustomDefinition::class, ContainerInterface::IGNORE_ON_INVALID_REFERENCE, 'baz')), + 'late_alias' => new ServiceClosureArgument(new TypedReference(TestDefinition1::class, TestDefinition1::class, ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE, 'late_alias')), ]; $this->assertEquals($expected, $container->getDefinition((string) $locator->getFactory()[0])->getArgument(0)); diff --git a/src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php b/src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php index 60f1ab1d4f..51a88705d6 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php @@ -19,6 +19,8 @@ use Symfony\Component\DependencyInjection\Argument\IteratorArgument; use Symfony\Component\DependencyInjection\Argument\RewindableGenerator; use Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument; use Symfony\Component\DependencyInjection\Argument\ServiceLocator as ArgumentServiceLocator; +use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; +use Symfony\Component\DependencyInjection\Compiler\PassConfig; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\ContainerInterface as SymfonyContainerInterface; use Symfony\Component\DependencyInjection\Definition; @@ -35,6 +37,7 @@ use Symfony\Component\DependencyInjection\Tests\Compiler\Wither; use Symfony\Component\DependencyInjection\Tests\Fixtures\CustomDefinition; use Symfony\Component\DependencyInjection\Tests\Fixtures\ScalarFactory; use Symfony\Component\DependencyInjection\Tests\Fixtures\StubbedTranslator; +use Symfony\Component\DependencyInjection\Tests\Fixtures\TestDefinition1; use Symfony\Component\DependencyInjection\Tests\Fixtures\TestServiceSubscriber; use Symfony\Component\DependencyInjection\TypedReference; use Symfony\Component\DependencyInjection\Variable; @@ -906,6 +909,20 @@ class PhpDumperTest extends TestCase $container->register(CustomDefinition::class, CustomDefinition::class) ->setPublic(false); + + $container->register(TestDefinition1::class, TestDefinition1::class)->setPublic(true); + + $container->addCompilerPass(new class() implements CompilerPassInterface { + /** + * {@inheritdoc} + */ + public function process(ContainerBuilder $container) + { + $container->setDefinition('late_alias', new Definition(TestDefinition1::class)); + $container->setAlias(TestDefinition1::class, 'late_alias'); + } + }, PassConfig::TYPE_AFTER_REMOVING); + $container->compile(); $dumper = new PhpDumper($container); diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/TestServiceSubscriber.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/TestServiceSubscriber.php index 6876fc5cca..f4a4bdda64 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/TestServiceSubscriber.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/TestServiceSubscriber.php @@ -22,6 +22,7 @@ class TestServiceSubscriber implements ServiceSubscriberInterface '?'.CustomDefinition::class, 'bar' => CustomDefinition::class, 'baz' => '?'.CustomDefinition::class, + 'late_alias' => TestDefinition1::class, ]; } } diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_subscriber.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_subscriber.php index e184fad7bd..caec312fdd 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_subscriber.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_subscriber.php @@ -27,9 +27,11 @@ class ProjectServiceContainer extends Container $this->methodMap = [ 'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\TestServiceSubscriber' => 'getTestServiceSubscriberService', 'foo_service' => 'getFooServiceService', + 'late_alias' => 'getLateAliasService', + ]; + $this->aliases = [ + 'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\TestDefinition1' => 'late_alias', ]; - - $this->aliases = []; } public function compile(): void @@ -45,11 +47,13 @@ class ProjectServiceContainer extends Container public function getRemovedIds(): array { return [ - '.service_locator.bPEFRiK' => true, - '.service_locator.bPEFRiK.foo_service' => true, + '.service_locator.CpwjbIa' => true, + '.service_locator.CpwjbIa.foo_service' => true, 'Psr\\Container\\ContainerInterface' => true, 'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true, 'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\CustomDefinition' => true, + 'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\TestDefinition1' => true, + 'late_alias' => true, ]; } @@ -75,14 +79,26 @@ class ProjectServiceContainer extends Container 'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\TestServiceSubscriber' => ['services', 'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\TestServiceSubscriber', 'getTestServiceSubscriberService', false], 'bar' => ['services', 'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\TestServiceSubscriber', 'getTestServiceSubscriberService', false], 'baz' => ['privates', 'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\CustomDefinition', 'getCustomDefinitionService', false], + 'late_alias' => ['services', 'late_alias', 'getLateAliasService', false], ], [ 'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\CustomDefinition' => 'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\CustomDefinition', 'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\TestServiceSubscriber' => 'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\TestServiceSubscriber', 'bar' => 'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\CustomDefinition', 'baz' => 'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\CustomDefinition', + 'late_alias' => 'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\TestDefinition1', ]))->withContext('foo_service', $this)); } + /** + * Gets the public 'late_alias' shared service. + * + * @return \Symfony\Component\DependencyInjection\Tests\Fixtures\TestDefinition1 + */ + protected function getLateAliasService() + { + return $this->services['late_alias'] = new \Symfony\Component\DependencyInjection\Tests\Fixtures\TestDefinition1(); + } + /** * Gets the private 'Symfony\Component\DependencyInjection\Tests\Fixtures\CustomDefinition' shared service. * From d34b437ce0e3f6a28f3bc5bcf8d8979c972ae5da Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Tue, 21 Apr 2020 14:33:50 -0400 Subject: [PATCH 02/15] Fixing a bug where class_alias would cause incorrect items in debug:autowiring --- .../Command/DebugAutowiringCommand.php | 3 ++- .../Tests/Fixtures/ClassAliasExampleClass.php | 14 ++++++++++++++ .../Tests/Fixtures/ClassAliasTargetClass.php | 7 +++++++ .../Functional/DebugAutowiringCommandTest.php | 12 ++++++++++++ .../Tests/Functional/app/ContainerDebug/config.yml | 1 + 5 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/ClassAliasExampleClass.php create mode 100644 src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/ClassAliasTargetClass.php diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/DebugAutowiringCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/DebugAutowiringCommand.php index 04d391da17..32bd630f32 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/DebugAutowiringCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/DebugAutowiringCommand.php @@ -103,9 +103,10 @@ EOF $serviceIdsNb = 0; foreach ($serviceIds as $serviceId) { $text = []; + $resolvedServiceId = $serviceId; if (0 !== strpos($serviceId, $previousId)) { $text[] = ''; - if ('' !== $description = Descriptor::getClassDescription($serviceId, $serviceId)) { + if ('' !== $description = Descriptor::getClassDescription($serviceId, $resolvedServiceId)) { if (isset($hasAlias[$serviceId])) { continue; } diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/ClassAliasExampleClass.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/ClassAliasExampleClass.php new file mode 100644 index 0000000000..c129865859 --- /dev/null +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/ClassAliasExampleClass.php @@ -0,0 +1,14 @@ +run(['command' => 'debug:autowiring', 'search' => 'redirect', '--all' => true]); $this->assertStringContainsString('Pro-tip: use interfaces in your type-hints instead of classes to benefit from the dependency inversion principle.', $tester->getDisplay()); } + + public function testNotConfusedByClassAliases() + { + static::bootKernel(['test_case' => 'ContainerDebug', 'root_config' => 'config.yml']); + + $application = new Application(static::$kernel); + $application->setAutoExit(false); + + $tester = new ApplicationTester($application); + $tester->run(['command' => 'debug:autowiring', 'search' => 'ClassAlias']); + $this->assertStringContainsString('Symfony\Bundle\FrameworkBundle\Tests\Fixtures\ClassAliasExampleClass (public)', $tester->getDisplay()); + } } diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/ContainerDebug/config.yml b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/ContainerDebug/config.yml index 0cc73dbc81..25c1c78429 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/ContainerDebug/config.yml +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/ContainerDebug/config.yml @@ -13,6 +13,7 @@ services: public: false Symfony\Bundle\FrameworkBundle\Tests\Fixtures\BackslashClass: class: Symfony\Bundle\FrameworkBundle\Tests\Fixtures\BackslashClass + Symfony\Bundle\FrameworkBundle\Tests\Fixtures\ClassAliasExampleClass: '@public' env: class: stdClass arguments: From 3c24cfecdd3ae40ffdc4450bc2f6a9df8f18ff88 Mon Sep 17 00:00:00 2001 From: Dimitri Gritsajuk Date: Wed, 22 Apr 2020 12:28:41 +0200 Subject: [PATCH 03/15] [Form] apply automatically step=1 for datetime-local input --- .../Form/Extension/Core/Type/DateTimeType.php | 8 +++++ .../Extension/Core/Type/DateTimeTypeTest.php | 31 +++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/src/Symfony/Component/Form/Extension/Core/Type/DateTimeType.php b/src/Symfony/Component/Form/Extension/Core/Type/DateTimeType.php index 4a7c75b265..fc701d5203 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/DateTimeType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/DateTimeType.php @@ -203,6 +203,14 @@ class DateTimeType extends AbstractType // * the html5 is set to true if ($options['html5'] && 'single_text' === $options['widget'] && self::HTML5_FORMAT === $options['format']) { $view->vars['type'] = 'datetime-local'; + + // we need to force the browser to display the seconds by + // adding the HTML attribute step if not already defined. + // Otherwise the browser will not display and so not send the seconds + // therefore the value will always be considered as invalid. + if ($options['with_seconds'] && !isset($view->vars['attr']['step'])) { + $view->vars['attr']['step'] = 1; + } } } diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTimeTypeTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTimeTypeTest.php index 8af524f1fc..53edd21b91 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTimeTypeTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTimeTypeTest.php @@ -444,6 +444,37 @@ class DateTimeTypeTest extends BaseTypeTest $this->assertArrayNotHasKey('type', $view->vars); } + public function testSingleTextWidgetWithSecondsShouldHaveRightStepAttribute() + { + $view = $this->factory + ->create(static::TESTED_TYPE, null, [ + 'widget' => 'single_text', + 'with_seconds' => true, + ]) + ->createView() + ; + + $this->assertArrayHasKey('step', $view->vars['attr']); + $this->assertEquals(1, $view->vars['attr']['step']); + } + + public function testSingleTextWidgetWithSecondsShouldNotOverrideStepAttribute() + { + $view = $this->factory + ->create(static::TESTED_TYPE, null, [ + 'widget' => 'single_text', + 'with_seconds' => true, + 'attr' => [ + 'step' => 30, + ], + ]) + ->createView() + ; + + $this->assertArrayHasKey('step', $view->vars['attr']); + $this->assertEquals(30, $view->vars['attr']['step']); + } + public function testDateTypeChoiceErrorsBubbleUp() { $error = new FormError('Invalid!'); From 444e616f6b264b1bcae3078896e8e4b326d7af44 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 23 Apr 2020 14:38:20 +0200 Subject: [PATCH 04/15] [Mailer] Add a comment to avoid more wrong PRs on this piece of code --- src/Symfony/Component/Mailer/Transport/Smtp/EsmtpTransport.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Symfony/Component/Mailer/Transport/Smtp/EsmtpTransport.php b/src/Symfony/Component/Mailer/Transport/Smtp/EsmtpTransport.php index 3f68227ba4..afa522ae97 100644 --- a/src/Symfony/Component/Mailer/Transport/Smtp/EsmtpTransport.php +++ b/src/Symfony/Component/Mailer/Transport/Smtp/EsmtpTransport.php @@ -106,6 +106,9 @@ class EsmtpTransport extends SmtpTransport /** @var SocketStream $stream */ $stream = $this->getStream(); + // WARNING: !$stream->isTLS() is right, 100% sure :) + // if you think that the ! should be removed, read the code again + // if doing so "fixes" your issue then it probably means your SMTP server behaves incorrectly or is wrongly configured if (!$stream->isTLS() && \defined('OPENSSL_VERSION_NUMBER') && \array_key_exists('STARTTLS', $capabilities)) { $this->executeCommand("STARTTLS\r\n", [220]); From 5a7208481d777b78ad3038d54f3e10d9a8a21397 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Thu, 23 Apr 2020 23:34:23 +0200 Subject: [PATCH 05/15] [Cache] skip APCu in chains when the backend is disabled --- src/Symfony/Component/Cache/Adapter/AbstractAdapter.php | 7 ++----- src/Symfony/Component/Cache/Adapter/ChainAdapter.php | 3 +++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Symfony/Component/Cache/Adapter/AbstractAdapter.php b/src/Symfony/Component/Cache/Adapter/AbstractAdapter.php index dad0dc8f66..ce1262ae17 100644 --- a/src/Symfony/Component/Cache/Adapter/AbstractAdapter.php +++ b/src/Symfony/Component/Cache/Adapter/AbstractAdapter.php @@ -14,7 +14,6 @@ namespace Symfony\Component\Cache\Adapter; use Psr\Cache\CacheItemInterface; use Psr\Log\LoggerAwareInterface; use Psr\Log\LoggerInterface; -use Psr\Log\NullLogger; use Symfony\Component\Cache\CacheItem; use Symfony\Component\Cache\Exception\InvalidArgumentException; use Symfony\Component\Cache\ResettableInterface; @@ -116,14 +115,12 @@ abstract class AbstractAdapter implements AdapterInterface, LoggerAwareInterface if (null !== $logger) { $fs->setLogger($logger); } - if (!self::$apcuSupported) { + if (!self::$apcuSupported || (\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) && !filter_var(ini_get('apc.enable_cli'), FILTER_VALIDATE_BOOLEAN))) { return $fs; } $apcu = new ApcuAdapter($namespace, (int) $defaultLifetime / 5, $version); - if ('cli' === \PHP_SAPI && !filter_var(ini_get('apc.enable_cli'), FILTER_VALIDATE_BOOLEAN)) { - $apcu->setLogger(new NullLogger()); - } elseif (null !== $logger) { + if (null !== $logger) { $apcu->setLogger($logger); } diff --git a/src/Symfony/Component/Cache/Adapter/ChainAdapter.php b/src/Symfony/Component/Cache/Adapter/ChainAdapter.php index 0080db711b..c2c9f4a800 100644 --- a/src/Symfony/Component/Cache/Adapter/ChainAdapter.php +++ b/src/Symfony/Component/Cache/Adapter/ChainAdapter.php @@ -46,6 +46,9 @@ class ChainAdapter implements AdapterInterface, PruneableInterface, ResettableIn if (!$adapter instanceof CacheItemPoolInterface) { throw new InvalidArgumentException(sprintf('The class "%s" does not implement the "%s" interface.', \get_class($adapter), CacheItemPoolInterface::class)); } + if (\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) && $adapter instanceof ApcuAdapter && !filter_var(ini_get('apc.enable_cli'), FILTER_VALIDATE_BOOLEAN)) { + continue; // skip putting APCu in the chain when the backend is disabled + } if ($adapter instanceof AdapterInterface) { $this->adapters[] = $adapter; From e27ed28bae708102b011c7a8c4744e01b0173d14 Mon Sep 17 00:00:00 2001 From: Massimiliano Arione Date: Thu, 23 Apr 2020 09:31:24 +0200 Subject: [PATCH 06/15] fix compatibility with phpunit 9 --- .../Bridge/PhpUnit/Legacy/SymfonyTestsListenerTrait.php | 7 +++++-- src/Symfony/Bridge/PhpUnit/bin/simple-phpunit | 4 ++++ src/Symfony/Bridge/PhpUnit/composer.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Bridge/PhpUnit/Legacy/SymfonyTestsListenerTrait.php b/src/Symfony/Bridge/PhpUnit/Legacy/SymfonyTestsListenerTrait.php index 69bbcfc09e..77693421ba 100644 --- a/src/Symfony/Bridge/PhpUnit/Legacy/SymfonyTestsListenerTrait.php +++ b/src/Symfony/Bridge/PhpUnit/Legacy/SymfonyTestsListenerTrait.php @@ -46,9 +46,12 @@ class SymfonyTestsListenerTrait public function __construct(array $mockedNamespaces = array()) { if (class_exists('PHPUnit_Util_Blacklist')) { - \PHPUnit_Util_Blacklist::$blacklistedClassNames['\Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListenerTrait'] = 2; + \PHPUnit_Util_Blacklist::$blacklistedClassNames[__CLASS__] = 2; + } elseif (method_exists(Blacklist::class, 'addDirectory')) { + (new BlackList())->getBlacklistedDirectories(); + Blacklist::addDirectory(\dirname(\dirname((new \ReflectionClass(__CLASS__))->getFileName()))); } else { - Blacklist::$blacklistedClassNames['\Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListenerTrait'] = 2; + Blacklist::$blacklistedClassNames[__CLASS__] = 2; } $warn = false; diff --git a/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit b/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit index d2c23f2025..3043daabab 100755 --- a/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit +++ b/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit @@ -126,6 +126,10 @@ if (!class_exists('SymfonyBlacklistPhpunit', false)) { if (class_exists('PHPUnit_Util_Blacklist')) { PHPUnit_Util_Blacklist::$blacklistedClassNames['SymfonyBlacklistPhpunit'] = 1; PHPUnit_Util_Blacklist::$blacklistedClassNames['SymfonyBlacklistSimplePhpunit'] = 1; +} elseif (method_exists('PHPUnit\Util\Blacklist', 'addDirectory')) { + (new PHPUnit\Util\BlackList())->getBlacklistedDirectories(); + PHPUnit\Util\Blacklist::addDirectory(\dirname((new \ReflectionClass('SymfonyBlacklistPhpunit'))->getFileName())); + PHPUnit\Util\Blacklist::addDirectory(\dirname((new \ReflectionClass('SymfonyBlacklistSimplePhpunit'))->getFileName())); } else { PHPUnit\Util\Blacklist::$blacklistedClassNames['SymfonyBlacklistPhpunit'] = 1; PHPUnit\Util\Blacklist::$blacklistedClassNames['SymfonyBlacklistSimplePhpunit'] = 1; diff --git a/src/Symfony/Bridge/PhpUnit/composer.json b/src/Symfony/Bridge/PhpUnit/composer.json index f7d9492613..30b3cc23f6 100644 --- a/src/Symfony/Bridge/PhpUnit/composer.json +++ b/src/Symfony/Bridge/PhpUnit/composer.json @@ -24,7 +24,7 @@ "symfony/debug": "For tracking deprecated interfaces usages at runtime with DebugClassLoader" }, "conflict": { - "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0|<6.4,>=6.0" + "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0|<6.4,>=6.0|9.1.2" }, "autoload": { "files": [ "bootstrap.php" ], From 734d97bdccca86bc5c669713b34dc84b9855229f Mon Sep 17 00:00:00 2001 From: sdkawata Date: Fri, 24 Apr 2020 19:16:04 +0900 Subject: [PATCH 07/15] [YAML] escape DEL(\x7f) --- src/Symfony/Component/Yaml/Escaper.php | 4 +++- src/Symfony/Component/Yaml/Tests/DumperTest.php | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Yaml/Escaper.php b/src/Symfony/Component/Yaml/Escaper.php index 4d3ce244c2..9413d7a2c4 100644 --- a/src/Symfony/Component/Yaml/Escaper.php +++ b/src/Symfony/Component/Yaml/Escaper.php @@ -22,7 +22,7 @@ namespace Symfony\Component\Yaml; class Escaper { // Characters that would cause a dumped string to require double quoting. - const REGEX_CHARACTER_TO_ESCAPE = "[\\x00-\\x1f]|\xc2\x85|\xc2\xa0|\xe2\x80\xa8|\xe2\x80\xa9"; + const REGEX_CHARACTER_TO_ESCAPE = "[\\x00-\\x1f]|\x7f|\xc2\x85|\xc2\xa0|\xe2\x80\xa8|\xe2\x80\xa9"; // Mapping arrays for escaping a double quoted string. The backslash is // first to ensure proper escaping because str_replace operates iteratively @@ -33,6 +33,7 @@ class Escaper "\x08", "\x09", "\x0a", "\x0b", "\x0c", "\x0d", "\x0e", "\x0f", "\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17", "\x18", "\x19", "\x1a", "\x1b", "\x1c", "\x1d", "\x1e", "\x1f", + "\x7f", "\xc2\x85", "\xc2\xa0", "\xe2\x80\xa8", "\xe2\x80\xa9", ]; private static $escaped = ['\\\\', '\\"', '\\\\', '\\"', @@ -40,6 +41,7 @@ class Escaper '\\b', '\\t', '\\n', '\\v', '\\f', '\\r', '\\x0e', '\\x0f', '\\x10', '\\x11', '\\x12', '\\x13', '\\x14', '\\x15', '\\x16', '\\x17', '\\x18', '\\x19', '\\x1a', '\\e', '\\x1c', '\\x1d', '\\x1e', '\\x1f', + '\\x7f', '\\N', '\\_', '\\L', '\\P', ]; diff --git a/src/Symfony/Component/Yaml/Tests/DumperTest.php b/src/Symfony/Component/Yaml/Tests/DumperTest.php index bb2a575eeb..e4dc49f331 100644 --- a/src/Symfony/Component/Yaml/Tests/DumperTest.php +++ b/src/Symfony/Component/Yaml/Tests/DumperTest.php @@ -289,6 +289,7 @@ EOF; 'double-quote' => ['"', "'\"'"], 'slash' => ['/', '/'], 'backslash' => ['\\', '\\'], + 'del' => ["\x7f", '"\x7f"'], 'next-line' => ["\xC2\x85", '"\\N"'], 'non-breaking-space' => ["\xc2\xa0", '"\\_"'], 'line-separator' => ["\xE2\x80\xA8", '"\\L"'], From 28fdb3a8797e9a908ea8b0a71bb3477d1de2545e Mon Sep 17 00:00:00 2001 From: Laurent VOULLEMIER Date: Wed, 22 Apr 2020 21:54:02 +0200 Subject: [PATCH 08/15] Allow invalidateTags calls to be traced by data collector --- .../CacheCollectorPass.php | 51 +++++++++++-------- .../CacheCollectorPassTest.php | 14 +++++ 2 files changed, 44 insertions(+), 21 deletions(-) diff --git a/src/Symfony/Component/Cache/DependencyInjection/CacheCollectorPass.php b/src/Symfony/Component/Cache/DependencyInjection/CacheCollectorPass.php index 68671dc238..b534e5dc8a 100644 --- a/src/Symfony/Component/Cache/DependencyInjection/CacheCollectorPass.php +++ b/src/Symfony/Component/Cache/DependencyInjection/CacheCollectorPass.php @@ -46,29 +46,38 @@ class CacheCollectorPass implements CompilerPassInterface return; } - $collectorDefinition = $container->getDefinition($this->dataCollectorCacheId); foreach ($container->findTaggedServiceIds($this->cachePoolTag) as $id => $attributes) { - $definition = $container->getDefinition($id); - if ($definition->isAbstract()) { - continue; + $this->addToCollector($id, $container); + + if (($attributes[0]['name'] ?? $id) !== $id) { + $this->addToCollector($attributes[0]['name'], $container); } - - $recorder = new Definition(is_subclass_of($definition->getClass(), TagAwareAdapterInterface::class) ? TraceableTagAwareAdapter::class : TraceableAdapter::class); - $recorder->setTags($definition->getTags()); - if (!$definition->isPublic() || !$definition->isPrivate()) { - $recorder->setPublic($definition->isPublic()); - } - $recorder->setArguments([new Reference($innerId = $id.$this->cachePoolRecorderInnerSuffix)]); - - $definition->setTags([]); - $definition->setPublic(false); - - $container->setDefinition($innerId, $definition); - $container->setDefinition($id, $recorder); - - // Tell the collector to add the new instance - $collectorDefinition->addMethodCall('addInstance', [$id, new Reference($id)]); - $collectorDefinition->setPublic(false); } } + + private function addToCollector(string $id, ContainerBuilder $container) + { + $definition = $container->getDefinition($id); + if ($definition->isAbstract()) { + return; + } + + $collectorDefinition = $container->getDefinition($this->dataCollectorCacheId); + $recorder = new Definition(is_subclass_of($definition->getClass(), TagAwareAdapterInterface::class) ? TraceableTagAwareAdapter::class : TraceableAdapter::class); + $recorder->setTags($definition->getTags()); + if (!$definition->isPublic() || !$definition->isPrivate()) { + $recorder->setPublic($definition->isPublic()); + } + $recorder->setArguments([new Reference($innerId = $id.$this->cachePoolRecorderInnerSuffix)]); + + $definition->setTags([]); + $definition->setPublic(false); + + $container->setDefinition($innerId, $definition); + $container->setDefinition($id, $recorder); + + // Tell the collector to add the new instance + $collectorDefinition->addMethodCall('addInstance', [$id, new Reference($id)]); + $collectorDefinition->setPublic(false); + } } diff --git a/src/Symfony/Component/Cache/Tests/DependencyInjection/CacheCollectorPassTest.php b/src/Symfony/Component/Cache/Tests/DependencyInjection/CacheCollectorPassTest.php index 7e77491de8..8aff19fc3e 100644 --- a/src/Symfony/Component/Cache/Tests/DependencyInjection/CacheCollectorPassTest.php +++ b/src/Symfony/Component/Cache/Tests/DependencyInjection/CacheCollectorPassTest.php @@ -13,6 +13,7 @@ namespace Symfony\Component\Cache\Tests\DependencyInjection; use PHPUnit\Framework\TestCase; use Symfony\Component\Cache\Adapter\FilesystemAdapter; +use Symfony\Component\Cache\Adapter\PhpArrayAdapter; use Symfony\Component\Cache\Adapter\TagAwareAdapter; use Symfony\Component\Cache\Adapter\TraceableAdapter; use Symfony\Component\Cache\Adapter\TraceableTagAwareAdapter; @@ -34,16 +35,29 @@ class CacheCollectorPassTest extends TestCase ->addArgument(new Reference('fs')) ->addTag('cache.pool'); + $container + ->register('.php.inner', PhpArrayAdapter::class) + ->addTag('cache.pool', ['name' => 'php']); + $container + ->register('php', TagAwareAdapter::class) + ->addArgument(new Reference('.php.inner')); + $collector = $container->register('data_collector.cache', CacheDataCollector::class); (new CacheCollectorPass())->process($container); $this->assertEquals([ ['addInstance', ['fs', new Reference('fs')]], ['addInstance', ['tagged_fs', new Reference('tagged_fs')]], + ['addInstance', ['.php.inner', new Reference('.php.inner')]], + ['addInstance', ['php', new Reference('php')]], ], $collector->getMethodCalls()); $this->assertSame(TraceableAdapter::class, $container->findDefinition('fs')->getClass()); $this->assertSame(TraceableTagAwareAdapter::class, $container->getDefinition('tagged_fs')->getClass()); + + $this->assertSame(TraceableAdapter::class, $container->findDefinition('.php.inner')->getClass()); + $this->assertSame(TraceableTagAwareAdapter::class, $container->getDefinition('php')->getClass()); + $this->assertFalse($collector->isPublic(), 'The "data_collector.cache" should be private after processing'); } } From 6dce90d47bc8ff944d670f6b6d418efb1506fa33 Mon Sep 17 00:00:00 2001 From: Thomas Calvet Date: Fri, 24 Apr 2020 14:56:41 +0200 Subject: [PATCH 09/15] [PhpUnitBridge] Use COMPOSER_BINARY env var if available --- src/Symfony/Bridge/PhpUnit/bin/simple-phpunit | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit b/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit index 3043daabab..92d4d6994a 100755 --- a/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit +++ b/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit @@ -65,11 +65,13 @@ foreach ($defaultEnvs as $envName => $envValue) { } } -$COMPOSER = file_exists($COMPOSER = $oldPwd.'/composer.phar') - || ($COMPOSER = rtrim('\\' === DIRECTORY_SEPARATOR ? preg_replace('/[\r\n].*/', '', `where.exe composer.phar`) : `which composer.phar 2> /dev/null`)) - || ($COMPOSER = rtrim('\\' === DIRECTORY_SEPARATOR ? preg_replace('/[\r\n].*/', '', `where.exe composer`) : `which composer 2> /dev/null`)) - ? (file_get_contents($COMPOSER, false, null, 0, 18) === '#!/usr/bin/env php' ? $PHP : '').' '.escapeshellarg($COMPOSER) // detect shell wrappers by looking at the shebang - : 'composer'; +if (false === $COMPOSER = \getenv('COMPOSER_BINARY')) { + $COMPOSER = file_exists($COMPOSER = $oldPwd.'/composer.phar') + || ($COMPOSER = rtrim('\\' === DIRECTORY_SEPARATOR ? preg_replace('/[\r\n].*/', '', `where.exe composer.phar`) : `which composer.phar 2> /dev/null`)) + || ($COMPOSER = rtrim('\\' === DIRECTORY_SEPARATOR ? preg_replace('/[\r\n].*/', '', `where.exe composer`) : `which composer 2> /dev/null`)) + ? (file_get_contents($COMPOSER, false, null, 0, 18) === '#!/usr/bin/env php' ? $PHP : '').' '.escapeshellarg($COMPOSER) // detect shell wrappers by looking at the shebang + : 'composer'; +} if (false === $SYMFONY_PHPUNIT_REMOVE = getenv('SYMFONY_PHPUNIT_REMOVE')) { $SYMFONY_PHPUNIT_REMOVE = 'phpspec/prophecy symfony/yaml'; From e721cfd65cbf4f42702d904757dd3ecc0da8c0a2 Mon Sep 17 00:00:00 2001 From: Alessandro Lai Date: Fri, 24 Apr 2020 16:08:51 +0200 Subject: [PATCH 10/15] Improve dirname usage --- src/Symfony/Bridge/PhpUnit/Legacy/SymfonyTestsListenerTrait.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Bridge/PhpUnit/Legacy/SymfonyTestsListenerTrait.php b/src/Symfony/Bridge/PhpUnit/Legacy/SymfonyTestsListenerTrait.php index 77693421ba..e260fb8dd6 100644 --- a/src/Symfony/Bridge/PhpUnit/Legacy/SymfonyTestsListenerTrait.php +++ b/src/Symfony/Bridge/PhpUnit/Legacy/SymfonyTestsListenerTrait.php @@ -49,7 +49,7 @@ class SymfonyTestsListenerTrait \PHPUnit_Util_Blacklist::$blacklistedClassNames[__CLASS__] = 2; } elseif (method_exists(Blacklist::class, 'addDirectory')) { (new BlackList())->getBlacklistedDirectories(); - Blacklist::addDirectory(\dirname(\dirname((new \ReflectionClass(__CLASS__))->getFileName()))); + Blacklist::addDirectory(\dirname((new \ReflectionClass(__CLASS__))->getFileName(), 2)); } else { Blacklist::$blacklistedClassNames[__CLASS__] = 2; } From fb3aaefbf2c301744395c5b6e75806f9ade29951 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Sun, 26 Apr 2020 10:08:16 +0200 Subject: [PATCH 11/15] add tests for the ConstraintViolationBuilder class --- .../ConstraintViolationBuilderTest.php | 106 ++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 src/Symfony/Component/Validator/Tests/Violation/ConstraintViolationBuilderTest.php diff --git a/src/Symfony/Component/Validator/Tests/Violation/ConstraintViolationBuilderTest.php b/src/Symfony/Component/Validator/Tests/Violation/ConstraintViolationBuilderTest.php new file mode 100644 index 0000000000..4121dc2622 --- /dev/null +++ b/src/Symfony/Component/Validator/Tests/Violation/ConstraintViolationBuilderTest.php @@ -0,0 +1,106 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Violation; + +use PHPUnit\Framework\TestCase; +use Symfony\Component\Translation\IdentityTranslator; +use Symfony\Component\Validator\Constraints\Valid; +use Symfony\Component\Validator\ConstraintViolation; +use Symfony\Component\Validator\ConstraintViolationList; +use Symfony\Component\Validator\Test\ForwardCompatTestTrait; +use Symfony\Component\Validator\Violation\ConstraintViolationBuilder; + +class ConstraintViolationBuilderTest extends TestCase +{ + use ForwardCompatTestTrait; + + private $root; + private $violations; + private $messageTemplate = '%value% is invalid'; + private $builder; + + private function doSetUp() + { + $this->root = [ + 'data' => [ + 'foo' => 'bar', + 'baz' => 'foobar', + ], + ]; + $this->violations = new ConstraintViolationList(); + $this->builder = new ConstraintViolationBuilder($this->violations, new Valid(), $this->messageTemplate, [], $this->root, 'data', 'foo', new IdentityTranslator()); + } + + public function testAddViolation() + { + $this->builder->addViolation(); + + $this->assertViolationEquals(new ConstraintViolation($this->messageTemplate, $this->messageTemplate, [], $this->root, 'data', 'foo', null, null, new Valid())); + } + + public function testAppendPropertyPath() + { + $this->builder + ->atPath('foo') + ->addViolation(); + + $this->assertViolationEquals(new ConstraintViolation($this->messageTemplate, $this->messageTemplate, [], $this->root, 'data.foo', 'foo', null, null, new Valid())); + } + + public function testAppendMultiplePropertyPaths() + { + $this->builder + ->atPath('foo') + ->atPath('bar') + ->addViolation(); + + $this->assertViolationEquals(new ConstraintViolation($this->messageTemplate, $this->messageTemplate, [], $this->root, 'data.foo.bar', 'foo', null, null, new Valid())); + } + + public function testCodeCanBeSet() + { + $this->builder + ->setCode(5) + ->addViolation(); + + $this->assertViolationEquals(new ConstraintViolation($this->messageTemplate, $this->messageTemplate, [], $this->root, 'data', 'foo', null, 5, new Valid())); + } + + public function testCauseCanBeSet() + { + $cause = new \LogicException(); + + $this->builder + ->setCause($cause) + ->addViolation(); + + $this->assertViolationEquals(new ConstraintViolation($this->messageTemplate, $this->messageTemplate, [], $this->root, 'data', 'foo', null, null, new Valid(), $cause)); + } + + private function assertViolationEquals(ConstraintViolation $expectedViolation) + { + $this->assertCount(1, $this->violations); + + $violation = $this->violations->get(0); + + $this->assertSame($expectedViolation->getMessage(), $violation->getMessage()); + $this->assertSame($expectedViolation->getMessageTemplate(), $violation->getMessageTemplate()); + $this->assertSame($expectedViolation->getParameters(), $violation->getParameters()); + $this->assertSame($expectedViolation->getPlural(), $violation->getPlural()); + $this->assertSame($expectedViolation->getRoot(), $violation->getRoot()); + $this->assertSame($expectedViolation->getPropertyPath(), $violation->getPropertyPath()); + $this->assertSame($expectedViolation->getInvalidValue(), $violation->getInvalidValue()); + $this->assertSame($expectedViolation->getCode(), $violation->getCode()); + $this->assertEquals($expectedViolation->getConstraint(), $violation->getConstraint()); + $this->assertSame($expectedViolation->getCause(), $violation->getCause()); + } +} From 89fb0799cd950867d998d9d3de60d3761f2ac76b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Loi=CC=88c=20Beurlet?= Date: Fri, 24 Apr 2020 18:48:20 +0200 Subject: [PATCH 12/15] [WebProfilerBundle] changed label of peak memory usage in the time & memory panels (MB into MiB) --- .../Resources/views/Collector/memory.html.twig | 6 +++--- .../Resources/views/Collector/time.html.twig | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/memory.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/memory.html.twig index 268f8fdc7e..49878a72d5 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/memory.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/memory.html.twig @@ -5,18 +5,18 @@ {% set status_color = (collector.memory / 1024 / 1024) > 50 ? 'yellow' : '' %} {{ include('@WebProfiler/Icon/memory.svg') }} {{ '%.1f'|format(collector.memory / 1024 / 1024) }} - MB + MiB {% endset %} {% set text %}
Peak memory usage - {{ '%.1f'|format(collector.memory / 1024 / 1024) }} MB + {{ '%.1f'|format(collector.memory / 1024 / 1024) }} MiB
PHP memory limit - {{ collector.memoryLimit == -1 ? 'Unlimited' : '%.0f MB'|format(collector.memoryLimit / 1024 / 1024) }} + {{ collector.memoryLimit == -1 ? 'Unlimited' : '%.0f MiB'|format(collector.memoryLimit / 1024 / 1024) }}
{% endset %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig index dd95b511b4..a9fd19225d 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig @@ -64,7 +64,7 @@ {% if profile.collectors.memory %}
- {{ '%.2f'|format(profile.collectors.memory.memory / 1024 / 1024) }} MB + {{ '%.2f'|format(profile.collectors.memory.memory / 1024 / 1024) }} MiB Peak memory usage
{% endif %} @@ -386,7 +386,7 @@ ctx.fillStyle = "#444"; ctx.font = "12px sans-serif"; text = event.name; - ms = " " + (event.duration < 1 ? event.duration : parseInt(event.duration, 10)) + " ms / " + event.memory + " MB"; + ms = " " + (event.duration < 1 ? event.duration : parseInt(event.duration, 10)) + " ms / " + event.memory + " MiB"; if (x + event.starttime * ratio + ctx.measureText(text + ms).width > width) { ctx.textAlign = "end"; ctx.font = "10px sans-serif"; From 99080bdbe7afb344c7d96dcd30393e564767c799 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 28 Apr 2020 19:40:55 +0200 Subject: [PATCH 13/15] updated CHANGELOG for 3.4.40 --- CHANGELOG-3.4.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/CHANGELOG-3.4.md b/CHANGELOG-3.4.md index 8e7a8406ff..7fc92f86eb 100644 --- a/CHANGELOG-3.4.md +++ b/CHANGELOG-3.4.md @@ -7,6 +7,35 @@ 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.40 (2020-04-28) + + * bug #36566 [PhpUnitBridge] Use COMPOSER_BINARY env var if available (fancyweb) + * bug #36560 [YAML] escape DEL(\x7f) (sdkawata) + * bug #36539 [PhpUnitBridge] fix compatibility with phpunit 9 (garak) + * bug #36555 [Cache] skip APCu in chains when the backend is disabled (nicolas-grekas) + * bug #36523 [Form] apply automatically step=1 for datetime-local input (ottaviano) + * bug #36498 [Security/Core] fix escape for username in LdapBindAuthenticationProvider.php (stoccc) + * bug #36506 [FrameworkBundle] Fix session.attribute_bag service definition (fancyweb) + * bug #36490 [HttpFoundation] workaround PHP bug in the session module (nicolas-grekas) + * bug #36483 [SecurityBundle] fix accepting env vars in remember-me configurations (zek) + * bug #36343 [Form] Fixed handling groups sequence validation (HeahDude) + * bug #36460 [Cache] Avoid memory leak in TraceableAdapter::reset() (lyrixx) + * bug #36411 [Form] RepeatedType should always have inner types mapped (biozshock) + * bug #36441 [DI] fix loading defaults when using the PHP-DSL (nicolas-grekas) + * bug #36434 [HttpKernel] silence E_NOTICE triggered since PHP 7.4 (xabbuh) + * bug #36365 [Validator] Fixed default group for nested composite constraints (HeahDude) + * bug #35591 [Validator] do not merge constraints within interfaces (greedyivan) + * bug #36375 [Workflow] Use a strict comparison when retrieving raw marking in MarkingStore (lyrixx) + * bug #36305 [PropertyInfo][ReflectionExtractor] Check the array mutator prefixes last when the property is singular (fancyweb) + * bug #35656 [HttpFoundation] Fixed session migration with custom cookie lifetime (Guite) + * bug #36315 [WebProfilerBundle] Support for Content Security Policy style-src-elem and script-src-elem in WebProfiler (ampaze) + * bug #36286 [Validator] Allow URL-encoded special characters in basic auth part of URLs (cweiske) + * bug #36332 [Serializer] Fix unitialized properties (from PHP 7.4.2) when serializing context for the cache key (alanpoulain) + * bug #36239 [HttpKernel][LoggerDataCollector] Prevent keys collisions in the sanitized logs processing (fancyweb) + * bug #36245 [Validator] Fixed calling getters before resolving groups (HeahDude) + * bug #36252 [Security/Http] Allow setting cookie security settings for delete_cookies (wouterj) + * bug #36261 [FrameworkBundle] revert to legacy wiring of the session when circular refs are detected (nicolas-grekas) + * 3.4.39 (2020-03-30) * bug #36216 [Validator] Assert Valid with many groups (phucwan91) From 1822b065d7f83101f3d6e098e60a60c4b313bb20 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 28 Apr 2020 19:41:24 +0200 Subject: [PATCH 14/15] update CONTRIBUTORS for 3.4.40 --- CONTRIBUTORS.md | 77 ++++++++++++++++++++++++++++++------------------- 1 file changed, 47 insertions(+), 30 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 53a2faec2f..449973d757 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -24,10 +24,10 @@ Symfony is the result of the work of many people who made the code better - Kris Wallsmith (kriswallsmith) - Yonel Ceruto (yonelceruto) - Hugo Hamon (hhamon) + - Wouter de Jong (wouterj) + - Thomas Calvet (fancyweb) - Abdellatif Ait boudad (aitboudad) - Samuel ROZE (sroze) - - Thomas Calvet (fancyweb) - - Wouter de Jong (wouterj) - Romain Neutron (romain) - Pascal Borreli (pborreli) - Joseph Bielawski (stloyd) @@ -37,8 +37,8 @@ Symfony is the result of the work of many people who made the code better - Jules Pietri (heah) - Hamza Amrouche (simperfit) - Martin Hasoň (hason) - - Jeremy Mikola (jmikola) - Jérémy DERUSSÉ (jderusse) + - Jeremy Mikola (jmikola) - Jean-François Simon (jfsimon) - Benjamin Eberlei (beberlei) - Igor Wiedler (igorw) @@ -50,9 +50,9 @@ Symfony is the result of the work of many people who made the code better - Lynn van der Berg (kjarli) - Diego Saint Esteben (dosten) - Matthias Pigulla (mpdude) + - Pierre du Plessis (pierredup) - Alexandre Salomé (alexandresalome) - William Durand (couac) - - Pierre du Plessis (pierredup) - ornicar - Dany Maillard (maidmaid) - Francis Besset (francisbesset) @@ -69,10 +69,10 @@ Symfony is the result of the work of many people who made the code better - Gabriel Ostrolucký (gadelat) - Miha Vrhovnik - David Maicher (dmaicher) - - Diego Saint Esteben (dii3g0) - Gábor Egyed (1ed) - - Titouan Galopin (tgalopin) + - Diego Saint Esteben (dii3g0) - Jan Schädlich (jschaedl) + - Titouan Galopin (tgalopin) - Konstantin Kudryashov (everzet) - Bilal Amarni (bamarni) - Mathieu Piot (mpiot) @@ -110,6 +110,7 @@ Symfony is the result of the work of many people who made the code better - Baptiste Clavié (talus) - Michal Piotrowski (eventhorizon) - Tim Nagel (merk) + - Sebastiaan Stok (sstok) - Chris Wilkinson (thewilkybarkid) - Brice BERNARD (brikou) - marc.weistroff @@ -119,7 +120,6 @@ Symfony is the result of the work of many people who made the code better - lenar - Alexander Schwenn (xelaris) - Włodzimierz Gajda (gajdaw) - - Sebastiaan Stok (sstok) - Adrien Brault (adrienbrault) - Jacob Dreesen (jdreesen) - Florian Voutzinos (florianv) @@ -139,18 +139,18 @@ Symfony is the result of the work of many people who made the code better - Przemysław Bogusz (przemyslaw-bogusz) - Eric GELOEN (gelo) - Lars Strojny (lstrojny) + - Massimiliano Arione (garak) - Jannik Zschiesche (apfelbox) - Robert Schönthal (digitalkaoz) - Gregor Harlan (gharlan) - Florian Lonqueu-Brochard (florianlb) + - Alexander Schranz (alexander-schranz) - Gabriel Caruso (carusogabriel) - Stefano Sala (stefano.sala) - Evgeniy (ewgraf) - - Massimiliano Arione (garak) - Julien Falque (julienfalque) - Vincent AUBERT (vincent) - Juti Noppornpitak (shiroyuki) - - Alexander Schranz (alexander-schranz) - Anthony MARTIN (xurudragon) - Tigran Azatyan (tigranazatyan) - Sebastian Hörl (blogsh) @@ -176,6 +176,7 @@ Symfony is the result of the work of many people who made the code better - Richard van Laak (rvanlaak) - Richard Shank (iampersistent) - Thomas Rabaix (rande) + - Ahmed TAILOULOUTE (ahmedtai) - Vincent Touzet (vincenttouzet) - jeremyFreeAgent (jeremyfreeagent) - Rouven Weßling (realityking) @@ -198,6 +199,7 @@ Symfony is the result of the work of many people who made the code better - James Halsall (jaitsu) - Matthieu Napoli (mnapoli) - Florent Mata (fmata) + - Antoine Makdessi (amakdessi) - Warnar Boekkooi (boekkooi) - Dmitrii Chekaliuk (lazyhammer) - Clément JOBEILI (dator) @@ -213,15 +215,18 @@ Symfony is the result of the work of many people who made the code better - Dennis Benkert (denderello) - DQNEO - Andre Rømcke (andrerom) + - Saif (╯°□°)╯ (azjezz) - mcfedr (mcfedr) - Gary PEGEOT (gary-p) - Ruben Gonzalez (rubenrua) - Benjamin Dulau (dbenjamin) + - Jan Rosier (rosier) - Andreas Braun - Mathieu Lemoine (lemoinem) - Christian Schmidt - Andreas Hucks (meandmymonkey) - Tom Van Looy (tvlooy) + - Guillaume Pédelagrabe - Noel Guilbert (noel) - Anthony GRASSIOT (antograssiot) - Stadly @@ -233,7 +238,7 @@ Symfony is the result of the work of many people who made the code better - Nikolay Labinskiy (e-moe) - Martin Schuhfuß (usefulthink) - apetitpa - - Antoine Makdessi (amakdessi) + - Maxime Helias (maxhelias) - Matthieu Bontemps (mbontemps) - apetitpa - Pierre Minnieur (pminnieur) @@ -243,14 +248,13 @@ Symfony is the result of the work of many people who made the code better - Laurent VOULLEMIER (lvo) - Michael Lee (zerustech) - Matthieu Auger (matthieuauger) - - Ahmed TAILOULOUTE (ahmedtai) + - Mathias Arlaud (mtarld) - Leszek Prabucki (l3l0) - Fabien Bourigault (fbourigault) - François Zaninotto (fzaninotto) - Dustin Whittle (dustinwhittle) - jeff - John Kary (johnkary) - - Jan Rosier (rosier) - Justin Hileman (bobthecow) - Blanchon Vincent (blanchonvincent) - Michele Orselli (orso) @@ -270,7 +274,6 @@ Symfony is the result of the work of many people who made the code better - Marcel Beerta (mazen) - Christopher Hertel (chertel) - Ruud Kamphuis (ruudk) - - Maxime Helias (maxhelias) - Pavel Batanov (scaytrase) - Mantis Development - David Prévot @@ -283,7 +286,6 @@ Symfony is the result of the work of many people who made the code better - Lorenz Schori - Sébastien Lavoie (lavoiesl) - Dariusz - - Saif (╯°□°)╯ (azjezz) - Dmitrii Poddubnyi (karser) - Michael Babker (mbabker) - Francois Zaninotto @@ -307,7 +309,6 @@ Symfony is the result of the work of many people who made the code better - Arjen Brouwer (arjenjb) - Katsuhiro OGAWA - Patrick McDougle (patrick-mcdougle) - - Guillaume Pédelagrabe - Alif Rachmawadi - Anton Chernikov (anton_ch1989) - Kristen Gilden (kgilden) @@ -336,9 +337,9 @@ Symfony is the result of the work of many people who made the code better - Jeroen Spee (jeroens) - Nikita Konstantinov - Wodor Wodorski + - Olivier Dolbeau (odolbeau) - Thomas Lallement (raziel057) - Colin O'Dell (colinodell) - - Mathias Arlaud (mtarld) - Giorgio Premi - renanbr - Alex Rock (pierstoval) @@ -364,6 +365,7 @@ Symfony is the result of the work of many people who made the code better - Vilius Grigaliūnas - David Badura (davidbadura) - Chad Sikorra (chadsikorra) + - Alan Poulain (alanpoulain) - Chris Smith (cs278) - Thomas Bisignani (toma) - Florian Klein (docteurklein) @@ -413,7 +415,6 @@ Symfony is the result of the work of many people who made the code better - Thomas Royer (cydonia7) - Nicolas LEFEVRE (nicoweb) - alquerci - - Olivier Dolbeau (odolbeau) - Oleg Andreyev - Mateusz Sip (mateusz_sip) - Francesco Levorato @@ -426,6 +427,7 @@ Symfony is the result of the work of many people who made the code better - Tomasz Kowalczyk (thunderer) - Artur Eshenbrener - Timo Bakx (timobakx) + - Antonio Pauletich (x-coder264) - Thomas Perez (scullwm) - Felix Labrecque - Yaroslav Kiliba @@ -443,7 +445,6 @@ Symfony is the result of the work of many people who made the code better - Eduardo Gulias (egulias) - giulio de donato (liuggio) - ShinDarth - - Alan Poulain - Stéphane PY (steph_py) - Philipp Kräutli (pkraeutli) - Grzegorz (Greg) Zdanowski (kiler129) @@ -540,10 +541,10 @@ Symfony is the result of the work of many people who made the code better - Martijn Cuppens - Vlad Gregurco (vgregurco) - Boris Vujicic (boris.vujicic) + - Artem Lopata - Chris Sedlmayr (catchamonkey) - Kamil Kokot (pamil) - Seb Koelen - - Antonio Pauletich (x-coder264) - Christoph Mewes (xrstf) - Vitaliy Tverdokhlib (vitaliytv) - Ariel Ferrandini (aferrandini) @@ -553,14 +554,17 @@ Symfony is the result of the work of many people who made the code better - Jonas Flodén (flojon) - Tobias Weichart - Gonzalo Vilaseca (gonzalovilaseca) + - Daniel STANCU - Tarmo Leppänen (tarlepp) - Marcin Sikoń (marphi) - Dominik Zogg (dominik.zogg) - Marek Pietrzak - Luc Vieillescazes (iamluc) - franek (franek) + - soyuka - Raulnet - Christian Wahler + - Giso Stallenberg (gisostallenberg) - Gintautas Miselis - Rob Bast - Roberto Espinoza (respinoza) @@ -599,6 +603,7 @@ Symfony is the result of the work of many people who made the code better - Philipp Rieber (bicpi) - Manuel de Ruiter (manuel) - Nathanael Noblet (gnat) + - Dimitri Gritsajuk (ottaviano) - nikos.sotiropoulos - Eduardo Oliveira (entering) - Ilya Antipenko (aivus) @@ -744,6 +749,7 @@ Symfony is the result of the work of many people who made the code better - Benjamin Cremer (bcremer) - Javier López (loalf) - Reinier Kip + - Jérôme Tamarelle (jtamarelle-prismamedia) - Geoffrey Brier (geoffrey-brier) - Alexandre Parent - Vladimir Tsykun @@ -778,7 +784,6 @@ Symfony is the result of the work of many people who made the code better - Miquel Rodríguez Telep (mrtorrent) - Sergey Kolodyazhnyy (skolodyazhnyy) - umpirski - - Artem Lopata - M. Vondano - Quentin de Longraye (quentinus95) - Chris Heng (gigablah) @@ -786,10 +791,10 @@ Symfony is the result of the work of many people who made the code better - Richard Bradley - Ulumuddin Yunus (joenoez) - rtek + - Ivan Grigoriev - Johann Saunier (prophet777) - Sergey (upyx) - Andreas Erhard - - Giso Stallenberg (gisostallenberg) - Michael Devery (mickadoo) - Antoine Corcy - Ahmed Ashraf (ahmedash95) @@ -810,6 +815,7 @@ Symfony is the result of the work of many people who made the code better - Cameron Porter - Hossein Bukhamsin - Oliver Hoff + - William Arslett - Christian Sciberras (uuf6429) - Disparity - origaminal @@ -856,7 +862,6 @@ Symfony is the result of the work of many people who made the code better - Markus Fasselt (digilist) - Julien DIDIER (juliendidier) - Dominik Ritter (dritter) - - Dimitri Gritsajuk (ottaviano) - Sebastian Grodzicki (sgrodzicki) - Mohamed Gamal - Jeroen van den Enden (stoefke) @@ -871,6 +876,7 @@ Symfony is the result of the work of many people who made the code better - Yuen-Chi Lian - Tarjei Huse (tarjei) - Besnik Br + - Axel Guckelsberger (guite) - Jose Gonzalez - Jonathan (jls-esokia) - Oleksii Zhurbytskyi @@ -881,12 +887,14 @@ Symfony is the result of the work of many people who made the code better - Jakub Kulhan (jakubkulhan) - Shaharia Azam - avorobiev + - stoccc - Grégoire Penverne (gpenverne) - Venu - Lars Vierbergen - Jonatan Männchen - Dennis Hotson - Andrew Tchircoff (andrewtch) + - Ahmed Raafat - michaelwilliams - Martin Kirilov - 1emming @@ -894,6 +902,7 @@ Symfony is the result of the work of many people who made the code better - Tri Pham (phamuyentri) - Jordan Deitch - Casper Valdemar Poulsen + - Laurent Masforné (heisenberg) - Josiah (josiah) - Guillaume Verstraete (versgui) - Greg ORIOL @@ -961,10 +970,8 @@ Symfony is the result of the work of many people who made the code better - Laurent Bassin (lbassin) - andrey1s - Abhoryo - - Daniel STANCU - Fabian Vogler (fabian) - Korvin Szanto - - soyuka - Stéphan Kochen - Arjan Keeman - Alaattin Kahramanlar (alaattin) @@ -1133,6 +1140,7 @@ Symfony is the result of the work of many people who made the code better - Nicolas Le Goff (nlegoff) - Ben Oman - Chris de Kok + - Eduard Bulava (nonanerz) - Lorenzo Millucci - Andreas Kleemann - Manuele Menozzi @@ -1150,6 +1158,7 @@ Symfony is the result of the work of many people who made the code better - hamza - dantleech - Bastien DURAND (deamon) + - Kajetan Kołtuniak (kajtii) - Sander Goossens (sandergo90) - Rudy Onfroy - Tero Alén (tero) @@ -1237,7 +1246,6 @@ Symfony is the result of the work of many people who made the code better - Benjamin Paap (benjaminpaap) - Claus Due (namelesscoder) - Christian - - William Arslett - Denis Golubovskiy (bukashk0zzz) - Sergii Smertin (nfx) - Mikkel Paulson @@ -1246,6 +1254,7 @@ Symfony is the result of the work of many people who made the code better - Marc Duboc (icemad) - Matthias Krauser (mkrauser) - Martynas Narbutas + - Nilmar Sanchez Muguercia - Toon Verwerft (veewee) - Bailey Parker - Eddie Jaoude @@ -1289,6 +1298,7 @@ Symfony is the result of the work of many people who made the code better - Stephen Clouse - e-ivanov - Michał (bambucha15) + - Benjamin Dos Santos - Einenlum - Jérémy Jarrié (gagnar) - Jochen Bayer (jocl) @@ -1344,6 +1354,7 @@ Symfony is the result of the work of many people who made the code better - Klaus Purer - arnaud (arnooo999) - Gilles Doge (gido) + - Oscar Esteve (oesteve) - abulford - Philipp Kretzschmar - antograssiot @@ -1367,7 +1378,6 @@ Symfony is the result of the work of many people who made the code better - Derek Lambert - MightyBranch - Kacper Gunia (cakper) - - Jérôme Tamarelle (jtamarelle-prismamedia) - Peter Thompson (petert82) - error56 - Felicitus @@ -1392,6 +1402,7 @@ Symfony is the result of the work of many people who made the code better - Nyro (nyro) - Marco - Marc Torres + - Mark Spink - Alberto Aldegheri - Dmitri Petmanson - heccjj @@ -1412,7 +1423,6 @@ Symfony is the result of the work of many people who made the code better - David Négrier (moufmouf) - Quique Porta (quiqueporta) - mohammadreza honarkhah - - stoccc - Andrea Quintino (dirk39) - Tomasz Szymczyk (karion) - Alex Vasilchenko @@ -1468,7 +1478,6 @@ Symfony is the result of the work of many people who made the code better - Walter Dal Mut (wdalmut) - abluchet - Ruud Arentsen - - Ahmed Raafat - Harald Tollefsen - Matthieu - Albin Kerouaton @@ -1504,7 +1513,6 @@ Symfony is the result of the work of many people who made the code better - Antal Áron (antalaron) - Vašek Purchart (vasek-purchart) - Janusz Jabłoński (yanoosh) - - Ivan Grigoriev - Fleuv - Sandro Hopf - Łukasz Makuch @@ -1522,6 +1530,7 @@ Symfony is the result of the work of many people who made the code better - Philip Frank - David Brooks - Lance McNearney + - Serhiy Lunak (slunak) - Giorgio Premi - Aurélien Fontaine - ncou @@ -1531,6 +1540,7 @@ Symfony is the result of the work of many people who made the code better - Matt Daum (daum) - Alberto Pirovano (geezmo) - Pete Mitchell (peterjmit) + - phuc vo (phucwan) - Tom Corrigan (tomcorrigan) - Luis Galeas - Bogdan Scordaliu @@ -1543,7 +1553,6 @@ Symfony is the result of the work of many people who made the code better - WedgeSama - Felds Liscia - Chihiro Adachi (chihiro-adachi) - - Axel Guckelsberger (guite) - Raphaëll Roussel - Tadcka - Beth Binkovitz @@ -1651,6 +1660,7 @@ Symfony is the result of the work of many people who made the code better - Flavian (2much) - Gautier Deuette - mike + - tadas - Kirk Madera - Keith Maika - Mephistofeles @@ -1834,6 +1844,7 @@ Symfony is the result of the work of many people who made the code better - alefranz - David Barratt - Andrea Giannantonio + - Dries Vints - Pavel.Batanov - avi123 - Pavel Prischepa @@ -1900,6 +1911,7 @@ Symfony is the result of the work of many people who made the code better - Yannick Warnier (ywarnier) - Kevin Decherf - Jason Woods + - Christian Weiske - Maria Grazia Patteri - klemens - dened @@ -2149,6 +2161,7 @@ Symfony is the result of the work of many people who made the code better - Evgeniy Tetenchuk - Sjoerd Adema - Shrey Puranik + - Evgeniy Koval - Lars Moelleken - dasmfm - Mathias Geat @@ -2208,6 +2221,7 @@ Symfony is the result of the work of many people who made the code better - Niklas Keller - Andras Debreczeni - Vladimir Sazhin + - Michel Bardelmeijer - Tomas Kmieliauskas - Billie Thompson - lol768 @@ -2241,6 +2255,7 @@ Symfony is the result of the work of many people who made the code better - Michael Schneider - Cédric Bertolini - n-aleha + - Talha Zekeriya Durmuş - Anatol Belski - Anderson Müller - Şəhriyar İmanov @@ -2268,6 +2283,7 @@ Symfony is the result of the work of many people who made the code better - Neophy7e - bokonet - Arrilot + - ampaze - Markus Staab - Pierre-Louis LAUNAY - djama @@ -2417,6 +2433,7 @@ Symfony is the result of the work of many people who made the code better - Michal Čihař (mcihar) - Matt Drollette (mdrollette) - Adam Monsen (meonkeys) + - Mike Milano (mmilano) - diego aguiar (mollokhan) - Hugo Monteiro (monteiro) - Ala Eddine Khefifi (nayzo) From f59e0e9c236c1b31440e120be2fd0a2794509310 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 28 Apr 2020 19:41:38 +0200 Subject: [PATCH 15/15] updated VERSION for 3.4.40 --- 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 9422d90e9e..dc9cc048eb 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.40-DEV'; + const VERSION = '3.4.40'; const VERSION_ID = 30440; const MAJOR_VERSION = 3; const MINOR_VERSION = 4; const RELEASE_VERSION = 40; - const EXTRA_VERSION = 'DEV'; + const EXTRA_VERSION = ''; const END_OF_MAINTENANCE = '11/2020'; const END_OF_LIFE = '11/2021';