From 092d85c947064e793a3a717fe7aabd5cb5e29028 Mon Sep 17 00:00:00 2001 From: Laurent VOULLEMIER Date: Thu, 19 Mar 2020 10:54:56 +0100 Subject: [PATCH 001/128] [Validator] Add BC layer for notInRangeMessage when min and max are set --- .../Component/Validator/Constraints/Range.php | 20 +++++++ .../Validator/Constraints/RangeValidator.php | 17 +++++- .../Validator/Tests/Constraints/RangeTest.php | 39 ++++++++++++ .../Tests/Constraints/RangeValidatorTest.php | 60 +++++++++++++++++++ 4 files changed, 134 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Validator/Constraints/Range.php b/src/Symfony/Component/Validator/Constraints/Range.php index b713090de7cbb..fd2fc4790e8a8 100644 --- a/src/Symfony/Component/Validator/Constraints/Range.php +++ b/src/Symfony/Component/Validator/Constraints/Range.php @@ -46,6 +46,17 @@ class Range extends Constraint public $max; public $maxPropertyPath; + // BC layer, to be removed in 5.0 + /** + * @internal + */ + public $deprecatedMinMessageSet = false; + + /** + * @internal + */ + public $deprecatedMaxMessageSet = false; + public function __construct($options = null) { if (\is_array($options)) { @@ -60,6 +71,15 @@ public function __construct($options = null) if ((isset($options['minPropertyPath']) || isset($options['maxPropertyPath'])) && !class_exists(PropertyAccess::class)) { throw new LogicException(sprintf('The "%s" constraint requires the Symfony PropertyAccess component to use the "minPropertyPath" or "maxPropertyPath" option.', static::class)); } + + if (isset($options['min']) && isset($options['max'])) { + $this->deprecatedMinMessageSet = isset($options['minMessage']); + $this->deprecatedMaxMessageSet = isset($options['maxMessage']); + + if ($this->deprecatedMinMessageSet || $this->deprecatedMaxMessageSet) { + @trigger_error('Since symfony/validator 4.4: "minMessage" and "maxMessage" are deprecated when the "min" and "max" options are both set. Use "notInRangeMessage" instead.', E_USER_DEPRECATED); + } + } } parent::__construct($options); diff --git a/src/Symfony/Component/Validator/Constraints/RangeValidator.php b/src/Symfony/Component/Validator/Constraints/RangeValidator.php index 9b7c40ce5ae9a..91aca9018e00a 100644 --- a/src/Symfony/Component/Validator/Constraints/RangeValidator.php +++ b/src/Symfony/Component/Validator/Constraints/RangeValidator.php @@ -88,11 +88,24 @@ public function validate($value, Constraint $constraint) $hasUpperLimit = null !== $max; if ($hasLowerLimit && $hasUpperLimit && ($value < $min || $value > $max)) { - $violationBuilder = $this->context->buildViolation($constraint->notInRangeMessage) + $message = $constraint->notInRangeMessage; + $code = Range::NOT_IN_RANGE_ERROR; + + if ($value < $min && $constraint->deprecatedMinMessageSet) { + $message = $constraint->minMessage; + $code = Range::TOO_LOW_ERROR; + } + + if ($value > $max && $constraint->deprecatedMaxMessageSet) { + $message = $constraint->maxMessage; + $code = Range::TOO_HIGH_ERROR; + } + + $violationBuilder = $this->context->buildViolation($message) ->setParameter('{{ value }}', $this->formatValue($value, self::PRETTY_DATE)) ->setParameter('{{ min }}', $this->formatValue($min, self::PRETTY_DATE)) ->setParameter('{{ max }}', $this->formatValue($max, self::PRETTY_DATE)) - ->setCode(Range::NOT_IN_RANGE_ERROR); + ->setCode($code); if (null !== $constraint->maxPropertyPath) { $violationBuilder->setParameter('{{ max_limit_path }}', $constraint->maxPropertyPath); diff --git a/src/Symfony/Component/Validator/Tests/Constraints/RangeTest.php b/src/Symfony/Component/Validator/Tests/Constraints/RangeTest.php index 052a8ee024f67..ee99c8deef742 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/RangeTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/RangeTest.php @@ -40,4 +40,43 @@ public function testThrowsNoDefaultOptionConfiguredException() $this->expectExceptionMessage('No default option is configured'); new Range('value'); } + + public function provideDeprecationTriggeredIfMinMaxAndMinMessageOrMaxMessageSet(): array + { + return [ + [['min' => 1, 'max' => 10, 'minMessage' => 'my_min_message'], true, false], + [['min' => 1, 'max' => 10, 'maxMessage' => 'my_max_message'], false, true], + [['min' => 1, 'max' => 10, 'minMessage' => 'my_min_message', 'maxMessage' => 'my_max_message'], true, true], + ]; + } + + /** + * @group legacy + * @expectedDeprecation Since symfony/validator 4.4: minMessage and maxMessage are deprecated when min and max options are set together. Use notInRangeMessage instead. + * @dataProvider provideDeprecationTriggeredIfMinMaxAndMinMessageOrMaxMessageSet + */ + public function testDeprecationTriggeredIfMinMaxAndMinMessageOrMaxMessageSet(array $options, bool $expectedDeprecatedMinMessageSet, bool $expectedDeprecatedMaxMessageSet) + { + $sut = new Range($options); + $this->assertEquals($expectedDeprecatedMinMessageSet, $sut->deprecatedMinMessageSet); + $this->assertEquals($expectedDeprecatedMaxMessageSet, $sut->deprecatedMaxMessageSet); + } + + public function provideDeprecationNotTriggeredIfNotMinMaxOrNotMinMessageNorMaxMessageSet(): array + { + return [ + [['min' => 1, 'minMessage' => 'my_min_message', 'maxMessage' => 'my_max_message']], + [['max' => 10, 'minMessage' => 'my_min_message', 'maxMessage' => 'my_max_message']], + [['min' => 1, 'max' => 10, 'notInRangeMessage' => 'my_message']], + ]; + } + + /** + * @doesNotPerformAssertions + * @dataProvider provideDeprecationNotTriggeredIfNotMinMaxOrNotMinMessageNorMaxMessageSet + */ + public function testDeprecationNotTriggeredIfNotMinMaxOrNotMinMessageNorMaxMessageSet(array $options) + { + new Range($options); + } } diff --git a/src/Symfony/Component/Validator/Tests/Constraints/RangeValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/RangeValidatorTest.php index ef70c16145719..ff1497c9238d8 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/RangeValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/RangeValidatorTest.php @@ -754,6 +754,66 @@ public function testInvalidDatesCombinedMinPropertyPath($value, $dateTimeAsStrin ->setCode(Range::NOT_IN_RANGE_ERROR) ->assertRaised(); } + + public function provideMessageIfMinAndMaxSet(): array + { + $notInRangeMessage = (new Range(['min' => '']))->notInRangeMessage; + + return [ + [ + [], + 12, + $notInRangeMessage, + Range::NOT_IN_RANGE_ERROR, + ], + [ + ['notInRangeMessage' => 'not_in_range_message'], + 12, + 'not_in_range_message', + Range::NOT_IN_RANGE_ERROR, + ], + [ + ['minMessage' => 'min_message'], + 0, + 'min_message', + Range::TOO_LOW_ERROR, + ], + [ + ['maxMessage' => 'max_message'], + 0, + $notInRangeMessage, + Range::NOT_IN_RANGE_ERROR, + ], + [ + ['minMessage' => 'min_message'], + 15, + $notInRangeMessage, + Range::NOT_IN_RANGE_ERROR, + ], + [ + ['maxMessage' => 'max_message'], + 15, + 'max_message', + Range::TOO_HIGH_ERROR, + ], + ]; + } + + /** + * @group legacy + * @dataProvider provideMessageIfMinAndMaxSet + */ + public function testMessageIfMinAndMaxSet(array $constraintExtraOptions, int $value, string $expectedMessage, string $expectedCode) + { + $constraint = new Range(array_merge(['min' => 1, 'max' => 10], $constraintExtraOptions)); + $this->validator->validate($value, $constraint); + + $this + ->buildViolation($expectedMessage) + ->setParameters(['{{ min }}' => '1', '{{ max }}' => '10', '{{ value }}' => (string) $value]) + ->setCode($expectedCode) + ->assertRaised(); + } } final class Limit From a08ddf76361899ebe6f171611a1832da3e01a16a Mon Sep 17 00:00:00 2001 From: Maxime Steinhausser Date: Fri, 21 Feb 2020 15:30:21 +0100 Subject: [PATCH 002/128] [Validator] Add target guards for Composite nested constraints --- .../Validator/Constraints/Composite.php | 11 +++++ .../Validator/Mapping/ClassMetadata.php | 18 +++++-- .../Validator/Mapping/MemberMetadata.php | 18 +++++-- .../Tests/Mapping/ClassMetadataTest.php | 37 ++++++++++++++ .../Tests/Mapping/MemberMetadataTest.php | 48 +++++++++++++++++++ 5 files changed, 126 insertions(+), 6 deletions(-) diff --git a/src/Symfony/Component/Validator/Constraints/Composite.php b/src/Symfony/Component/Validator/Constraints/Composite.php index b14276c3bbf1a..d8c6079ee2d57 100644 --- a/src/Symfony/Component/Validator/Constraints/Composite.php +++ b/src/Symfony/Component/Validator/Constraints/Composite.php @@ -136,6 +136,17 @@ public function addImplicitGroupName($group) */ abstract protected function getCompositeOption(); + /** + * @internal Used by metadata + * + * @return Constraint[] + */ + public function getNestedContraints() + { + /* @var Constraint[] $nestedConstraints */ + return $this->{$this->getCompositeOption()}; + } + /** * Initializes the nested constraints. * diff --git a/src/Symfony/Component/Validator/Mapping/ClassMetadata.php b/src/Symfony/Component/Validator/Mapping/ClassMetadata.php index 572bbc6d55316..cf8782c085613 100644 --- a/src/Symfony/Component/Validator/Mapping/ClassMetadata.php +++ b/src/Symfony/Component/Validator/Mapping/ClassMetadata.php @@ -12,6 +12,7 @@ namespace Symfony\Component\Validator\Mapping; use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Constraints\Composite; use Symfony\Component\Validator\Constraints\GroupSequence; use Symfony\Component\Validator\Constraints\Traverse; use Symfony\Component\Validator\Exception\ConstraintDefinitionException; @@ -178,9 +179,7 @@ public function getDefaultGroup() */ public function addConstraint(Constraint $constraint) { - if (!\in_array(Constraint::CLASS_CONSTRAINT, (array) $constraint->getTargets())) { - throw new ConstraintDefinitionException(sprintf('The constraint "%s" cannot be put on classes.', \get_class($constraint))); - } + $this->checkConstraint($constraint); if ($constraint instanceof Traverse) { if ($constraint->traverse) { @@ -495,4 +494,17 @@ private function addPropertyMetadata(PropertyMetadataInterface $metadata) $this->members[$property][] = $metadata; } + + private function checkConstraint(Constraint $constraint) + { + if (!\in_array(Constraint::CLASS_CONSTRAINT, (array) $constraint->getTargets(), true)) { + throw new ConstraintDefinitionException(sprintf('The constraint "%s" cannot be put on classes.', \get_class($constraint))); + } + + if ($constraint instanceof Composite) { + foreach ($constraint->getNestedContraints() as $nestedContraint) { + $this->checkConstraint($nestedContraint); + } + } + } } diff --git a/src/Symfony/Component/Validator/Mapping/MemberMetadata.php b/src/Symfony/Component/Validator/Mapping/MemberMetadata.php index fb2fcb439fd94..124e75a0ee6e9 100644 --- a/src/Symfony/Component/Validator/Mapping/MemberMetadata.php +++ b/src/Symfony/Component/Validator/Mapping/MemberMetadata.php @@ -12,6 +12,7 @@ namespace Symfony\Component\Validator\Mapping; use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Constraints\Composite; use Symfony\Component\Validator\Exception\ConstraintDefinitionException; /** @@ -71,9 +72,7 @@ public function __construct($class, $name, $property) */ public function addConstraint(Constraint $constraint) { - if (!\in_array(Constraint::PROPERTY_CONSTRAINT, (array) $constraint->getTargets())) { - throw new ConstraintDefinitionException(sprintf('The constraint "%s" cannot be put on properties or getters.', \get_class($constraint))); - } + $this->checkConstraint($constraint); parent::addConstraint($constraint); @@ -181,4 +180,17 @@ public function getReflectionMember($objectOrClassName) * @return \ReflectionMethod|\ReflectionProperty The reflection instance */ abstract protected function newReflectionMember($objectOrClassName); + + private function checkConstraint(Constraint $constraint) + { + if (!\in_array(Constraint::PROPERTY_CONSTRAINT, (array) $constraint->getTargets(), true)) { + throw new ConstraintDefinitionException(sprintf('The constraint "%s" cannot be put on properties or getters.', \get_class($constraint))); + } + + if ($constraint instanceof Composite) { + foreach ($constraint->getNestedContraints() as $nestedContraint) { + $this->checkConstraint($nestedContraint); + } + } + } } diff --git a/src/Symfony/Component/Validator/Tests/Mapping/ClassMetadataTest.php b/src/Symfony/Component/Validator/Tests/Mapping/ClassMetadataTest.php index 73af5c1894053..02fe4845253cc 100644 --- a/src/Symfony/Component/Validator/Tests/Mapping/ClassMetadataTest.php +++ b/src/Symfony/Component/Validator/Tests/Mapping/ClassMetadataTest.php @@ -13,8 +13,11 @@ use PHPUnit\Framework\TestCase; use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Constraints\Composite; use Symfony\Component\Validator\Constraints\Valid; +use Symfony\Component\Validator\Exception\ConstraintDefinitionException; use Symfony\Component\Validator\Mapping\ClassMetadata; +use Symfony\Component\Validator\Tests\Fixtures\ClassConstraint; use Symfony\Component\Validator\Tests\Fixtures\ConstraintA; use Symfony\Component\Validator\Tests\Fixtures\ConstraintB; use Symfony\Component\Validator\Tests\Fixtures\PropertyConstraint; @@ -52,6 +55,20 @@ public function testAddConstraintRequiresClassConstraints() $this->metadata->addConstraint(new PropertyConstraint()); } + public function testAddCompositeConstraintRejectsNestedPropertyConstraints() + { + $this->expectException(ConstraintDefinitionException::class); + $this->expectExceptionMessage('The constraint "Symfony\Component\Validator\Tests\Fixtures\PropertyConstraint" cannot be put on classes.'); + + $this->metadata->addConstraint(new ClassCompositeConstraint([new PropertyConstraint()])); + } + + public function testAddCompositeConstraintAcceptsNestedClassConstraints() + { + $this->metadata->addConstraint($constraint = new ClassCompositeConstraint([new ClassConstraint()])); + $this->assertSame($this->metadata->getConstraints(), [$constraint]); + } + public function testAddPropertyConstraints() { $this->metadata->addPropertyConstraint('firstName', new ConstraintA()); @@ -311,3 +328,23 @@ public function testGetPropertyMetadataReturnsEmptyArrayWithoutConfiguredMetadat $this->assertCount(0, $this->metadata->getPropertyMetadata('foo'), '->getPropertyMetadata() returns an empty collection if no metadata is configured for the given property'); } } + +class ClassCompositeConstraint extends Composite +{ + public $nested; + + public function getDefaultOption() + { + return $this->getCompositeOption(); + } + + protected function getCompositeOption() + { + return 'nested'; + } + + public function getTargets() + { + return [self::CLASS_CONSTRAINT]; + } +} diff --git a/src/Symfony/Component/Validator/Tests/Mapping/MemberMetadataTest.php b/src/Symfony/Component/Validator/Tests/Mapping/MemberMetadataTest.php index 651ba9564254a..c387e39797ed4 100644 --- a/src/Symfony/Component/Validator/Tests/Mapping/MemberMetadataTest.php +++ b/src/Symfony/Component/Validator/Tests/Mapping/MemberMetadataTest.php @@ -12,11 +12,16 @@ namespace Symfony\Component\Validator\Tests\Mapping; use PHPUnit\Framework\TestCase; +use Symfony\Component\Validator\Constraints\Collection; +use Symfony\Component\Validator\Constraints\Composite; +use Symfony\Component\Validator\Constraints\Required; use Symfony\Component\Validator\Constraints\Valid; +use Symfony\Component\Validator\Exception\ConstraintDefinitionException; use Symfony\Component\Validator\Mapping\MemberMetadata; use Symfony\Component\Validator\Tests\Fixtures\ClassConstraint; use Symfony\Component\Validator\Tests\Fixtures\ConstraintA; use Symfony\Component\Validator\Tests\Fixtures\ConstraintB; +use Symfony\Component\Validator\Tests\Fixtures\PropertyConstraint; class MemberMetadataTest extends TestCase { @@ -43,6 +48,34 @@ public function testAddConstraintRequiresClassConstraints() $this->metadata->addConstraint(new ClassConstraint()); } + public function testAddCompositeConstraintRejectsNestedClassConstraints() + { + $this->expectException(ConstraintDefinitionException::class); + $this->expectExceptionMessage('The constraint "Symfony\Component\Validator\Tests\Fixtures\ClassConstraint" cannot be put on properties or getters.'); + + $this->metadata->addConstraint(new PropertyCompositeConstraint([new ClassConstraint()])); + } + + public function testAddCompositeConstraintRejectsDeepNestedClassConstraints() + { + $this->expectException(ConstraintDefinitionException::class); + $this->expectExceptionMessage('The constraint "Symfony\Component\Validator\Tests\Fixtures\ClassConstraint" cannot be put on properties or getters.'); + + $this->metadata->addConstraint(new Collection(['field1' => new Required([new ClassConstraint()])])); + } + + public function testAddCompositeConstraintAcceptsNestedPropertyConstraints() + { + $this->metadata->addConstraint($constraint = new PropertyCompositeConstraint([new PropertyConstraint()])); + $this->assertSame($this->metadata->getConstraints(), [$constraint]); + } + + public function testAddCompositeConstraintAcceptsDeepNestedPropertyConstraints() + { + $this->metadata->addConstraint($constraint = new Collection(['field1' => new Required([new PropertyConstraint()])])); + $this->assertSame($this->metadata->getConstraints(), [$constraint]); + } + public function testSerialize() { $this->metadata->addConstraint(new ConstraintA(['property1' => 'A'])); @@ -82,3 +115,18 @@ protected function newReflectionMember($object) { } } + +class PropertyCompositeConstraint extends Composite +{ + public $nested; + + public function getDefaultOption() + { + return $this->getCompositeOption(); + } + + protected function getCompositeOption() + { + return 'nested'; + } +} From b35c81becb9eb7ccb97cce6d11559a87655db9fa Mon Sep 17 00:00:00 2001 From: JakeFr <> Date: Wed, 3 Jun 2020 15:41:40 +0200 Subject: [PATCH 003/128] fix error with custom function and web profiler routing tab --- .../Controller/RouterController.php | 12 +++++++++++- .../WebProfilerBundle/Resources/config/profiler.xml | 2 ++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Controller/RouterController.php b/src/Symfony/Bundle/WebProfilerBundle/Controller/RouterController.php index cedcb9f9d4636..4a93ec656748d 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Controller/RouterController.php +++ b/src/Symfony/Bundle/WebProfilerBundle/Controller/RouterController.php @@ -11,6 +11,7 @@ namespace Symfony\Bundle\WebProfilerBundle\Controller; +use Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\DataCollector\RequestDataCollector; @@ -36,12 +37,18 @@ class RouterController private $matcher; private $routes; - public function __construct(Profiler $profiler = null, Environment $twig, UrlMatcherInterface $matcher = null, RouteCollection $routes = null) + /** + * @var ExpressionFunctionProviderInterface[] + */ + private $expressionLanguageProviders = []; + + public function __construct(Profiler $profiler = null, Environment $twig, UrlMatcherInterface $matcher = null, RouteCollection $routes = null, iterable $expressionLanguageProviders = []) { $this->profiler = $profiler; $this->twig = $twig; $this->matcher = $matcher; $this->routes = (null === $routes && $matcher instanceof RouterInterface) ? $matcher->getRouteCollection() : $routes; + $this->expressionLanguageProviders = $expressionLanguageProviders; } /** @@ -94,6 +101,9 @@ private function getTraces(RequestDataCollector $request, string $method): array $context = $this->matcher->getContext(); $context->setMethod($method); $matcher = new TraceableUrlMatcher($this->routes, $context); + foreach ($this->expressionLanguageProviders as $provider) { + $matcher->addExpressionLanguageProvider($provider); + } return $matcher->getTracesForRequest($traceRequest); } diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/config/profiler.xml b/src/Symfony/Bundle/WebProfilerBundle/Resources/config/profiler.xml index 89ecca5baf8e0..c1c3c8a65e07f 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/config/profiler.xml +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/config/profiler.xml @@ -20,6 +20,8 @@ + null + From b3d081297653a8fc0ec67db22cf33888be68ec28 Mon Sep 17 00:00:00 2001 From: Guilliam Xavier Date: Tue, 7 Jul 2020 20:14:00 +0200 Subject: [PATCH 004/128] Fix author for class CachePoolClearerCacheWarmer --- .../FrameworkBundle/CacheWarmer/CachePoolClearerCacheWarmer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/CachePoolClearerCacheWarmer.php b/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/CachePoolClearerCacheWarmer.php index 734ed5ffb6309..fa87952621c87 100644 --- a/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/CachePoolClearerCacheWarmer.php +++ b/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/CachePoolClearerCacheWarmer.php @@ -19,7 +19,7 @@ * * Do not use in production! * - * @author Kévin Dunglas + * @author Teoh Han Hui * * @internal */ From 696560c6900081e010520b86b4dc74b4e63dce8a Mon Sep 17 00:00:00 2001 From: Wouter de Jong Date: Thu, 9 Jul 2020 16:37:22 +0200 Subject: [PATCH 005/128] Updated README for the Mailer component --- src/Symfony/Component/Mailer/README.md | 57 ++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/src/Symfony/Component/Mailer/README.md b/src/Symfony/Component/Mailer/README.md index 0f70cc30d74b2..a98ed73947152 100644 --- a/src/Symfony/Component/Mailer/README.md +++ b/src/Symfony/Component/Mailer/README.md @@ -3,9 +3,66 @@ Mailer Component The Mailer component helps sending emails. +Getting Started +--------------- + +``` +$ composer require symfony/mailer +``` + +```php +use Symfony\Component\Mailer\Transport; +use Symfony\Component\Mailer\Mailer; + +$transport = Transport::fromDsn('sendgrid://KEY@default'); +$mailer = new Mailer($transport); + +$email = (new Email()) + ->from('hello@example.com') + ->to('you@example.com') + //->cc('cc@example.com') + //->bcc('bcc@example.com') + //->replyTo('fabien@example.com') + //->priority(Email::PRIORITY_HIGH) + ->subject('Time for Symfony Mailer!') + ->text('Sending emails is fun again!') + ->html('

See Twig integration for better HTML integration!

'); + +$mailer->send($email); +``` + +To enable the Twig integration of the Mailer, require `symfony/twig-bridge` and +set up the `BodyRenderer`: + +```php +use Symfony\Bridge\Twig\Mime\BodyRenderer; +use Symfony\Component\EventDispatcher\EventDispatcher; +use Symfony\Component\Mailer\EventListener\MessageListener; +use Twig\Environment as TwigEnvironment; + +$twig = new TwigEnvironment(...); +$messageListener = new MessageListener(new BodyRenderer($twig)); + +$eventDispatcher = new EventDispatcher(); +$eventDispatcher->addSubscriber($messageListener); + +$mailer = new Mailer($transport, null, $eventDispatcher); + +$email = (new TemplatedEmail()) + // ... + ->htmlTemplate('emails/signup.html.twig') + ->context([ + 'expiration_date' => new \DateTime('+7 days'), + 'username' => 'foo', + ]) +; +$mailer->mail($email); +``` + Resources --------- + * [Documentation](https://symfony.com/doc/current/mailer.html) * [Contributing](https://symfony.com/doc/current/contributing/index.html) * [Report issues](https://github.com/symfony/symfony/issues) and [send Pull Requests](https://github.com/symfony/symfony/pulls) From 03c2b40d2fa68c277983da70e0667181810fb9f1 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 24 Jul 2020 05:48:16 +0200 Subject: [PATCH 006/128] updated CHANGELOG for 3.4.43 --- CHANGELOG-3.4.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/CHANGELOG-3.4.md b/CHANGELOG-3.4.md index a2da20414f835..a8fbf76a367ca 100644 --- a/CHANGELOG-3.4.md +++ b/CHANGELOG-3.4.md @@ -7,6 +7,34 @@ 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.43 (2020-07-24) + + * bug #37635 [Cache] fix catching auth errors (nicolas-grekas) + * bug #37572 [FrameworkBundle] set default session.handler alias if handler_id is not provided (Youssef BENHSSAIEN) + * bug #37607 Fix checks for phpunit releases on Composer 2 (colinodell) + * bug #37562 [Cache] Use the default expiry when saving (not when creating) items (philipp-kolesnikov) + * bug #37563 Fix DBAL deprecation (nicolas-grekas) + * bug #37521 [Form] Fix ChoiceType translation domain (VincentLanglet) + * bug #37520 [Form] silently ignore uninitialized properties when mapping data to forms (ph-fritsche) + * bug #37526 [Cache][Config] ensure compatibility with PHP 8 stack traces (xabbuh) + * bug #37461 [Process] Fix Permission Denied error when writing sf_proc_00 lock files on Windows (JasonStephensTAMU) + * bug #37505 [Form] fix handling null as empty data (xabbuh) + * bug #37385 [Console] Fixes question input encoding on Windows (YaFou) + * bug #37447 [Validator] fix validating lazy properties that evaluate to null (xabbuh) + * bug #37464 [ErrorHandler] fix throwing from __toString() (nicolas-grekas) + * bug #37291 [MimeType] Duplicated MimeType due to PHP Bug (juanmrad) + * bug #37425 [Form] fix guessing form types for DateTime types (xabbuh) + * bug #37392 [Validator] fix handling typed properties as constraint options (xabbuh) + * bug #37389 [HttpFondation] Change file extension of "audio/mpeg" from "mpga" to "mp3" (YaFou) + * bug #37383 [VarDumper] Support for cURL handler objects (derrabus) + * bug #37345 [Form] collect all transformation failures (xabbuh) + * bug #37340 Fix support for PHP8 union types (nicolas-grekas) + * bug #37275 [DI] tighten detection of local dirs to prevent false positives (nicolas-grekas) + * bug #37090 [PhpUnitBridge] Streamline ansi/no-ansi of composer according to phpunit --colors option (kick-the-bucket) + * bug #36230 [VarDumper] Fix CliDumper coloration on light arrays (l-vo) + * bug #37270 [FrameworkBundle] preserve dots in query-string when redirecting (nicolas-grekas) + * bug #37342 [Cache] fix compat with DBAL v3 (nicolas-grekas) + * 3.4.42 (2020-06-12) * bug #37103 [Form] switch the context when validating nested forms (xabbuh) From 583794039974664031786b38b68098250259c853 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 24 Jul 2020 05:48:58 +0200 Subject: [PATCH 007/128] update CONTRIBUTORS for 3.4.43 --- CONTRIBUTORS.md | 115 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 77 insertions(+), 38 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index cd95879aaaa07..7b94a4e1e090e 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -15,15 +15,15 @@ Symfony is the result of the work of many people who made the code better - Jordi Boggiano (seldaek) - Victor Berchet (victor) - Maxime Steinhausser (ogizanagi) - - Ryan Weaver (weaverryan) - Grégoire Pineau (lyrixx) + - Ryan Weaver (weaverryan) - Javier Eguiluz (javier.eguiluz) - Roland Franssen (ro0) - Jakub Zalas (jakubzalas) - Johannes S (johannes) - Kris Wallsmith (kriswallsmith) - - Yonel Ceruto (yonelceruto) - Wouter de Jong (wouterj) + - Yonel Ceruto (yonelceruto) - Hugo Hamon (hhamon) - Thomas Calvet (fancyweb) - Alexander M. Turek (derrabus) @@ -35,21 +35,21 @@ Symfony is the result of the work of many people who made the code better - Karma Dordrak (drak) - Lukas Kahwe Smith (lsmith) - Jules Pietri (heah) - - Hamza Amrouche (simperfit) - Martin Hasoň (hason) + - Hamza Amrouche (simperfit) - Jérémy DERUSSÉ (jderusse) - Jeremy Mikola (jmikola) - Jean-François Simon (jfsimon) - Benjamin Eberlei (beberlei) - Igor Wiedler (igorw) - Eriksen Costa (eriksencosta) - - Guilhem Niot (energetick) - Tobias Nyholm (tobias) + - Guilhem Niot (energetick) - Sarah Khalil (saro0h) - Jonathan Wage (jwage) - Lynn van der Berg (kjarli) - - Diego Saint Esteben (dosten) - Matthias Pigulla (mpdude) + - Diego Saint Esteben (dosten) - Pierre du Plessis (pierredup) - Alexandre Salomé (alexandresalome) - William Durand (couac) @@ -63,16 +63,16 @@ Symfony is the result of the work of many people who made the code better - Valentin Udaltsov (vudaltsov) - Bulat Shakirzyanov (avalanche123) - Kevin Bond (kbond) + - Jan Schädlich (jschaedl) - Saša Stamenković (umpirsky) - Peter Rehm (rpet) - - Gábor Egyed (1ed) - Gabriel Ostrolucký (gadelat) + - Gábor Egyed (1ed) - Henrik Bjørnskov (henrikbjorn) - - Miha Vrhovnik - David Maicher (dmaicher) + - Miha Vrhovnik - Titouan Galopin (tgalopin) - Diego Saint Esteben (dii3g0) - - Jan Schädlich (jschaedl) - Konstantin Kudryashov (everzet) - Vladimir Reznichenko (kalessil) - Bilal Amarni (bamarni) @@ -113,10 +113,11 @@ Symfony is the result of the work of many people who made the code better - Tim Nagel (merk) - Chris Wilkinson (thewilkybarkid) - Brice BERNARD (brikou) + - Jérôme Vasseur (jvasseur) - marc.weistroff - Tomáš Votruba (tomas_votruba) - Peter Kokot (maastermedia) - - Jérôme Vasseur (jvasseur) + - Alex Pott - lenar - Alexander Schwenn (xelaris) - Włodzimierz Gajda (gajdaw) @@ -128,7 +129,6 @@ Symfony is the result of the work of many people who made the code better - Oskar Stark (oskarstark) - Javier Spagnoletti (phansys) - Joshua Thijssen - - Alex Pott - Daniel Wehner (dawehner) - Tugdual Saunier (tucksaun) - excelwebzone @@ -137,6 +137,7 @@ Symfony is the result of the work of many people who made the code better - Joel Wurtz (brouznouf) - Fabien Pennequin (fabienpennequin) - Théo FIDRY (theofidry) + - Alexander Schranz (alexander-schranz) - Przemysław Bogusz (przemyslaw-bogusz) - Eric GELOEN (gelo) - Lars Strojny (lstrojny) @@ -144,13 +145,13 @@ Symfony is the result of the work of many people who made the code better - Robert Schönthal (digitalkaoz) - Gregor Harlan (gharlan) - Florian Lonqueu-Brochard (florianlb) - - Alexander Schranz (alexander-schranz) - Gabriel Caruso (carusogabriel) - Stefano Sala (stefano.sala) - Evgeniy (ewgraf) - Julien Falque (julienfalque) - Vincent AUBERT (vincent) - Juti Noppornpitak (shiroyuki) + - Laurent VOULLEMIER (lvo) - Anthony MARTIN (xurudragon) - Tigran Azatyan (tigranazatyan) - Sebastian Hörl (blogsh) @@ -161,9 +162,9 @@ Symfony is the result of the work of many people who made the code better - Yanick Witschi (toflar) - Arnaud Kleinpeter (nanocom) - Guilherme Blanco (guilhermeblanco) - - Laurent VOULLEMIER (lvo) - SpacePossum - Pablo Godel (pgodel) + - Richard van Laak (rvanlaak) - Jérémie Augustin (jaugustin) - François-Xavier de Guillebon (de-gui_f) - Oleg Voronkovich @@ -171,26 +172,26 @@ Symfony is the result of the work of many people who made the code better - Rafael Dohms (rdohms) - jwdeitch - Ahmed TAILOULOUTE (ahmedtai) + - jeremyFreeAgent (jeremyfreeagent) - Mikael Pajunen - Arman Hosseini (arman) - Niels Keurentjes (curry684) - Vyacheslav Pavlov - - Richard van Laak (rvanlaak) + - George Mponos (gmponos) - Richard Shank (iampersistent) - Thomas Rabaix (rande) - Vincent Touzet (vincenttouzet) - - jeremyFreeAgent (jeremyfreeagent) - Rouven Weßling (realityking) - Jérôme Parmentier (lctrs) - Ben Davies (bendavies) - Andreas Schempp (aschempp) - Clemens Tolboom - Helmer Aaviksoo + - Antoine M (amakdessi) - Hiromi Hishida (77web) - Matthieu Ouellette-Vachon (maoueh) - Michał Pipa (michal.pipa) - Dawid Nowak - - George Mponos (gmponos) - Amal Raghav (kertz) - Jonathan Ingram (jonathaningram) - Artur Kotyrba @@ -202,7 +203,6 @@ 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) @@ -220,6 +220,7 @@ Symfony is the result of the work of many people who made the code better - Dennis Benkert (denderello) - DQNEO - Andre Rømcke (andrerom) + - Mathias Arlaud (mtarld) - mcfedr (mcfedr) - Ruben Gonzalez (rubenrua) - Benjamin Dulau (dbenjamin) @@ -247,10 +248,10 @@ Symfony is the result of the work of many people who made the code better - David Prévot - fivestar - Dominique Bongiraud + - Hidde Wieringa (hiddewie) - Jeremy Livingston (jeremylivingston) - Michael Lee (zerustech) - Matthieu Auger (matthieuauger) - - Mathias Arlaud (mtarld) - Leszek Prabucki (l3l0) - Fabien Bourigault (fbourigault) - François Zaninotto (fzaninotto) @@ -262,12 +263,14 @@ Symfony is the result of the work of many people who made the code better - Blanchon Vincent (blanchonvincent) - Michele Orselli (orso) - Sven Paulus (subsven) + - Baptiste Lafontaine (magnetik) - Maxime Veber (nek-) - Rui Marinho (ruimarinho) - Eugene Wissner - Edi Modrić (emodric) - Pascal Montoya - Julien Brochet (mewt) + - François Pluchino (francoispluchino) - Leo Feyer - Tristan Darricau (nicofuma) - Victor Bocharsky (bocharsky_bw) @@ -279,7 +282,6 @@ Symfony is the result of the work of many people who made the code better - Pavel Batanov (scaytrase) - Mantis Development - Loïc Faugeron - - Hidde Wieringa (hiddewie) - dFayet - Marco Pivetta (ocramius) - Rob Frawley 2nd (robfrawley) @@ -315,7 +317,6 @@ Symfony is the result of the work of many people who made the code better - Kristen Gilden (kgilden) - Pierre-Yves LEBECQ (pylebecq) - Jordan Samouh (jordansamouh) - - Baptiste Lafontaine (magnetik) - Jakub Kucharovic (jkucharovic) - Loick Piera (pyrech) - Uwe Jäger (uwej711) @@ -328,7 +329,6 @@ Symfony is the result of the work of many people who made the code better - Jan Sorgalla (jsor) - Ray - Chekote - - François Pluchino (francoispluchino) - Thomas Adam - Jhonny Lidfors (jhonne) - Diego Agulló (aeoris) @@ -352,6 +352,7 @@ Symfony is the result of the work of many people who made the code better - Roumen Damianoff (roumen) - Emanuele Panzeri (thepanz) - Kim Hemsø Rasmussen (kimhemsoe) + - Alessandro Lai (jean85) - Pascal Luna (skalpa) - Wouter Van Hecke - Peter Kruithof (pkruithof) @@ -409,6 +410,7 @@ Symfony is the result of the work of many people who made the code better - Berny Cantos (xphere81) - Thierry Thuon (lepiaf) - Guilhem N (guilhemn) + - Sebastien Morel (plopix) - Ricard Clau (ricardclau) - Mark Challoner (markchalloner) - Philippe Segatori @@ -423,7 +425,6 @@ Symfony is the result of the work of many people who made the code better - Oleg Andreyev - Langlet Vincent (deviling) - Mateusz Sip (mateusz_sip) - - Alessandro Lai (jean85) - Francesco Levorato - Vitaliy Zakharov (zakharovvi) - Tobias Sjösten (tobiassjosten) @@ -439,9 +440,11 @@ Symfony is the result of the work of many people who made the code better - Felix Labrecque - Yaroslav Kiliba - Terje Bråten + - Daniel STANCU - Robbert Klarenbeek (robbertkl) - soyuka - Eric Masoero (eric-masoero) + - Ion Bazan (ionbazan) - Denis Brumann (dbrumann) - Gocha Ossinkine (ossinkine) - JhonnyL @@ -510,19 +513,21 @@ Symfony is the result of the work of many people who made the code better - Sander Toonen (xatoo) - Anthon Pang (robocoder) - Marko Kaznovac (kaznovac) + - Thomas Landauer (thomas-landauer) - Sébastien Santoro (dereckson) - Brian King - Michel Salib (michelsalib) + - quentin neyrat (qneyrat) - Chris Tanaskoski - geoffrey - Steffen Roßkamp - Alexandru Furculita (afurculita) - Valentin Jonovs (valentins-jonovs) - - Sebastien Morel (plopix) - Jeanmonod David (jeanmonod) - Christopher Davis (chrisguitarguy) - Webnet team (webnet) - Joe Bennett (kralos) + - Ahmed Raafat - Farhad Safarov - Jan Schumann - Niklas Fiekas @@ -531,15 +536,18 @@ Symfony is the result of the work of many people who made the code better - Erkhembayar Gantulga (erheme318) - Islam93 - lancergr + - Tri Pham (phamuyentri) - Mihai Stancu - Ivan Nikolaev (destillat) - Gildas Quéméner (gquemener) + - Claude Khedhiri (ck-developer) - Desjardins Jérôme (jewome62) - Arturs Vonda - Josip Kruslin - Matthew Smeets - Toni Rudolf (toooni) - Asmir Mustafic (goetas) + - DerManoMann - Nicolas Philippe (nikophil) - vagrant - Aurimas Niekis (gcds) @@ -551,6 +559,7 @@ Symfony is the result of the work of many people who made the code better - Vlad Gregurco (vgregurco) - Boris Vujicic (boris.vujicic) - Artem Lopata + - Judicaël RUFFIEUX (axanagor) - Chris Sedlmayr (catchamonkey) - Kamil Kokot (pamil) - Seb Koelen @@ -564,7 +573,6 @@ 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) @@ -583,6 +591,7 @@ Symfony is the result of the work of many people who made the code better - Adam Harvey - Anton Bakai - Martin Auswöger + - Christian Scheb - Rhodri Pugh (rodnaph) - battye - Sam Fleming (sam_fleming) @@ -685,7 +694,6 @@ Symfony is the result of the work of many people who made the code better - Jeremy Benoist - fritzmg - Lenar Lõhmus - - Ion Bazan (ionbazan) - Benjamin Laugueux (yzalis) - Zach Badgett (zachbadgett) - Chi-teck @@ -693,7 +701,6 @@ Symfony is the result of the work of many people who made the code better - Pavel Campr (pcampr) - Andrii Dembitskyi - Johnny Robeson (johnny) - - Thomas Landauer (thomas-landauer) - Guilliam Xavier - Disquedur - Michiel Boeckaert (milio) @@ -721,6 +728,7 @@ Symfony is the result of the work of many people who made the code better - Andrey Sevastianov - Sebastian Blum - Alexis Lefebvre + - Dmitriy Mamontov (mamontovdmitriy) - aubx - Julien Turby - Marvin Butkereit @@ -772,7 +780,6 @@ Symfony is the result of the work of many people who made the code better - David Fuhr - Mathias STRASSER (roukmoute) - Max Grigorian (maxakawizard) - - DerManoMann - Rostyslav Kinash - Dennis Fridrich (dfridrich) - Mardari Dorel (dorumd) @@ -795,9 +802,11 @@ Symfony is the result of the work of many people who made the code better - umpirski - M. Vondano - Quentin de Longraye (quentinus95) + - Bohan Yang (brentybh) - Chris Heng (gigablah) - Shaun Simmons (simshaun) - Richard Bradley + - Mathieu Santostefano - Ulumuddin Yunus (joenoez) - rtek - Ivan Grigoriev @@ -812,6 +821,7 @@ Symfony is the result of the work of many people who made the code better - Szijarto Tamas - Robin Lehrmann (robinlehrmann) - Catalin Dan + - Marco Petersen (ocrampete16) - Soner Sayakci - Jaroslav Kuba - Kristijan Kanalas @@ -905,12 +915,10 @@ Symfony is the result of the work of many people who made the code better - Jonatan Männchen - Dennis Hotson - Andrew Tchircoff (andrewtch) - - Ahmed Raafat - michaelwilliams - Martin Kirilov - 1emming - Nykopol (nykopol) - - Tri Pham (phamuyentri) - Jordan Deitch - Casper Valdemar Poulsen - Laurent Masforné (heisenberg) @@ -939,6 +947,7 @@ Symfony is the result of the work of many people who made the code better - Jon Dufresne - possum - Denis Zunke (donalberto) + - Phil Taylor (prazgod) - Ahmadou Waly Ndiaye (waly) - Jonathan Johnson (jrjohnson) - Olivier Maisonneuve (olineuve) @@ -999,7 +1008,9 @@ Symfony is the result of the work of many people who made the code better - Mathieu MARCHOIS - Cyril Quintin (cyqui) - Gerard van Helden (drm) + - flack (flack) - Johnny Peck (johnnypeck) + - Michael Voříšek - Stefan Kruppa - Ivan Menshykov - David Romaní @@ -1035,6 +1046,7 @@ Symfony is the result of the work of many people who made the code better - Jérémy M (th3mouk) - Simone Di Maulo (toretto460) - Christian Morgan + - YaFou - Alexander Miehe (engerim) - Morgan Auchede (mauchede) - Sascha Dens (saschadens) @@ -1064,6 +1076,7 @@ Symfony is the result of the work of many people who made the code better - Matthew Davis (mdavis1982) - Paulo Ribeiro (paulo) - Markus S. (staabm) + - Marc Laporte - Benjamin Morel - Maks - Antoine LA @@ -1106,14 +1119,19 @@ Symfony is the result of the work of many people who made the code better - Renan Taranto (renan-taranto) - Rikijs Murgs - Uladzimir Tsykun + - iamvar - Ben Ramsey (ramsey) - Amaury Leroux de Lens (amo__) - Christian Jul Jensen - Alexandre GESLIN (alexandregeslin) - The Whole Life to Learn + - Alex Vo (votanlean) - Mikkel Paulson - ergiegonzaga + - Daniel González - Liverbool (liverbool) + - Malte Schlüter + - Jules Matsounga (hyoa) - Sam Malone - Phan Thanh Ha (haphan) - Chris Jones (leek) @@ -1121,6 +1139,7 @@ Symfony is the result of the work of many people who made the code better - xaav - Mahmoud Mostafa (mahmoud) - Antonio Jose Cerezo (ajcerezo) + - Anthony Moutte - Ahmed Abdou - Daniel Iwaniec - Thomas Ferney @@ -1141,9 +1160,11 @@ Symfony is the result of the work of many people who made the code better - Iliya Miroslavov Iliev (i.miroslavov) - Safonov Nikita (ns3777k) - Ross Motley (rossmotley) + - Krystian Marcisz (simivar) - ttomor - Mei Gwilym (meigwilym) - Michael H. Arieli (excelwebzone) + - Nicolas Martin (cocorambo) - Tom Panier (neemzy) - Fred Cox - Luciano Mammino (loige) @@ -1156,6 +1177,7 @@ Symfony is the result of the work of many people who made the code better - Lorenzo Millucci - Andreas Kleemann - Manuele Menozzi + - Philipp Kolesnikov - zairig imad (zairigimad) - Anton Babenko (antonbabenko) - Irmantas Šiupšinskas (irmantas) @@ -1166,6 +1188,7 @@ Symfony is the result of the work of many people who made the code better - Arnaud PETITPAS (apetitpa) - Ken Stanley - Zachary Tong (polyfractal) + - linh - Mario Blažek (marioblazek) - Ashura - Hryhorii Hrebiniuk @@ -1199,11 +1222,11 @@ Symfony is the result of the work of many people who made the code better - Patrick Luca Fazzi (ap3ir0n) - Danijel Obradović - Pablo Borowicz - - Mathieu Santostefano - Arjan Keeman - Máximo Cuadros (mcuadros) - Lukas Mencl - tamirvs + - Mohammad Emran Hasan (phpfour) - gauss - julien.galenski - Christian Neff @@ -1230,7 +1253,6 @@ Symfony is the result of the work of many people who made the code better - gr1ev0us - mlazovla - Alejandro Diaz Torres - - quentin neyrat (qneyrat) - Max Beutel - Jan Vernieuwe (vernija) - Antanas Arvasevicius @@ -1259,10 +1281,12 @@ Symfony is the result of the work of many people who made the code better - Dominic Tubach - Nikita Konstantinov - Martijn Evers + - Philipp Fritsche - Vitaliy Ryaboy (vitaliy) - Benjamin Paap (benjaminpaap) - Claus Due (namelesscoder) - Christian + - Alexandru Patranescu - Denis Golubovskiy (bukashk0zzz) - Sergii Smertin (nfx) - Mikkel Paulson @@ -1313,10 +1337,12 @@ Symfony is the result of the work of many people who made the code better - James Hudson - Stephen Clouse - e-ivanov + - Carlos Pereira De Amorim (epitre) - Benjamin Dos Santos - Einenlum - Jérémy Jarrié (gagnar) - Jochen Bayer (jocl) + - Tomas Javaisis - Patrick Carlo-Hickman - Bruno MATEU - Jeremy Bush @@ -1334,7 +1360,6 @@ Symfony is the result of the work of many people who made the code better - Péter Buri (burci) - John VanDeWeghe - kaiwa - - Claude Khedhiri (ck-developer) - Charles Sanquer (csanquer) - Albert Ganiev (helios-ag) - Neil Katin @@ -1368,6 +1393,7 @@ Symfony is the result of the work of many people who made the code better - Nathan PAGE (nathix) - Ryan Rogers - Klaus Purer + - Dmitrii Lozhkin - arnaud (arnooo999) - Gilles Doge (gido) - Oscar Esteve (oesteve) @@ -1382,6 +1408,7 @@ Symfony is the result of the work of many people who made the code better - Dmitriy Simushev - Pawel Smolinski - Tomasz (timitao) + - Nguyen Tuan Minh (tuanminhgp) - Oxan van Leeuwen - pkowalczyk - Soner Sayakci @@ -1411,6 +1438,7 @@ Symfony is the result of the work of many people who made the code better - David Legatt (dlegatt) - Alain Flaus (halundra) - tsufeki + - dangkhoagms - Philipp Strube - Clement Herreman (clemherreman) - Dan Ionut Dumitriu (danionut90) @@ -1473,6 +1501,7 @@ Symfony is the result of the work of many people who made the code better - Andrei Igna - Adam Prickett - azine + - Javier Espinosa - Anton Kroshilin - Dawid Sajdak - Ludek Stepan @@ -1527,6 +1556,7 @@ Symfony is the result of the work of many people who made the code better - Jules Lamur - Renato Mendes Figueiredo - Benjamin RICHARD + - Gennadi Janzen - pdommelen - Eric Stern - ShiraNai7 @@ -1551,8 +1581,10 @@ Symfony is the result of the work of many people who made the code better - Philip Frank - David Brooks - Lance McNearney + - Florian Caron (shalalalala) - Serhiy Lunak (slunak) - Giorgio Premi + - Mikko Pesari - Aurélien Fontaine - ncou - Ian Carroll @@ -1592,6 +1624,7 @@ Symfony is the result of the work of many people who made the code better - Jay Severson - Benny Born - Emirald Mateli + - Tristan Pouliquen - René Kerner - Nathaniel Catchpole - Adrien Samson (adriensamson) @@ -1627,6 +1660,7 @@ Symfony is the result of the work of many people who made the code better - Peter Bouwdewijn - mlively - Wouter Diesveld + - Vincent Langlet - Amine Matmati - caalholm - Nouhail AL FIDI (alfidi) @@ -1641,6 +1675,7 @@ Symfony is the result of the work of many people who made the code better - rkerner - Alex Silcock - Qingshan Luo + - Gijs van Lammeren - Ergie Gonzaga - Matthew J Mucklo - AnrDaemon @@ -1691,6 +1726,7 @@ Symfony is the result of the work of many people who made the code better - LubenZA - Victor Garcia - Olivier + - Juan Mrad - Denis Yuzhanin - knezmilos13 - Cyril PASCAL @@ -1759,6 +1795,7 @@ Symfony is the result of the work of many people who made the code better - 2manypeople - Wing - Thomas Bibb + - kick-the-bucket - Matt Farmer - catch - Alexandre Segura @@ -1812,6 +1849,7 @@ Symfony is the result of the work of many people who made the code better - Thomas Chmielowiec - shdev - Andrey Ryaguzov + - Gennadi Janzen - Stefan - Peter Bex - Manatsawin Hanmongkolchai @@ -1822,7 +1860,6 @@ Symfony is the result of the work of many people who made the code better - Dennis Væversted - Timon van der Vorm - nuncanada - - flack - František Bereň - Kamil Madejski - Jeremiah VALERIE @@ -1833,6 +1870,7 @@ Symfony is the result of the work of many people who made the code better - Denys Voronin (hurricane) - Ionel Scutelnicu (ionelscutelnicu) - Mathieu Dewet (mdewet) + - none (nelexa) - Nicolas Tallefourtané (nicolab) - Botond Dani (picur) - Rémi Faivre (rfv) @@ -1869,6 +1907,7 @@ Symfony is the result of the work of many people who made the code better - Adrien Wilmet - Martin - nietonfir + - Taylor Otwell - alefranz - David Barratt - Andrea Giannantonio @@ -1954,7 +1993,6 @@ Symfony is the result of the work of many people who made the code better - Tim Strehle - Sébastien COURJEAN - Sam Ward - - Michael Voříšek - Walther Lalk - Adam - Ivo @@ -1964,7 +2002,6 @@ Symfony is the result of the work of many people who made the code better - Ali Tavafi - Trevor Suarez - gedrox - - Bohan Yang - Alan Bondarchuk - Pchol - dropfen @@ -1998,7 +2035,6 @@ Symfony is the result of the work of many people who made the code better - Andrew Marcinkevičius (ifdattic) - Ioana Hazsda (ioana-hazsda) - Jan Marek (janmarek) - - Dmitriy Mamontov (mamontovdmitriy) - Mark de Haan (markdehaan) - Dan Patrick (mdpatrick) - naitsirch (naitsirch) @@ -2082,7 +2118,7 @@ Symfony is the result of the work of many people who made the code better - Rowan Manning - Per Modin - David Windell - - Christian Scheb + - Ondřej Frei - Gabriel Birke - skafandri - Derek Bonner @@ -2120,6 +2156,7 @@ Symfony is the result of the work of many people who made the code better - Klaas Naaijkens - Daniel González Cerviño - Rafał + - Ahmad El-Bardan (absahmad) - Achilles Kaloeridis (achilles) - Adria Lopez (adlpz) - Aaron Scherer (aequasi) @@ -2180,6 +2217,7 @@ Symfony is the result of the work of many people who made the code better - Ondrej Mirtes - akimsko - Youpie + - Jason Stephens - srsbiz - Taylan Kasap - Michael Orlitzky @@ -2237,6 +2275,7 @@ Symfony is the result of the work of many people who made the code better - Nardberjean - Karolis - Myke79 + - jersoe - Brian Debuire - Eric Grimois - Piers Warmers @@ -2344,6 +2383,7 @@ Symfony is the result of the work of many people who made the code better - Sema - Elan Ruusamäe - Thorsten Hallwas + - Marco Pfeiffer - Alex Nostadt - Michael Squires - Egor Gorbachev @@ -2480,7 +2520,6 @@ Symfony is the result of the work of many people who made the code better - Ala Eddine Khefifi (nayzo) - emilienbouard (neime) - Nicholas Byfleet (nickbyfleet) - - Marco Petersen (ocrampete16) - ollie harridge (ollietb) - Paul Andrieux (paulandrieux) - Paweł Szczepanek (pauluz) @@ -2491,7 +2530,6 @@ Symfony is the result of the work of many people who made the code better - Alex Carol (picard89) - Daniel Perez Pinazo (pitiflautico) - Igor Tarasov (polosatus) - - Phil Taylor (prazgod) - Maxim Pustynnikov (pustynnikov) - Ralf Kuehnel (ralfkuehnel) - Brayden Williams (redstar504) @@ -2570,6 +2608,7 @@ Symfony is the result of the work of many people who made the code better - Bogdan Rancichi (devck) - Daniel Kolvik (dkvk) - Marc Lemay (flug) + - Gabriel Solomon (gabrielsolomon) - Henne Van Och (hennevo) - Jeroen De Dauw (jeroendedauw) - Jonathan Scheiber (jmsche) From 5012c9237fcfaa68ef53cf7082d7cd4f08031c17 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 24 Jul 2020 05:48:59 +0200 Subject: [PATCH 008/128] updated VERSION for 3.4.43 --- 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 7fad1ee281311..e824fdcf72947 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.43-DEV'; + const VERSION = '3.4.43'; const VERSION_ID = 30443; const MAJOR_VERSION = 3; const MINOR_VERSION = 4; const RELEASE_VERSION = 43; - const EXTRA_VERSION = 'DEV'; + const EXTRA_VERSION = ''; const END_OF_MAINTENANCE = '11/2020'; const END_OF_LIFE = '11/2021'; From 81fadc9cc1b9934e533b2cc570c89a807d5ba144 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 24 Jul 2020 06:07:51 +0200 Subject: [PATCH 009/128] Bump Symfony version to 3.4.44 --- 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 e824fdcf72947..1b270bfdeca25 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.43'; - const VERSION_ID = 30443; + const VERSION = '3.4.44-DEV'; + const VERSION_ID = 30444; const MAJOR_VERSION = 3; const MINOR_VERSION = 4; - const RELEASE_VERSION = 43; - const EXTRA_VERSION = ''; + const RELEASE_VERSION = 44; + const EXTRA_VERSION = 'DEV'; const END_OF_MAINTENANCE = '11/2020'; const END_OF_LIFE = '11/2021'; From dca19c19b30d8ef37c45543166a3663bdcc8b168 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 24 Jul 2020 06:09:57 +0200 Subject: [PATCH 010/128] Update CHANGELOG for 4.4.11 --- CHANGELOG-4.4.md | 64 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/CHANGELOG-4.4.md b/CHANGELOG-4.4.md index 2f51e38874c8f..f899cac51ac7f 100644 --- a/CHANGELOG-4.4.md +++ b/CHANGELOG-4.4.md @@ -7,6 +7,70 @@ in 4.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/v4.4.0...v4.4.1 +* 4.4.11 (2020-07-24) + + * bug #37590 Allows RedisClusterProxy instance in Lock RedisStore (jderusse) + * bug #37583 [Mime] Fix EmailHeaderSame to make use of decoded value (evertharmeling) + * bug #37569 [Messenger] Allow same middleware to be used multiple times with different arguments (HypeMC) + * bug #37624 [Cache] Connect to RedisCluster with password auth (mforbak) + * bug #37635 [Cache] fix catching auth errors (nicolas-grekas) + * bug #37628 [Serializer] Support multiple levels of discriminator mapping (jeroennoten) + * bug #37572 [FrameworkBundle] set default session.handler alias if handler_id is not provided (Youssef BENHSSAIEN) + * bug #37607 Fix checks for phpunit releases on Composer 2 (colinodell) + * bug #37594 Use hexadecimal numerals instead of hexadecimals in strings to repres… (arekzb) + * bug #37576 [WebProfilerBundle] modified url generation to use absolute urls (smatyas) + * bug #36888 [Mailer] Fix mandrill raw http request setting from email/name (JohJohan) + * bug #37527 [Mailer] Fix reply-to functionality in the SendgridApiTransport (jt2k) + * bug #37581 [Mime] Fix compat with HTTP requests (fabpot) + * bug #37580 [Mime] Keep Sender full address when used by non-SMTP transports (fabpot) + * bug #37511 [DependencyInjection][Config] Use several placeholder unique prefixes for dynamic placeholder values (fancyweb) + * bug #37562 [Cache] Use the default expiry when saving (not when creating) items (philipp-kolesnikov) + * bug #37563 Fix DBAL deprecation (nicolas-grekas) + * bug #37521 [Form] Fix ChoiceType translation domain (VincentLanglet) + * bug #37550 [OptionsResolver] Fix force prepend normalizer (hason) + * bug #37520 [Form] silently ignore uninitialized properties when mapping data to forms (ph-fritsche) + * bug #37526 [Cache][Config] ensure compatibility with PHP 8 stack traces (xabbuh) + * bug #37513 [PhpUnitBridge] ExcludeList usage for PHPUnit 9.4 (gennadigennadigennadi) + * bug #37461 [Process] Fix Permission Denied error when writing sf_proc_00 lock files on Windows (JasonStephensTAMU) + * bug #37505 [Form] fix handling null as empty data (xabbuh) + * bug #37385 [Console] Fixes question input encoding on Windows (YaFou) + * bug #37491 [HttpClient] Fix promise behavior in HttplugClient (brentybh) + * bug #37469 [Console] always use stty when possible to ask hidden questions (nicolas-grekas) + * bug #37486 [HttpClient] fix parsing response headers in CurlResponse (nicolas-grekas) + * bug #37484 [HttpClient][CurlHttpClient] Fix http_version option usage (fancyweb) + * bug #37447 [Validator] fix validating lazy properties that evaluate to null (xabbuh) + * bug #37464 [ErrorHandler] fix throwing from __toString() (nicolas-grekas) + * bug #37449 [Translation] Fix caching of parent locales file in translator (jvasseur) + * bug #37418 [PhpUnitBridge] Fix compatibility with phpunit 9.3 (Gennadi Janzen) + * bug #37441 [DoctrineBridge] work around Connection::ping() deprecation (nicolas-grekas) + * bug #37291 [MimeType] Duplicated MimeType due to PHP Bug (juanmrad) + * bug #37429 [DI] fix parsing of argument type=binary in xml (Tobion) + * bug #37425 [Form] fix guessing form types for DateTime types (xabbuh) + * bug #37392 [Validator] fix handling typed properties as constraint options (xabbuh) + * bug #37358 Directly use the driverConnection executeUpdate method (TristanPouliquen) + * bug #37389 [HttpFondation] Change file extension of "audio/mpeg" from "mpga" to "mp3" (YaFou) + * bug #37379 [HttpClient] Support for cURL handler objects (derrabus) + * bug #37383 [VarDumper] Support for cURL handler objects (derrabus) + * bug #37395 add .body wrapper element (Nemo64) + * bug #37400 [HttpClient] unset activity list when creating CurlResponse (nicolas-grekas) + * bug #36304 Check whether path is file in DataPart::fromPath() (freiondrej) + * bug #37345 [Form] collect all transformation failures (xabbuh) + * bug #37362 [SecurityBundle] Drop cache.security_expression_language service if invalid (chalasr) + * bug #37353 [DI] disable preload.php on the CLI (nicolas-grekas) + * bug #37268 [Messenger] Fix precedence of DSN options for 4.4 (jderusse) + * bug #37341 Fix support for PHP8 union types (nicolas-grekas) + * bug #37271 [FrameworkBundle] preserve dots in query-string when redirecting (nicolas-grekas) + * bug #37340 Fix support for PHP8 union types (nicolas-grekas) + * bug #37275 [DI] tighten detection of local dirs to prevent false positives (nicolas-grekas) + * bug #37090 [PhpUnitBridge] Streamline ansi/no-ansi of composer according to phpunit --colors option (kick-the-bucket) + * bug #36230 [VarDumper] Fix CliDumper coloration on light arrays (l-vo) + * bug #37270 [FrameworkBundle] preserve dots in query-string when redirecting (nicolas-grekas) + * bug #37319 [HttpClient] Convert CurlHttpClient::handlePush() to instance method (mpesari) + * bug #37342 [Cache] fix compat with DBAL v3 (nicolas-grekas) + * bug #37286 [Console] Reset question validator attempts only for actual stdin (bis) (nicolas-grekas) + * bug #37160 Reset question validator attempts only for actual stdin (ostrolucky) + * bug #36975 [PropertyInfo] Make PhpDocExtractor compatible with phpDocumentor v5 (DerManoMann) + * 4.4.10 (2020-06-12) * bug #37227 [DependencyInjection][CheckTypeDeclarationsPass] Handle unresolved parameters pointing to environment variables (fancyweb) From 3cfbf521a460955ab75eb69eea85e90fa41858ae Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 24 Jul 2020 06:10:09 +0200 Subject: [PATCH 011/128] Update VERSION for 4.4.11 --- 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 6b08101e216c8..2efa73a3751ff 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -76,12 +76,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl private static $freshCache = []; - const VERSION = '4.4.11-DEV'; + const VERSION = '4.4.11'; const VERSION_ID = 40411; const MAJOR_VERSION = 4; const MINOR_VERSION = 4; const RELEASE_VERSION = 11; - const EXTRA_VERSION = 'DEV'; + const EXTRA_VERSION = ''; const END_OF_MAINTENANCE = '11/2022'; const END_OF_LIFE = '11/2023'; From f3cfae8ea7631d6399bd05b4640539a3b4ea5ee2 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 24 Jul 2020 06:14:13 +0200 Subject: [PATCH 012/128] Bump Symfony version to 4.4.12 --- 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 2efa73a3751ff..7c89e610fa673 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -76,12 +76,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl private static $freshCache = []; - const VERSION = '4.4.11'; - const VERSION_ID = 40411; + const VERSION = '4.4.12-DEV'; + const VERSION_ID = 40412; const MAJOR_VERSION = 4; const MINOR_VERSION = 4; - const RELEASE_VERSION = 11; - const EXTRA_VERSION = ''; + const RELEASE_VERSION = 12; + const EXTRA_VERSION = 'DEV'; const END_OF_MAINTENANCE = '11/2022'; const END_OF_LIFE = '11/2023'; From fd6181c8b566f8ec359d012558a00944d7014147 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 24 Jul 2020 06:28:10 +0200 Subject: [PATCH 013/128] Bump Symfony version to 5.1.4 --- 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 a906fdb82efb5..22732d9a805d4 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 static $freshCache = []; - const VERSION = '5.1.3'; - const VERSION_ID = 50103; + const VERSION = '5.1.4-DEV'; + const VERSION_ID = 50104; const MAJOR_VERSION = 5; const MINOR_VERSION = 1; - const RELEASE_VERSION = 3; - const EXTRA_VERSION = ''; + const RELEASE_VERSION = 4; + const EXTRA_VERSION = 'DEV'; const END_OF_MAINTENANCE = '01/2021'; const END_OF_LIFE = '01/2021'; From afbd51b368651b732e033303f91dbc87e6365bf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Deruss=C3=A9?= Date: Fri, 24 Jul 2020 12:11:03 +0200 Subject: [PATCH 014/128] Fix invalid option sslmode --- .../Tests/Transport/ConnectionTest.php | 42 +++++++++++++++++++ .../Bridge/AmazonSqs/Transport/Connection.php | 27 ++++++------ 2 files changed, 56 insertions(+), 13 deletions(-) diff --git a/src/Symfony/Component/Messenger/Bridge/AmazonSqs/Tests/Transport/ConnectionTest.php b/src/Symfony/Component/Messenger/Bridge/AmazonSqs/Tests/Transport/ConnectionTest.php index 447988ec8b041..8d1ccdfe4403d 100644 --- a/src/Symfony/Component/Messenger/Bridge/AmazonSqs/Tests/Transport/ConnectionTest.php +++ b/src/Symfony/Component/Messenger/Bridge/AmazonSqs/Tests/Transport/ConnectionTest.php @@ -97,6 +97,24 @@ public function testFromDsnWithCustomEndpoint() ); } + public function testFromDsnWithSslMode() + { + $httpClient = $this->getMockBuilder(HttpClientInterface::class)->getMock(); + $this->assertEquals( + new Connection(['queue_name' => 'queue'], new SqsClient(['region' => 'eu-west-1', 'endpoint' => 'http://localhost', 'accessKeyId' => null, 'accessKeySecret' => null], null, $httpClient)), + Connection::fromDsn('sqs://localhost/queue?sslmode=disable', [], $httpClient) + ); + } + + public function testFromDsnWithSslModeOnDefault() + { + $httpClient = $this->getMockBuilder(HttpClientInterface::class)->getMock(); + $this->assertEquals( + new Connection(['queue_name' => 'queue'], new SqsClient(['region' => 'eu-west-1', 'accessKeyId' => null, 'accessKeySecret' => null], null, $httpClient)), + Connection::fromDsn('sqs://default/queue?sslmode=disable', [], $httpClient) + ); + } + public function testFromDsnWithCustomEndpointAndPort() { $httpClient = $this->getMockBuilder(HttpClientInterface::class)->getMock(); @@ -149,6 +167,30 @@ public function testFromDsnWithAccountAndEndpointOption() ); } + public function testFromDsnWithInvalidQueryString() + { + $this->expectException(\InvalidArgumentException::class); + $this->expectExceptionMessage('Unknown option found in DSN: [foo]. Allowed options are [buffer_size, wait_time, poll_timeout, visibility_timeout, auto_setup, access_key, secret_key, endpoint, region, queue_name, account, sslmode].'); + + Connection::fromDsn('sqs://default?foo=foo'); + } + + public function testFromDsnWithInvalidOption() + { + $this->expectException(\InvalidArgumentException::class); + $this->expectExceptionMessage('Unknown option found: [bar]. Allowed options are [buffer_size, wait_time, poll_timeout, visibility_timeout, auto_setup, access_key, secret_key, endpoint, region, queue_name, account, sslmode].'); + + Connection::fromDsn('sqs://default', ['bar' => 'bar']); + } + + public function testFromDsnWithInvalidQueryStringAndOption() + { + $this->expectException(\InvalidArgumentException::class); + $this->expectExceptionMessage('Unknown option found: [bar]. Allowed options are [buffer_size, wait_time, poll_timeout, visibility_timeout, auto_setup, access_key, secret_key, endpoint, region, queue_name, account, sslmode].'); + + Connection::fromDsn('sqs://default?foo=foo', ['bar' => 'bar']); + } + public function testKeepGettingPendingMessages() { $client = $this->createMock(SqsClient::class); diff --git a/src/Symfony/Component/Messenger/Bridge/AmazonSqs/Transport/Connection.php b/src/Symfony/Component/Messenger/Bridge/AmazonSqs/Transport/Connection.php index 29bb1006fef76..da72a795dab16 100644 --- a/src/Symfony/Component/Messenger/Bridge/AmazonSqs/Transport/Connection.php +++ b/src/Symfony/Component/Messenger/Bridge/AmazonSqs/Transport/Connection.php @@ -44,6 +44,7 @@ class Connection 'region' => 'eu-west-1', 'queue_name' => 'messages', 'account' => null, + 'sslmode' => null, ]; private $configuration; @@ -94,6 +95,19 @@ public static function fromDsn(string $dsn, array $options = [], HttpClientInter if (isset($parsedUrl['query'])) { parse_str($parsedUrl['query'], $query); } + + // check for extra keys in options + $optionsExtraKeys = array_diff(array_keys($options), array_keys(self::DEFAULT_OPTIONS)); + if (0 < \count($optionsExtraKeys)) { + throw new InvalidArgumentException(sprintf('Unknown option found: [%s]. Allowed options are [%s].', implode(', ', $optionsExtraKeys), implode(', ', array_keys(self::DEFAULT_OPTIONS)))); + } + + // check for extra keys in options + $queryExtraKeys = array_diff(array_keys($query), array_keys(self::DEFAULT_OPTIONS)); + if (0 < \count($queryExtraKeys)) { + throw new InvalidArgumentException(sprintf('Unknown option found in DSN: [%s]. Allowed options are [%s].', implode(', ', $queryExtraKeys), implode(', ', array_keys(self::DEFAULT_OPTIONS)))); + } + $options = $query + $options + self::DEFAULT_OPTIONS; $configuration = [ 'buffer_size' => (int) $options['buffer_size'], @@ -116,7 +130,6 @@ public static function fromDsn(string $dsn, array $options = [], HttpClientInter if (preg_match(';^sqs\.([^\.]++)\.amazonaws\.com$;', $parsedUrl['host'], $matches)) { $clientConfiguration['region'] = $matches[1]; } - unset($query['sslmode']); } elseif (self::DEFAULT_OPTIONS['endpoint'] !== $options['endpoint'] ?? self::DEFAULT_OPTIONS['endpoint']) { $clientConfiguration['endpoint'] = $options['endpoint']; } @@ -127,18 +140,6 @@ public static function fromDsn(string $dsn, array $options = [], HttpClientInter } $configuration['account'] = 2 === \count($parsedPath) ? $parsedPath[0] : $options['account'] ?? self::DEFAULT_OPTIONS['account']; - // check for extra keys in options - $optionsExtraKeys = array_diff(array_keys($options), array_keys(self::DEFAULT_OPTIONS)); - if (0 < \count($optionsExtraKeys)) { - throw new InvalidArgumentException(sprintf('Unknown option found : [%s]. Allowed options are [%s].', implode(', ', $optionsExtraKeys), implode(', ', array_keys(self::DEFAULT_OPTIONS)))); - } - - // check for extra keys in options - $queryExtraKeys = array_diff(array_keys($query), array_keys(self::DEFAULT_OPTIONS)); - if (0 < \count($queryExtraKeys)) { - throw new InvalidArgumentException(sprintf('Unknown option found in DSN: [%s]. Allowed options are [%s].', implode(', ', $queryExtraKeys), implode(', ', array_keys(self::DEFAULT_OPTIONS)))); - } - return new self($configuration, new SqsClient($clientConfiguration, null, $client)); } From bdec105a72ef6c8d832fd2e80fabf1681a2d0616 Mon Sep 17 00:00:00 2001 From: Philipp Kolesnikov Date: Sun, 26 Jul 2020 15:13:16 +1000 Subject: [PATCH 015/128] [Cache] Fix #37667 --- .../Component/Cache/Adapter/ArrayAdapter.php | 4 ++++ .../Tests/Adapter/TagAwareAdapterTest.php | 20 +++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/src/Symfony/Component/Cache/Adapter/ArrayAdapter.php b/src/Symfony/Component/Cache/Adapter/ArrayAdapter.php index ff826f47a2ffc..7e97875435671 100644 --- a/src/Symfony/Component/Cache/Adapter/ArrayAdapter.php +++ b/src/Symfony/Component/Cache/Adapter/ArrayAdapter.php @@ -113,6 +113,10 @@ public function save(CacheItemInterface $item) $value = $item["\0*\0value"]; $expiry = $item["\0*\0expiry"]; + if (0 === $expiry) { + $expiry = PHP_INT_MAX; + } + if (null !== $expiry && $expiry <= time()) { $this->deleteItem($key); diff --git a/src/Symfony/Component/Cache/Tests/Adapter/TagAwareAdapterTest.php b/src/Symfony/Component/Cache/Tests/Adapter/TagAwareAdapterTest.php index 0108b9250b79a..11907a0313f90 100644 --- a/src/Symfony/Component/Cache/Tests/Adapter/TagAwareAdapterTest.php +++ b/src/Symfony/Component/Cache/Tests/Adapter/TagAwareAdapterTest.php @@ -14,6 +14,7 @@ use PHPUnit\Framework\MockObject\MockObject; use Psr\Cache\CacheItemInterface; use Symfony\Component\Cache\Adapter\AdapterInterface; +use Symfony\Component\Cache\Adapter\ArrayAdapter; use Symfony\Component\Cache\Adapter\FilesystemAdapter; use Symfony\Component\Cache\Adapter\TagAwareAdapter; @@ -255,6 +256,25 @@ public function testHasItemReturnsFalseWhenPoolDoesNotHaveItemAndOnlyHasTags() $this->assertFalse($anotherPool->hasItem($itemKey)); } + public function testInvalidateTagsWithArrayAdapter() + { + $adapter = new TagAwareAdapter(new ArrayAdapter()); + + $item = $adapter->getItem('foo'); + + $this->assertFalse($item->isHit()); + + $item->tag('bar'); + $item->expiresAfter(100); + $adapter->save($item); + + $this->assertTrue($adapter->getItem('foo')->isHit()); + + $adapter->invalidateTags(['bar']); + + $this->assertFalse($adapter->getItem('foo')->isHit()); + } + public function testGetItemReturnsCacheMissWhenPoolDoesNotHaveItemAndOnlyHasTags() { $pool = $this->createCachePool(); From 6831271febc9fe3cad4a5cb9f92a60e252f68b76 Mon Sep 17 00:00:00 2001 From: Anatoly Pashin Date: Mon, 27 Jul 2020 11:39:16 +1000 Subject: [PATCH 016/128] Fix RedisStore constructor signature This is a fix for a regression from #37590 --- src/Symfony/Component/Lock/Store/RedisStore.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Lock/Store/RedisStore.php b/src/Symfony/Component/Lock/Store/RedisStore.php index 21d7116766cc8..1f687e484b75e 100644 --- a/src/Symfony/Component/Lock/Store/RedisStore.php +++ b/src/Symfony/Component/Lock/Store/RedisStore.php @@ -33,8 +33,8 @@ class RedisStore implements StoreInterface private $initialTtl; /** - * @param \Redis|\RedisArray|\RedisCluster|RedisProxy|RedisClusterProxy\Predis\ClientInterface $redisClient - * @param float $initialTtl the expiration delay of locks in seconds + * @param \Redis|\RedisArray|\RedisCluster|RedisProxy|RedisClusterProxy|\Predis\ClientInterface $redisClient + * @param float $initialTtl the expiration delay of locks in seconds */ public function __construct($redisClient, float $initialTtl = 300.0) { From 5199f1f9f3d0508b969b28e3204647b73ab897d0 Mon Sep 17 00:00:00 2001 From: noniagriconomie Date: Tue, 28 Jul 2020 22:34:19 +0200 Subject: [PATCH 017/128] HttpClient profiler error --- .../Resources/views/Collector/http_client.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/http_client.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/http_client.html.twig index 7315b4eb9d0a1..8496ef186dfd6 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/http_client.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/http_client.html.twig @@ -15,7 +15,7 @@
HTTP errors - {{ collector.errorCount }} + {{ collector.errorCount }}
{% endset %} From 257549e9c8f71548e2e32d83841c6866219e74a7 Mon Sep 17 00:00:00 2001 From: Vincent Langlet Date: Wed, 29 Jul 2020 00:26:06 +0200 Subject: [PATCH 018/128] getContainer cannot return null anymore --- src/Symfony/Bundle/FrameworkBundle/KernelBrowser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/KernelBrowser.php b/src/Symfony/Bundle/FrameworkBundle/KernelBrowser.php index bcfb180eaf27e..6e44657cf8181 100644 --- a/src/Symfony/Bundle/FrameworkBundle/KernelBrowser.php +++ b/src/Symfony/Bundle/FrameworkBundle/KernelBrowser.php @@ -45,7 +45,7 @@ public function __construct(KernelInterface $kernel, array $server = [], History /** * Returns the container. * - * @return ContainerInterface|null Returns null when the Kernel has been shutdown or not started yet + * @return ContainerInterface */ public function getContainer() { From e288834cda302b480949ac73189079a131514e27 Mon Sep 17 00:00:00 2001 From: Valentin Udaltsov Date: Wed, 29 Jul 2020 04:50:45 +0300 Subject: [PATCH 019/128] Removed redundant strtolower in ConsumeMessagesCommand --- .../Component/Messenger/Command/ConsumeMessagesCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Messenger/Command/ConsumeMessagesCommand.php b/src/Symfony/Component/Messenger/Command/ConsumeMessagesCommand.php index 2347ce3c8c8be..f1910a27ba2ec 100644 --- a/src/Symfony/Component/Messenger/Command/ConsumeMessagesCommand.php +++ b/src/Symfony/Component/Messenger/Command/ConsumeMessagesCommand.php @@ -208,7 +208,7 @@ protected function execute(InputInterface $input, OutputInterface $output) private function convertToBytes(string $memoryLimit): int { $memoryLimit = strtolower($memoryLimit); - $max = strtolower(ltrim($memoryLimit, '+')); + $max = ltrim($memoryLimit, '+'); if (0 === strpos($max, '0x')) { $max = \intval($max, 16); } elseif (0 === strpos($max, '0')) { From e80dfe7c67a7bf4220f0c7335d761bcc9fb18b78 Mon Sep 17 00:00:00 2001 From: Antoine Makdessi Date: Tue, 28 Jul 2020 21:52:15 +0200 Subject: [PATCH 020/128] Minor improvement --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index e5e58745ee337..7b86916e7bc14 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,6 +1,6 @@ | Q | A | ------------- | --- -| Branch? | master for features / 3.4, 4.4, 5.0 or 5.1 for bug fixes +| Branch? | master for features / 3.4, 4.4 or 5.1 for bug fixes | Bug fix? | yes/no | New feature? | yes/no | Deprecations? | yes/no diff --git a/README.md b/README.md index da9e6156c00d7..11d1932da94e9 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Community * [Join the Symfony Community][11] and meet other members at the [Symfony events][12]. * [Get Symfony support][13] on Stack Overflow, Slack, IRC, etc. * Follow us on [GitHub][14], [Twitter][15] and [Facebook][16]. -* Read our [Code of Conduct][24] and meet the [CARE Team][25] +* Read our [Code of Conduct][24] and meet the [CARE Team][25]. Contributing ------------ From bc5f35c609a917a51b645389bd182bd6460004e5 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Wed, 29 Jul 2020 10:26:17 +0200 Subject: [PATCH 021/128] reduce column length for MySQL 5.6 compatibility --- .../Component/Messenger/Transport/Doctrine/Connection.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Symfony/Component/Messenger/Transport/Doctrine/Connection.php b/src/Symfony/Component/Messenger/Transport/Doctrine/Connection.php index 2d4b9bd673e73..d71e747598441 100644 --- a/src/Symfony/Component/Messenger/Transport/Doctrine/Connection.php +++ b/src/Symfony/Component/Messenger/Transport/Doctrine/Connection.php @@ -368,6 +368,7 @@ private function getSchema(): Schema $table->addColumn('headers', self::$useDeprecatedConstants ? Type::TEXT : Types::TEXT) ->setNotnull(true); $table->addColumn('queue_name', self::$useDeprecatedConstants ? Type::STRING : Types::STRING) + ->setLength(190) // MySQL 5.6 only supports 191 characters on an indexed column in utf8mb4 mode ->setNotnull(true); $table->addColumn('created_at', self::$useDeprecatedConstants ? Type::DATETIME : Types::DATETIME_MUTABLE) ->setNotnull(true); From cef16f591fed8cfa05c2d8c59a845a1e86283d9c Mon Sep 17 00:00:00 2001 From: Laurent VOULLEMIER Date: Wed, 29 Jul 2020 17:02:56 +0200 Subject: [PATCH 022/128] [VarDumper] Improve previous fix on light array coloration --- src/Symfony/Component/VarDumper/Dumper/CliDumper.php | 7 +++++-- .../Component/VarDumper/Tests/Dumper/CliDumperTest.php | 8 ++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/Symfony/Component/VarDumper/Dumper/CliDumper.php b/src/Symfony/Component/VarDumper/Dumper/CliDumper.php index 881241ab3e878..76737a499fbe5 100644 --- a/src/Symfony/Component/VarDumper/Dumper/CliDumper.php +++ b/src/Symfony/Component/VarDumper/Dumper/CliDumper.php @@ -255,6 +255,10 @@ public function dumpString(Cursor $cursor, $str, $bin, $cut) */ public function enterHash(Cursor $cursor, $type, $class, $hasChild) { + if (null === $this->colors) { + $this->colors = $this->supportsColors(); + } + $this->dumpKey($cursor); if ($this->collapseNextHash) { @@ -268,8 +272,7 @@ public function enterHash(Cursor $cursor, $type, $class, $hasChild) } elseif (Cursor::HASH_RESOURCE === $type) { $prefix = $this->style('note', $class.' resource').($hasChild ? ' {' : ' '); } else { - $unstyledPrefix = $class && !(self::DUMP_LIGHT_ARRAY & $this->flags) ? 'array:'.$class : ''; - $prefix = $this->style('note', $unstyledPrefix).($unstyledPrefix ? ' [' : '['); + $prefix = $class && !(self::DUMP_LIGHT_ARRAY & $this->flags) ? $this->style('note', 'array:'.$class).' [' : '['; } if ($cursor->softRefCount || 0 < $cursor->softRefHandle) { diff --git a/src/Symfony/Component/VarDumper/Tests/Dumper/CliDumperTest.php b/src/Symfony/Component/VarDumper/Tests/Dumper/CliDumperTest.php index e7efaae95cec3..cefddb190881e 100644 --- a/src/Symfony/Component/VarDumper/Tests/Dumper/CliDumperTest.php +++ b/src/Symfony/Component/VarDumper/Tests/Dumper/CliDumperTest.php @@ -578,7 +578,7 @@ public function provideDumpArrayWithColor() yield [ ['foo' => 'bar'], 0, -<< "\e[1;38;5;113mbar\e[0;38;5;208m"\e[m \e[0;38;5;208m]\e[m @@ -586,20 +586,20 @@ public function provideDumpArrayWithColor() EOTXT ]; - yield [[], AbstractDumper::DUMP_LIGHT_ARRAY, "\e[0;38;5;208m\e[38;5;38m\e[0;38;5;208m[]\e[m\n"]; + yield [[], AbstractDumper::DUMP_LIGHT_ARRAY, "\e[0;38;5;208m[]\e[m\n"]; yield [ ['foo' => 'bar'], AbstractDumper::DUMP_LIGHT_ARRAY, << "\e[1;38;5;113mbar\e[0;38;5;208m"\e[m \e[0;38;5;208m]\e[m EOTXT ]; - yield [[], 0, "\e[0;38;5;208m\e[38;5;38m\e[0;38;5;208m[]\e[m\n"]; + yield [[], 0, "\e[0;38;5;208m[]\e[m\n"]; } /** From 4e089b411c76700b2b27355bc6fcd5fc0689dbf3 Mon Sep 17 00:00:00 2001 From: vudaltsov Date: Wed, 29 Jul 2020 20:46:22 +0300 Subject: [PATCH 023/128] Added the missing reset tag to mailer.logger_message_listener --- src/Symfony/Bundle/FrameworkBundle/Resources/config/mailer.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/mailer.xml b/src/Symfony/Bundle/FrameworkBundle/Resources/config/mailer.xml index 8a99eeb5bd2b9..12d40229932cd 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/mailer.xml +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/mailer.xml @@ -41,6 +41,7 @@ + From 83338b4a000d7690c216de73a331fa5496e9075a Mon Sep 17 00:00:00 2001 From: Antoine Makdessi Date: Mon, 27 Jul 2020 22:36:40 +0200 Subject: [PATCH 024/128] Update UPGRADE-5.0.md --- UPGRADE-5.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UPGRADE-5.0.md b/UPGRADE-5.0.md index fb773cc1b8e72..fda718912d486 100644 --- a/UPGRADE-5.0.md +++ b/UPGRADE-5.0.md @@ -681,4 +681,4 @@ WebProfilerBundle WebServerBundle --------------- - * The bundle has been removed. + * The bundle has been deprecated and can be installed separately. You may also use the Symfony Local Web Server instead. From 609dcf6b08de92468e6aad41c48f7d30427e7093 Mon Sep 17 00:00:00 2001 From: Jeroeny Date: Sat, 11 Jul 2020 17:12:08 +0200 Subject: [PATCH 025/128] [Finder] Fix GitIgnore parser when dealing with (sub)directories and take order of lines into account --- src/Symfony/Component/Finder/Gitignore.php | 88 ++++++++++++------- .../Component/Finder/Tests/GitignoreTest.php | 14 ++- 2 files changed, 70 insertions(+), 32 deletions(-) diff --git a/src/Symfony/Component/Finder/Gitignore.php b/src/Symfony/Component/Finder/Gitignore.php index 5ffe585f8aa1c..9e7ba4d7b38f4 100644 --- a/src/Symfony/Component/Finder/Gitignore.php +++ b/src/Symfony/Component/Finder/Gitignore.php @@ -27,42 +27,56 @@ public static function toRegex(string $gitignoreFileContent): string { $gitignoreFileContent = preg_replace('/^[^\\\r\n]*#.*/m', '', $gitignoreFileContent); $gitignoreLines = preg_split('/\r\n|\r|\n/', $gitignoreFileContent); - $gitignoreLines = array_map('trim', $gitignoreLines); - $gitignoreLines = array_filter($gitignoreLines); - $ignoreLinesPositive = array_filter($gitignoreLines, function (string $line) { - return !preg_match('/^!/', $line); - }); - - $ignoreLinesNegative = array_filter($gitignoreLines, function (string $line) { - return preg_match('/^!/', $line); - }); + $positives = []; + $negatives = []; + foreach ($gitignoreLines as $i => $line) { + $line = trim($line); + if ('' === $line) { + continue; + } - $ignoreLinesNegative = array_map(function (string $line) { - return preg_replace('/^!(.*)/', '${1}', $line); - }, $ignoreLinesNegative); - $ignoreLinesNegative = array_map([__CLASS__, 'getRegexFromGitignore'], $ignoreLinesNegative); + if (1 === preg_match('/^!/', $line)) { + $positives[$i] = null; + $negatives[$i] = self::getRegexFromGitignore(preg_replace('/^!(.*)/', '${1}', $line), true); - $ignoreLinesPositive = array_map([__CLASS__, 'getRegexFromGitignore'], $ignoreLinesPositive); - if (empty($ignoreLinesPositive)) { - return '/^$/'; + continue; + } + $negatives[$i] = null; + $positives[$i] = self::getRegexFromGitignore($line); } - if (empty($ignoreLinesNegative)) { - return sprintf('/%s/', implode('|', $ignoreLinesPositive)); + $index = 0; + $patterns = []; + foreach ($positives as $pattern) { + if (null === $pattern) { + continue; + } + + $negativesAfter = array_filter(\array_slice($negatives, ++$index)); + if ($negativesAfter !== []) { + $pattern .= sprintf('(?'.$regex.'($|\/.*))'; } } diff --git a/src/Symfony/Component/Finder/Tests/GitignoreTest.php b/src/Symfony/Component/Finder/Tests/GitignoreTest.php index 9f9ed738ca8c5..ae1cfb9900090 100644 --- a/src/Symfony/Component/Finder/Tests/GitignoreTest.php +++ b/src/Symfony/Component/Finder/Tests/GitignoreTest.php @@ -47,6 +47,7 @@ public function provider(): array [ ' * + !/bin !/bin/bash ', ['bin/cat', 'abc/bin/cat'], @@ -99,8 +100,8 @@ public function provider(): array ], [ 'app/cache/', - ['app/cache/file.txt', 'app/cache/dir1/dir2/file.txt', 'a/app/cache/file.txt'], - [], + ['app/cache/file.txt', 'app/cache/dir1/dir2/file.txt'], + ['a/app/cache/file.txt'], ], [ ' @@ -133,6 +134,15 @@ public function provider(): array ['app/cache/file.txt', 'app/cache/subdir/ile.txt', '#file.txt', 'another_file.txt'], ['a/app/cache/file.txt', 'IamComment', '#IamComment'], ], + [ + ' + /app/** + !/app/bin + !/app/bin/test + ', + ['app/test/file', 'app/bin/file'], + ['app/bin/test'], + ], ]; } } From 4c40ff8392657d17fcec6d298ba386402796a65e Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 31 Jul 2020 08:55:54 +0200 Subject: [PATCH 026/128] Fix typo --- src/Symfony/Component/Mailer/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Mailer/README.md b/src/Symfony/Component/Mailer/README.md index a98ed73947152..173ebe44bc705 100644 --- a/src/Symfony/Component/Mailer/README.md +++ b/src/Symfony/Component/Mailer/README.md @@ -14,7 +14,7 @@ $ composer require symfony/mailer use Symfony\Component\Mailer\Transport; use Symfony\Component\Mailer\Mailer; -$transport = Transport::fromDsn('sendgrid://KEY@default'); +$transport = Transport::fromDsn('smtp://localhost'); $mailer = new Mailer($transport); $email = (new Email()) From a16ebc177d6b4fbbba55a757ca387703c2d6e296 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Mon, 3 Aug 2020 15:05:59 +0200 Subject: [PATCH 027/128] fail properly when the required service is not defined --- .../Bundle/FrameworkBundle/Test/MailerAssertionsTrait.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Test/MailerAssertionsTrait.php b/src/Symfony/Bundle/FrameworkBundle/Test/MailerAssertionsTrait.php index 15446a898f5cd..24d98b88ebcdc 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Test/MailerAssertionsTrait.php +++ b/src/Symfony/Bundle/FrameworkBundle/Test/MailerAssertionsTrait.php @@ -122,10 +122,10 @@ private static function getMessageMailerEvents(): MessageEvents static::fail('Unable to make email assertions. Did you forget to make an HTTP request?'); } - if (!$logger = self::$container->get('mailer.logger_message_listener')) { + if (!self::$container->has('mailer.logger_message_listener')) { static::fail('A client must have Mailer enabled to make email assertions. Did you forget to require symfony/mailer?'); } - return $logger->getEvents(); + return self::$container->get('mailer.logger_message_listener')->getEvents(); } } From b7d2b6042b9debc6a5cb69a1f5b943706d340fb9 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Mon, 3 Aug 2020 15:22:15 +0200 Subject: [PATCH 028/128] [Validator] sync translations --- .../Validator/Resources/translations/validators.en.xlf | 4 ++++ .../Validator/Resources/translations/validators.fr.xlf | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.en.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.en.xlf index 674ccf5c30ea6..ecc73e48aa1ef 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.en.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.en.xlf @@ -382,6 +382,10 @@ Each element of this collection should satisfy its own set of constraints. Each element of this collection should satisfy its own set of constraints. + + This value is not a valid International Securities Identification Number (ISIN). + This value is not a valid International Securities Identification Number (ISIN). + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.fr.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.fr.xlf index c44ade69e0713..a4dd54295b46a 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.fr.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.fr.xlf @@ -382,6 +382,10 @@ Each element of this collection should satisfy its own set of constraints. Chaque élément de cette collection doit satisfaire à son propre jeu de contraintes. + + This value is not a valid International Securities Identification Number (ISIN). + Cette valeur n'est pas un code international de sécurité valide (ISIN). + From 27bb1c499d7780d61e43569aaba5d62096478a0d Mon Sep 17 00:00:00 2001 From: Fran Moreno Date: Sun, 2 Aug 2020 20:37:15 +0200 Subject: [PATCH 029/128] Fix typehint phpdoc --- src/Symfony/Component/Form/Guess/Guess.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Form/Guess/Guess.php b/src/Symfony/Component/Form/Guess/Guess.php index b216af5d55dc6..82b28f94d0bce 100644 --- a/src/Symfony/Component/Form/Guess/Guess.php +++ b/src/Symfony/Component/Form/Guess/Guess.php @@ -60,9 +60,9 @@ abstract class Guess * If there are multiple guesses with the same, highest confidence, the * returned guess is any of them. * - * @param Guess[] $guesses An array of guesses + * @param static[] $guesses An array of guesses * - * @return self|null + * @return static|null */ public static function getBestGuess(array $guesses) { From 38787ac7855e219ed155bfa9d62a5da5d89e0383 Mon Sep 17 00:00:00 2001 From: Alexander Janssen Date: Wed, 29 Jul 2020 17:05:52 +0200 Subject: [PATCH 030/128] [Serializer] Fix that it will never reach DOMNode --- .../Component/Serializer/Encoder/XmlEncoder.php | 6 +++--- .../Serializer/Tests/Encoder/XmlEncoderTest.php | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php b/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php index dc932222e953e..fc4cbe5d839f4 100644 --- a/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php +++ b/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php @@ -488,6 +488,9 @@ private function selectNodeType(\DOMNode $node, $val) $node->appendChild($child); } elseif ($val instanceof \Traversable) { $this->buildXml($node, $val); + } elseif ($val instanceof \DOMNode) { + $child = $this->dom->importNode($val, true); + $node->appendChild($child); } elseif (\is_object($val)) { if (null === $this->serializer) { throw new BadMethodCallException(sprintf('The serializer needs to be set to allow "%s()" to be used with object data.', __METHOD__)); @@ -502,9 +505,6 @@ private function selectNodeType(\DOMNode $node, $val) return $this->appendText($node, $val); } elseif (\is_bool($val)) { return $this->appendText($node, (int) $val); - } elseif ($val instanceof \DOMNode) { - $child = $this->dom->importNode($val, true); - $node->appendChild($child); } return true; diff --git a/src/Symfony/Component/Serializer/Tests/Encoder/XmlEncoderTest.php b/src/Symfony/Component/Serializer/Tests/Encoder/XmlEncoderTest.php index f1a8b6ab480e0..94f2e6c18a6ad 100644 --- a/src/Symfony/Component/Serializer/Tests/Encoder/XmlEncoderTest.php +++ b/src/Symfony/Component/Serializer/Tests/Encoder/XmlEncoderTest.php @@ -662,6 +662,20 @@ public function testEncodeXmlWithBoolValue() $this->assertEquals($expectedXml, $actualXml); } + public function testEncodeXmlWithDomNodeValue() + { + $expectedXml = <<<'XML' + +barfoo & bar + +XML; + $document = new \DOMDocument(); + + $actualXml = $this->encoder->encode(['foo' => $document->createTextNode('bar'), 'bar' => $document->createTextNode('foo & bar')], 'xml'); + + $this->assertEquals($expectedXml, $actualXml); + } + public function testEncodeXmlWithDateTimeObjectValue() { $xmlEncoder = $this->createXmlEncoderWithDateTimeNormalizer(); From 3703f1440eba8d704b02f427c781bbcb6e1ada49 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Date: Wed, 5 Aug 2020 15:27:53 +0200 Subject: [PATCH 031/128] Typo: somes styles fixed --- UPGRADE-5.0.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/UPGRADE-5.0.md b/UPGRADE-5.0.md index ecdab45f2340a..075b5d9fc46a7 100644 --- a/UPGRADE-5.0.md +++ b/UPGRADE-5.0.md @@ -237,7 +237,7 @@ FrameworkBundle * The `Templating\Helper\TranslatorHelper::transChoice()` method has been removed, use the `trans()` one instead with a `%count%` parameter. * Removed support for legacy translations directories `src/Resources/translations/` and `src/Resources//translations/`, use `translations/` instead. * Support for the legacy directory structure in `translation:update` and `debug:translation` commands has been removed. - * Removed the "Psr\SimpleCache\CacheInterface" / "cache.app.simple" service, use "Symfony\Contracts\Cache\CacheInterface" / "cache.app" instead. + * Removed the `Psr\SimpleCache\CacheInterface` / `cache.app.simple` service, use `Symfony\Contracts\Cache\CacheInterface` / `cache.app` instead. * Removed support for `templating` engine in `TemplateController`, use Twig instead * Removed `ResolveControllerNameSubscriber`. * Removed `routing.loader.service`. @@ -260,7 +260,7 @@ HttpFoundation * The `$size` argument of the `UploadedFile` constructor has been removed. * The `getClientSize()` method of the `UploadedFile` class has been removed. * The `getSession()` method of the `Request` class throws an exception when session is null. - * The default value of the "$secure" and "$samesite" arguments of Cookie's constructor + * The default value of the `$secure` and `$samesite` arguments of Cookie's constructor changed respectively from "false" to "null" and from "null" to "lax". * The `MimeTypeGuesserInterface` and `ExtensionGuesserInterface` interfaces have been removed, use `Symfony\Component\Mime\MimeTypesInterface` instead. @@ -561,7 +561,7 @@ TwigBridge ---------- * Removed argument `$rootDir` from the `DebugCommand::__construct()` method and the 5th argument must be an instance of `FileLinkFormatter` - * removed the `$requestStack` and `$requestContext` arguments of the + * Removed the `$requestStack` and `$requestContext` arguments of the `HttpFoundationExtension`, pass a `Symfony\Component\HttpFoundation\UrlHelper` instance as the only argument instead * Removed support for implicit STDIN usage in the `lint:twig` command, use `lint:twig -` (append a dash) instead to make it explicit. From 235920a3882dcf7147b6f641c6707105c9d7089a Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Mon, 6 Jul 2020 20:36:32 +0200 Subject: [PATCH 032/128] fix mapping errors from unmapped forms --- .../ViolationMapper/ViolationMapper.php | 7 ---- .../ViolationMapper/Fixtures/Issue.php | 16 ++++++++ .../ViolationMapper/ViolationMapperTest.php | 38 ++++++++++++++++--- 3 files changed, 49 insertions(+), 12 deletions(-) create mode 100644 src/Symfony/Component/Form/Tests/Extension/Validator/ViolationMapper/Fixtures/Issue.php diff --git a/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationMapper.php b/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationMapper.php index 659c266ce6fa9..2a024ee4b9aad 100644 --- a/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationMapper.php +++ b/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationMapper.php @@ -241,13 +241,6 @@ private function reconstructPath(ViolationPath $violationPath, FormInterface $or // Form inherits its parent data // Cut the piece out of the property path and proceed $propertyPathBuilder->remove($i); - } elseif (!$scope->getConfig()->getMapped()) { - // Form is not mapped - // Set the form as new origin and strip everything - // we have so far in the path - $origin = $scope; - $propertyPathBuilder->remove(0, $i + 1); - $i = 0; } else { /* @var \Symfony\Component\PropertyAccess\PropertyPathInterface $propertyPath */ $propertyPath = $scope->getPropertyPath(); diff --git a/src/Symfony/Component/Form/Tests/Extension/Validator/ViolationMapper/Fixtures/Issue.php b/src/Symfony/Component/Form/Tests/Extension/Validator/ViolationMapper/Fixtures/Issue.php new file mode 100644 index 0000000000000..62b6a4e77d152 --- /dev/null +++ b/src/Symfony/Component/Form/Tests/Extension/Validator/ViolationMapper/Fixtures/Issue.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Validator\ViolationMapper\Fixtures; + +class Issue +{ +} diff --git a/src/Symfony/Component/Form/Tests/Extension/Validator/ViolationMapper/ViolationMapperTest.php b/src/Symfony/Component/Form/Tests/Extension/Validator/ViolationMapper/ViolationMapperTest.php index 2fa3e928926ee..6e3fffc21769c 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Validator/ViolationMapper/ViolationMapperTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Validator/ViolationMapper/ViolationMapperTest.php @@ -22,6 +22,7 @@ use Symfony\Component\Form\FormConfigBuilder; use Symfony\Component\Form\FormError; use Symfony\Component\Form\FormInterface; +use Symfony\Component\Form\Tests\Extension\Validator\ViolationMapper\Fixtures\Issue; use Symfony\Component\PropertyAccess\PropertyPath; use Symfony\Component\Validator\ConstraintViolation; use Symfony\Component\Validator\ConstraintViolationInterface; @@ -70,12 +71,12 @@ protected function setUp() $this->params = ['foo' => 'bar']; } - protected function getForm($name = 'name', $propertyPath = null, $dataClass = null, $errorMapping = [], $inheritData = false, $synchronized = true) + protected function getForm($name = 'name', $propertyPath = null, $dataClass = null, $errorMapping = [], $inheritData = false, $synchronized = true, array $options = []) { $config = new FormConfigBuilder($name, $dataClass, $this->dispatcher, [ 'error_mapping' => $errorMapping, - ]); - $config->setMapped(true); + ] + $options); + $config->setMapped(isset($options['mapped']) ? $options['mapped'] : true); $config->setInheritData($inheritData); $config->setPropertyPath($propertyPath); $config->setCompound(true); @@ -96,9 +97,9 @@ function () { throw new TransformationFailedException(); } * * @return ConstraintViolation */ - protected function getConstraintViolation($propertyPath) + protected function getConstraintViolation($propertyPath, $root = null) { - return new ConstraintViolation($this->message, $this->messageTemplate, $this->params, null, $propertyPath, null); + return new ConstraintViolation($this->message, $this->messageTemplate, $this->params, $root, $propertyPath, null); } /** @@ -112,6 +113,33 @@ protected function getFormError(ConstraintViolationInterface $violation, FormInt return $error; } + public function testMappingErrorsWhenFormIsNotMapped() + { + $form = $this->getForm('name', null, Issue::class, [ + 'child1' => 'child2', + ]); + + $violation = $this->getConstraintViolation('children[child1].data', $form); + + $child1Form = $this->getForm('child1', null, null, [], false, true, [ + 'mapped' => false, + ]); + $child2Form = $this->getForm('child2', null, null, [], false, true, [ + 'mapped' => false, + ]); + + $form->add($child1Form); + $form->add($child2Form); + + $form->submit([]); + + $this->mapper->mapViolation($violation, $form); + + $this->assertCount(0, $form->getErrors()); + $this->assertCount(0, $form->get('child1')->getErrors()); + $this->assertCount(1, $form->get('child2')->getErrors()); + } + public function testMapToFormInheritingParentDataIfDataDoesNotMatch() { $violation = $this->getConstraintViolation('children[address].data.foo'); From 32b5b9e1d72694c82000132b1e21b6c07a006fea Mon Sep 17 00:00:00 2001 From: Vladyslav Startsev <17382248+vladyslavstartsev@users.noreply.github.com> Date: Sat, 8 Aug 2020 11:55:31 +0300 Subject: [PATCH 033/128] make return type correct --- src/Symfony/Component/Form/FormView.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Form/FormView.php b/src/Symfony/Component/Form/FormView.php index 6393c2d2372a3..8d23ee9ddc909 100644 --- a/src/Symfony/Component/Form/FormView.php +++ b/src/Symfony/Component/Form/FormView.php @@ -148,7 +148,7 @@ public function offsetUnset($name) /** * Returns an iterator to iterate over children (implements \IteratorAggregate). * - * @return \ArrayIterator|FormView[] The iterator + * @return \ArrayIterator The iterator */ public function getIterator() { From 46e2a0c51786c04b80d4b17c917e6f6989c88c97 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Sat, 8 Aug 2020 15:51:54 +0200 Subject: [PATCH 034/128] [String] We cannot have a "provides" function in test cases. --- src/Symfony/Component/String/Tests/FunctionsTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/String/Tests/FunctionsTest.php b/src/Symfony/Component/String/Tests/FunctionsTest.php index 1f2776e8896de..dba056528bc9e 100644 --- a/src/Symfony/Component/String/Tests/FunctionsTest.php +++ b/src/Symfony/Component/String/Tests/FunctionsTest.php @@ -20,14 +20,14 @@ final class FunctionsTest extends TestCase { /** - * @dataProvider provideS + * @dataProvider provideStrings */ public function testS(AbstractString $expected, string $input) { $this->assertEquals($expected, s($input)); } - public function provideS() + public function provideStrings(): array { return [ [new UnicodeString('foo'), 'foo'], From 65fe98ec6659f6efc2fcb8ff282adf2cfc8f1282 Mon Sep 17 00:00:00 2001 From: Chi-teck Date: Fri, 7 Aug 2020 10:04:13 +0000 Subject: [PATCH 035/128] Remove outdated references from base_js.html.twig file --- .../Resources/views/Profiler/base_js.html.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig index c6631376d2458..db3791abdab6f 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig @@ -1,5 +1,5 @@ -{# This file is partially duplicated in TwigBundle/Resources/views/base_js.html.twig. If you - make any change in this file, verify the same change is needed in the other file. #} +{# This file is partially duplicated in src/Symfony/Component/ErrorHandler/Resources/assets/js/exception.js. + If you make any change in this file, verify the same change is needed in the other file. #} /* Date: Sat, 8 Aug 2020 17:34:42 +0200 Subject: [PATCH 036/128] [Console] Make sure we pass a numeric array of arguments to call_user_func_array(). --- src/Symfony/Component/Console/Descriptor/TextDescriptor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Console/Descriptor/TextDescriptor.php b/src/Symfony/Component/Console/Descriptor/TextDescriptor.php index af9088c7c3358..96005590795af 100644 --- a/src/Symfony/Component/Console/Descriptor/TextDescriptor.php +++ b/src/Symfony/Component/Console/Descriptor/TextDescriptor.php @@ -204,7 +204,7 @@ protected function describeApplication(Application $application, array $options // calculate max. width based on available commands per namespace $width = $this->getColumnWidth(\call_user_func_array('array_merge', array_map(function ($namespace) use ($commands) { return array_intersect($namespace['commands'], array_keys($commands)); - }, $namespaces))); + }, array_values($namespaces)))); if ($describedNamespace) { $this->writeText(sprintf('Available commands for the "%s" namespace:', $describedNamespace), $options); From 8b801c1269964332919a59dbb72542d713f395ee Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Sat, 8 Aug 2020 21:12:02 +0200 Subject: [PATCH 037/128] The PHPUnit\Util\XML class has been removed in PHPUnit 9.3. --- .../Form/Tests/Resources/TranslationFilesTest.php | 7 ++++++- .../Security/Core/Tests/Resources/TranslationFilesTest.php | 7 ++++++- .../Validator/Tests/Resources/TranslationFilesTest.php | 7 ++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Component/Form/Tests/Resources/TranslationFilesTest.php b/src/Symfony/Component/Form/Tests/Resources/TranslationFilesTest.php index 49e69ef190268..35274af334dbb 100644 --- a/src/Symfony/Component/Form/Tests/Resources/TranslationFilesTest.php +++ b/src/Symfony/Component/Form/Tests/Resources/TranslationFilesTest.php @@ -12,6 +12,7 @@ namespace Symfony\Component\Form\Tests\Resources; use PHPUnit\Framework\TestCase; +use PHPUnit\Util\Xml\Loader; class TranslationFilesTest extends TestCase { @@ -20,7 +21,11 @@ class TranslationFilesTest extends TestCase */ public function testTranslationFileIsValid($filePath) { - \PHPUnit\Util\XML::loadfile($filePath, false, false, true); + $loader = class_exists(Loader::class) + ? [new Loader(), 'loadFile'] + : 'PHPUnit\Util\XML::loadfile'; + + $loader($filePath, false, false, true); $this->addToAssertionCount(1); } diff --git a/src/Symfony/Component/Security/Core/Tests/Resources/TranslationFilesTest.php b/src/Symfony/Component/Security/Core/Tests/Resources/TranslationFilesTest.php index bc21d272fc39c..67e0ccdecbb68 100644 --- a/src/Symfony/Component/Security/Core/Tests/Resources/TranslationFilesTest.php +++ b/src/Symfony/Component/Security/Core/Tests/Resources/TranslationFilesTest.php @@ -12,6 +12,7 @@ namespace Symfony\Component\Security\Core\Tests\Resources; use PHPUnit\Framework\TestCase; +use PHPUnit\Util\Xml\Loader; class TranslationFilesTest extends TestCase { @@ -20,7 +21,11 @@ class TranslationFilesTest extends TestCase */ public function testTranslationFileIsValid($filePath) { - \PHPUnit\Util\XML::loadfile($filePath, false, false, true); + $loader = class_exists(Loader::class) + ? [new Loader(), 'loadFile'] + : 'PHPUnit\Util\XML::loadfile'; + + $loader($filePath, false, false, true); $this->addToAssertionCount(1); } diff --git a/src/Symfony/Component/Validator/Tests/Resources/TranslationFilesTest.php b/src/Symfony/Component/Validator/Tests/Resources/TranslationFilesTest.php index 56ff24d2fd4bc..6e903731f1cac 100644 --- a/src/Symfony/Component/Validator/Tests/Resources/TranslationFilesTest.php +++ b/src/Symfony/Component/Validator/Tests/Resources/TranslationFilesTest.php @@ -12,6 +12,7 @@ namespace Symfony\Component\Validator\Tests\Resources; use PHPUnit\Framework\TestCase; +use PHPUnit\Util\Xml\Loader; class TranslationFilesTest extends TestCase { @@ -20,7 +21,11 @@ class TranslationFilesTest extends TestCase */ public function testTranslationFileIsValid($filePath) { - \PHPUnit\Util\XML::loadfile($filePath, false, false, true); + $loader = class_exists(Loader::class) + ? [new Loader(), 'loadFile'] + : 'PHPUnit\Util\XML::loadfile'; + + $loader($filePath, false, false, true); $this->addToAssertionCount(1); } From 8bd861bbc6ee176763eaa1982234faeb500661a8 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Sat, 8 Aug 2020 21:42:49 +0200 Subject: [PATCH 038/128] [Console] The message of "class not found" errors has changed in php 8. --- .../Component/Console/Tests/ApplicationTest.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Symfony/Component/Console/Tests/ApplicationTest.php b/src/Symfony/Component/Console/Tests/ApplicationTest.php index 8288cfd3269f4..b6d279875e343 100644 --- a/src/Symfony/Component/Console/Tests/ApplicationTest.php +++ b/src/Symfony/Component/Console/Tests/ApplicationTest.php @@ -1367,8 +1367,8 @@ public function testErrorIsRethrownIfNotHandledByConsoleErrorEvent() $application->setCatchExceptions(false); $application->setDispatcher(new EventDispatcher()); - $application->register('dym')->setCode(function (InputInterface $input, OutputInterface $output) { - new \UnknownClass(); + $application->register('dym')->setCode(function () { + throw new \Error('Something went wrong.'); }); $tester = new ApplicationTester($application); @@ -1377,7 +1377,7 @@ public function testErrorIsRethrownIfNotHandledByConsoleErrorEvent() $tester->run(['command' => 'dym']); $this->fail('->run() should rethrow PHP errors if not handled via ConsoleErrorEvent.'); } catch (\Error $e) { - $this->assertSame($e->getMessage(), 'Class \'UnknownClass\' not found'); + $this->assertSame('Something went wrong.', $e->getMessage()); } } @@ -1702,8 +1702,8 @@ public function testErrorIsRethrownIfNotHandledByConsoleErrorEventWithCatchingEn $application->setAutoExit(false); $application->setDispatcher(new EventDispatcher()); - $application->register('dym')->setCode(function (InputInterface $input, OutputInterface $output) { - new \UnknownClass(); + $application->register('dym')->setCode(function () { + throw new \Error('Something went wrong.'); }); $tester = new ApplicationTester($application); @@ -1712,7 +1712,7 @@ public function testErrorIsRethrownIfNotHandledByConsoleErrorEventWithCatchingEn $tester->run(['command' => 'dym']); $this->fail('->run() should rethrow PHP errors if not handled via ConsoleErrorEvent.'); } catch (\Error $e) { - $this->assertSame($e->getMessage(), 'Class \'UnknownClass\' not found'); + $this->assertSame('Something went wrong.', $e->getMessage()); } } } From ab417f7040f150006e399a8b4c040a3a9ab99d52 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Sat, 8 Aug 2020 16:41:28 +0200 Subject: [PATCH 039/128] Modernized deprecated PHPUnit assertion calls --- composer.json | 2 +- .../Twig/Tests/Command/LintCommandTest.php | 4 +- .../CacheClearCommandTest.php | 2 +- .../Tests/Command/RouterDebugCommandTest.php | 2 +- .../Command/TranslationDebugCommandTest.php | 20 +++++----- .../Command/TranslationUpdateCommandTest.php | 24 ++++++------ .../Tests/Resources/IconTest.php | 2 +- .../Config/Tests/Util/XmlUtilsTest.php | 2 +- .../Console/Tests/ApplicationTest.php | 38 +++++++++---------- .../Console/Tests/Command/ListCommandTest.php | 4 +- .../Debug/Tests/DebugClassLoaderTest.php | 4 +- .../Debug/Tests/ErrorHandlerTest.php | 4 +- .../ClassNotFoundFatalErrorHandlerTest.php | 2 +- .../Tests/Loader/FileLoaderTest.php | 2 +- .../Tests/Loader/XmlFileLoaderTest.php | 10 ++--- .../Tests/Loader/YamlFileLoaderTest.php | 4 +- .../Filesystem/Tests/FilesystemTest.php | 22 +++++------ .../Tests/BinaryFileResponseTest.php | 2 +- .../HttpFoundation/Tests/File/FileTest.php | 8 ++-- .../Tests/File/UploadedFileTest.php | 2 +- .../Tests/RedirectResponseTest.php | 2 +- .../Tests/ResponseHeaderBagTest.php | 2 +- .../DataCollector/ConfigDataCollectorTest.php | 4 +- .../Tests/HttpCache/HttpCacheTest.php | 20 +++++----- .../Tests/HttpCache/HttpCacheTestCase.php | 4 +- .../Component/HttpKernel/Tests/KernelTest.php | 6 +-- .../Intl/Tests/Util/GitRepositoryTest.php | 2 +- .../DigestAuthenticationEntryPointTest.php | 6 +-- .../Yaml/Tests/Command/LintCommandTest.php | 2 +- 29 files changed, 104 insertions(+), 104 deletions(-) diff --git a/composer.json b/composer.json index 5bc6183823adb..565d5f298ff44 100644 --- a/composer.json +++ b/composer.json @@ -98,7 +98,7 @@ "ocramius/proxy-manager": "~0.4|~1.0|~2.0", "predis/predis": "~1.0", "egulias/email-validator": "~1.2,>=1.2.8|~2.0", - "symfony/phpunit-bridge": "^3.4.31|^4.3.4|~5.0", + "symfony/phpunit-bridge": "^5.2", "symfony/security-acl": "~2.8|~3.0", "phpdocumentor/reflection-docblock": "^3.0|^4.0" }, diff --git a/src/Symfony/Bridge/Twig/Tests/Command/LintCommandTest.php b/src/Symfony/Bridge/Twig/Tests/Command/LintCommandTest.php index 84154512be15c..166f1d9c446b2 100644 --- a/src/Symfony/Bridge/Twig/Tests/Command/LintCommandTest.php +++ b/src/Symfony/Bridge/Twig/Tests/Command/LintCommandTest.php @@ -42,7 +42,7 @@ public function testLintIncorrectFile() $ret = $tester->execute(['filename' => [$filename]], ['decorated' => false]); $this->assertEquals(1, $ret, 'Returns 1 in case of error'); - $this->assertRegExp('/ERROR in \S+ \(line /', trim($tester->getDisplay())); + $this->assertMatchesRegularExpression('/ERROR in \S+ \(line /', trim($tester->getDisplay())); } public function testLintFileNotReadable() @@ -63,7 +63,7 @@ public function testLintFileCompileTimeException() $ret = $tester->execute(['filename' => [$filename]], ['decorated' => false]); $this->assertEquals(1, $ret, 'Returns 1 in case of error'); - $this->assertRegExp('/ERROR in \S+ \(line /', trim($tester->getDisplay())); + $this->assertMatchesRegularExpression('/ERROR in \S+ \(line /', trim($tester->getDisplay())); } /** diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/CacheClearCommandTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/CacheClearCommandTest.php index c2cded7ab0966..5168e046e53a4 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/CacheClearCommandTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/CacheClearCommandTest.php @@ -87,6 +87,6 @@ public function testCacheIsFreshAfterCacheClearedWithWarmup() } $containerRef = new \ReflectionClass(require $containerFile); $containerFile = str_replace('tes_'.\DIRECTORY_SEPARATOR, 'test'.\DIRECTORY_SEPARATOR, $containerRef->getFileName()); - $this->assertRegExp(sprintf('/\'kernel.container_class\'\s*=>\s*\'%s\'/', $containerClass), file_get_contents($containerFile), 'kernel.container_class is properly set on the dumped container'); + $this->assertMatchesRegularExpression(sprintf('/\'kernel.container_class\'\s*=>\s*\'%s\'/', $containerClass), file_get_contents($containerFile), 'kernel.container_class is properly set on the dumped container'); } } diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterDebugCommandTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterDebugCommandTest.php index a4842f239aa05..5bc80fad4b815 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterDebugCommandTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterDebugCommandTest.php @@ -58,7 +58,7 @@ public function testLegacyDebugCommand() $tester->execute([]); - $this->assertRegExp('/foo\s+ANY\s+ANY\s+ANY\s+\\/foo/', $tester->getDisplay()); + $this->assertMatchesRegularExpression('/foo\s+ANY\s+ANY\s+ANY\s+\\/foo/', $tester->getDisplay()); } /** diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationDebugCommandTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationDebugCommandTest.php index b3e849b134743..895c141f311e5 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationDebugCommandTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationDebugCommandTest.php @@ -28,7 +28,7 @@ public function testDebugMissingMessages() $tester = $this->createCommandTester(['foo' => 'foo']); $tester->execute(['locale' => 'en', 'bundle' => 'foo']); - $this->assertRegExp('/missing/', $tester->getDisplay()); + $this->assertMatchesRegularExpression('/missing/', $tester->getDisplay()); } public function testDebugUnusedMessages() @@ -36,7 +36,7 @@ public function testDebugUnusedMessages() $tester = $this->createCommandTester([], ['foo' => 'foo']); $tester->execute(['locale' => 'en', 'bundle' => 'foo']); - $this->assertRegExp('/unused/', $tester->getDisplay()); + $this->assertMatchesRegularExpression('/unused/', $tester->getDisplay()); } public function testDebugFallbackMessages() @@ -44,7 +44,7 @@ public function testDebugFallbackMessages() $tester = $this->createCommandTester([], ['foo' => 'foo']); $tester->execute(['locale' => 'fr', 'bundle' => 'foo']); - $this->assertRegExp('/fallback/', $tester->getDisplay()); + $this->assertMatchesRegularExpression('/fallback/', $tester->getDisplay()); } public function testNoDefinedMessages() @@ -52,7 +52,7 @@ public function testNoDefinedMessages() $tester = $this->createCommandTester(); $tester->execute(['locale' => 'fr', 'bundle' => 'test']); - $this->assertRegExp('/No defined or extracted messages for locale "fr"/', $tester->getDisplay()); + $this->assertMatchesRegularExpression('/No defined or extracted messages for locale "fr"/', $tester->getDisplay()); } public function testDebugDefaultDirectory() @@ -60,8 +60,8 @@ public function testDebugDefaultDirectory() $tester = $this->createCommandTester(['foo' => 'foo'], ['bar' => 'bar']); $tester->execute(['locale' => 'en']); - $this->assertRegExp('/missing/', $tester->getDisplay()); - $this->assertRegExp('/unused/', $tester->getDisplay()); + $this->assertMatchesRegularExpression('/missing/', $tester->getDisplay()); + $this->assertMatchesRegularExpression('/unused/', $tester->getDisplay()); } public function testDebugDefaultRootDirectory() @@ -75,8 +75,8 @@ public function testDebugDefaultRootDirectory() $tester = $this->createCommandTester(['foo' => 'foo'], ['bar' => 'bar']); $tester->execute(['locale' => 'en']); - $this->assertRegExp('/missing/', $tester->getDisplay()); - $this->assertRegExp('/unused/', $tester->getDisplay()); + $this->assertMatchesRegularExpression('/missing/', $tester->getDisplay()); + $this->assertMatchesRegularExpression('/unused/', $tester->getDisplay()); } public function testDebugCustomDirectory() @@ -90,8 +90,8 @@ public function testDebugCustomDirectory() $tester = $this->createCommandTester(['foo' => 'foo'], ['bar' => 'bar'], $kernel); $tester->execute(['locale' => 'en', 'bundle' => $this->translationDir]); - $this->assertRegExp('/missing/', $tester->getDisplay()); - $this->assertRegExp('/unused/', $tester->getDisplay()); + $this->assertMatchesRegularExpression('/missing/', $tester->getDisplay()); + $this->assertMatchesRegularExpression('/unused/', $tester->getDisplay()); } public function testDebugInvalidDirectory() diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationUpdateCommandTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationUpdateCommandTest.php index 8483f0f0da750..ea3ff56dd3580 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationUpdateCommandTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationUpdateCommandTest.php @@ -27,8 +27,8 @@ public function testDumpMessagesAndClean() { $tester = $this->createCommandTester(['messages' => ['foo' => 'foo']]); $tester->execute(['command' => 'translation:update', 'locale' => 'en', 'bundle' => 'foo', '--dump-messages' => true, '--clean' => true]); - $this->assertRegExp('/foo/', $tester->getDisplay()); - $this->assertRegExp('/1 message was successfully extracted/', $tester->getDisplay()); + $this->assertMatchesRegularExpression('/foo/', $tester->getDisplay()); + $this->assertMatchesRegularExpression('/1 message was successfully extracted/', $tester->getDisplay()); } public function testDumpMessagesAndCleanInRootDirectory() @@ -40,32 +40,32 @@ public function testDumpMessagesAndCleanInRootDirectory() $tester = $this->createCommandTester(['messages' => ['foo' => 'foo']]); $tester->execute(['command' => 'translation:update', 'locale' => 'en', '--dump-messages' => true, '--clean' => true]); - $this->assertRegExp('/foo/', $tester->getDisplay()); - $this->assertRegExp('/1 message was successfully extracted/', $tester->getDisplay()); + $this->assertMatchesRegularExpression('/foo/', $tester->getDisplay()); + $this->assertMatchesRegularExpression('/1 message was successfully extracted/', $tester->getDisplay()); } public function testDumpTwoMessagesAndClean() { $tester = $this->createCommandTester(['messages' => ['foo' => 'foo', 'bar' => 'bar']]); $tester->execute(['command' => 'translation:update', 'locale' => 'en', 'bundle' => 'foo', '--dump-messages' => true, '--clean' => true]); - $this->assertRegExp('/foo/', $tester->getDisplay()); - $this->assertRegExp('/bar/', $tester->getDisplay()); - $this->assertRegExp('/2 messages were successfully extracted/', $tester->getDisplay()); + $this->assertMatchesRegularExpression('/foo/', $tester->getDisplay()); + $this->assertMatchesRegularExpression('/bar/', $tester->getDisplay()); + $this->assertMatchesRegularExpression('/2 messages were successfully extracted/', $tester->getDisplay()); } public function testDumpMessagesForSpecificDomain() { $tester = $this->createCommandTester(['messages' => ['foo' => 'foo'], 'mydomain' => ['bar' => 'bar']]); $tester->execute(['command' => 'translation:update', 'locale' => 'en', 'bundle' => 'foo', '--dump-messages' => true, '--clean' => true, '--domain' => 'mydomain']); - $this->assertRegExp('/bar/', $tester->getDisplay()); - $this->assertRegExp('/1 message was successfully extracted/', $tester->getDisplay()); + $this->assertMatchesRegularExpression('/bar/', $tester->getDisplay()); + $this->assertMatchesRegularExpression('/1 message was successfully extracted/', $tester->getDisplay()); } public function testWriteMessages() { $tester = $this->createCommandTester(['messages' => ['foo' => 'foo']]); $tester->execute(['command' => 'translation:update', 'locale' => 'en', 'bundle' => 'foo', '--force' => true]); - $this->assertRegExp('/Translation files were successfully updated./', $tester->getDisplay()); + $this->assertMatchesRegularExpression('/Translation files were successfully updated./', $tester->getDisplay()); } public function testWriteMessagesInRootDirectory() @@ -77,14 +77,14 @@ public function testWriteMessagesInRootDirectory() $tester = $this->createCommandTester(['messages' => ['foo' => 'foo']]); $tester->execute(['command' => 'translation:update', 'locale' => 'en', '--force' => true]); - $this->assertRegExp('/Translation files were successfully updated./', $tester->getDisplay()); + $this->assertMatchesRegularExpression('/Translation files were successfully updated./', $tester->getDisplay()); } public function testWriteMessagesForSpecificDomain() { $tester = $this->createCommandTester(['messages' => ['foo' => 'foo'], 'mydomain' => ['bar' => 'bar']]); $tester->execute(['command' => 'translation:update', 'locale' => 'en', 'bundle' => 'foo', '--force' => true, '--domain' => 'mydomain']); - $this->assertRegExp('/Translation files were successfully updated./', $tester->getDisplay()); + $this->assertMatchesRegularExpression('/Translation files were successfully updated./', $tester->getDisplay()); } protected function setUp() diff --git a/src/Symfony/Bundle/WebProfilerBundle/Tests/Resources/IconTest.php b/src/Symfony/Bundle/WebProfilerBundle/Tests/Resources/IconTest.php index c3d691d4d3dbf..a690721ebc018 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Tests/Resources/IconTest.php +++ b/src/Symfony/Bundle/WebProfilerBundle/Tests/Resources/IconTest.php @@ -20,7 +20,7 @@ class IconTest extends TestCase */ public function testIconFileContents($iconFilePath) { - $this->assertRegExp('~.*~s', file_get_contents($iconFilePath), sprintf('The SVG metadata of the %s icon is different than expected (use the same as the other icons).', $iconFilePath)); + $this->assertMatchesRegularExpression('~.*~s', file_get_contents($iconFilePath), sprintf('The SVG metadata of the %s icon is different than expected (use the same as the other icons).', $iconFilePath)); } public function provideIconFilePaths() diff --git a/src/Symfony/Component/Config/Tests/Util/XmlUtilsTest.php b/src/Symfony/Component/Config/Tests/Util/XmlUtilsTest.php index 2aecdf8259c65..ffd017267a6a9 100644 --- a/src/Symfony/Component/Config/Tests/Util/XmlUtilsTest.php +++ b/src/Symfony/Component/Config/Tests/Util/XmlUtilsTest.php @@ -81,7 +81,7 @@ public function testLoadFile() XmlUtils::loadFile($fixtures.'valid.xml', [$mock, 'validate']); $this->fail(); } catch (\InvalidArgumentException $e) { - $this->assertRegExp('/The XML file ".+" is not valid\./', $e->getMessage()); + $this->assertMatchesRegularExpression('/The XML file ".+" is not valid\./', $e->getMessage()); } $this->assertInstanceOf('DOMDocument', XmlUtils::loadFile($fixtures.'valid.xml', [$mock, 'validate'])); diff --git a/src/Symfony/Component/Console/Tests/ApplicationTest.php b/src/Symfony/Component/Console/Tests/ApplicationTest.php index 8288cfd3269f4..b073665e6c88a 100644 --- a/src/Symfony/Component/Console/Tests/ApplicationTest.php +++ b/src/Symfony/Component/Console/Tests/ApplicationTest.php @@ -501,9 +501,9 @@ public function testFindAlternativeExceptionMessageMultiple() $this->fail('->find() throws a CommandNotFoundException if command does not exist, with alternatives'); } catch (\Exception $e) { $this->assertInstanceOf('Symfony\Component\Console\Exception\CommandNotFoundException', $e, '->find() throws a CommandNotFoundException if command does not exist, with alternatives'); - $this->assertRegExp('/Did you mean one of these/', $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, with alternatives'); - $this->assertRegExp('/foo1:bar/', $e->getMessage()); - $this->assertRegExp('/foo:bar/', $e->getMessage()); + $this->assertMatchesRegularExpression('/Did you mean one of these/', $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, with alternatives'); + $this->assertMatchesRegularExpression('/foo1:bar/', $e->getMessage()); + $this->assertMatchesRegularExpression('/foo:bar/', $e->getMessage()); } // Namespace + plural @@ -512,8 +512,8 @@ public function testFindAlternativeExceptionMessageMultiple() $this->fail('->find() throws a CommandNotFoundException if command does not exist, with alternatives'); } catch (\Exception $e) { $this->assertInstanceOf('Symfony\Component\Console\Exception\CommandNotFoundException', $e, '->find() throws a CommandNotFoundException if command does not exist, with alternatives'); - $this->assertRegExp('/Did you mean one of these/', $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, with alternatives'); - $this->assertRegExp('/foo1/', $e->getMessage()); + $this->assertMatchesRegularExpression('/Did you mean one of these/', $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, with alternatives'); + $this->assertMatchesRegularExpression('/foo1/', $e->getMessage()); } $application->add(new \Foo3Command()); @@ -525,8 +525,8 @@ public function testFindAlternativeExceptionMessageMultiple() $this->fail('->find() should throw an Symfony\Component\Console\Exception\CommandNotFoundException if a command is ambiguous because of a subnamespace, with alternatives'); } catch (\Exception $e) { $this->assertInstanceOf('Symfony\Component\Console\Exception\CommandNotFoundException', $e); - $this->assertRegExp('/foo3:bar/', $e->getMessage()); - $this->assertRegExp('/foo3:bar:toh/', $e->getMessage()); + $this->assertMatchesRegularExpression('/foo3:bar/', $e->getMessage()); + $this->assertMatchesRegularExpression('/foo3:bar:toh/', $e->getMessage()); } } @@ -555,10 +555,10 @@ public function testFindAlternativeCommands() } catch (\Exception $e) { $this->assertInstanceOf('Symfony\Component\Console\Exception\CommandNotFoundException', $e, '->find() throws a CommandNotFoundException if command does not exist'); $this->assertSame(['afoobar1', 'foo:bar1'], $e->getAlternatives()); - $this->assertRegExp(sprintf('/Command "%s" is not defined./', $commandName), $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, with alternatives'); - $this->assertRegExp('/afoobar1/', $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, with alternative : "afoobar1"'); - $this->assertRegExp('/foo:bar1/', $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, with alternative : "foo:bar1"'); - $this->assertNotRegExp('/foo:bar(?!1)/', $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, without "foo:bar" alternative'); + $this->assertMatchesRegularExpression(sprintf('/Command "%s" is not defined./', $commandName), $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, with alternatives'); + $this->assertMatchesRegularExpression('/afoobar1/', $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, with alternative : "afoobar1"'); + $this->assertMatchesRegularExpression('/foo:bar1/', $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, with alternative : "foo:bar1"'); + $this->assertDoesNotMatchRegularExpression('/foo:bar(?!1)/', $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, without "foo:bar" alternative'); } } @@ -605,10 +605,10 @@ public function testFindAlternativeNamespace() $this->assertContains('foo', $e->getAlternatives()); $this->assertContains('foo1', $e->getAlternatives()); $this->assertContains('foo3', $e->getAlternatives()); - $this->assertRegExp('/There are no commands defined in the "foo2" namespace./', $e->getMessage(), '->find() throws a CommandNotFoundException if namespace does not exist, with alternative'); - $this->assertRegExp('/foo/', $e->getMessage(), '->find() throws a CommandNotFoundException if namespace does not exist, with alternative : "foo"'); - $this->assertRegExp('/foo1/', $e->getMessage(), '->find() throws a CommandNotFoundException if namespace does not exist, with alternative : "foo1"'); - $this->assertRegExp('/foo3/', $e->getMessage(), '->find() throws a CommandNotFoundException if namespace does not exist, with alternative : "foo3"'); + $this->assertMatchesRegularExpression('/There are no commands defined in the "foo2" namespace./', $e->getMessage(), '->find() throws a CommandNotFoundException if namespace does not exist, with alternative'); + $this->assertMatchesRegularExpression('/foo/', $e->getMessage(), '->find() throws a CommandNotFoundException if namespace does not exist, with alternative : "foo"'); + $this->assertMatchesRegularExpression('/foo1/', $e->getMessage(), '->find() throws a CommandNotFoundException if namespace does not exist, with alternative : "foo1"'); + $this->assertMatchesRegularExpression('/foo3/', $e->getMessage(), '->find() throws a CommandNotFoundException if namespace does not exist, with alternative : "foo3"'); } } @@ -639,7 +639,7 @@ public function testFindAlternativesOutput() $this->assertInstanceOf('Symfony\Component\Console\Exception\CommandNotFoundException', $e, '->find() throws a CommandNotFoundException if command is not defined'); $this->assertSame($expectedAlternatives, $e->getAlternatives()); - $this->assertRegExp('/Command "foo" is not defined\..*Did you mean one of these\?.*/Ums', $e->getMessage()); + $this->assertMatchesRegularExpression('/Command "foo" is not defined\..*Did you mean one of these\?.*/Ums', $e->getMessage()); } } @@ -721,9 +721,9 @@ public function testRenderException() $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception3.txt', $tester->getErrorOutput(true), '->renderException() renders a pretty exceptions with previous exceptions'); $tester->run(['command' => 'foo3:bar'], ['decorated' => false, 'verbosity' => Output::VERBOSITY_VERBOSE]); - $this->assertRegExp('/\[Exception\]\s*First exception/', $tester->getDisplay(), '->renderException() renders a pretty exception without code exception when code exception is default and verbosity is verbose'); - $this->assertRegExp('/\[Exception\]\s*Second exception/', $tester->getDisplay(), '->renderException() renders a pretty exception without code exception when code exception is 0 and verbosity is verbose'); - $this->assertRegExp('/\[Exception \(404\)\]\s*Third exception/', $tester->getDisplay(), '->renderException() renders a pretty exception with code exception when code exception is 404 and verbosity is verbose'); + $this->assertMatchesRegularExpression('/\[Exception\]\s*First exception/', $tester->getDisplay(), '->renderException() renders a pretty exception without code exception when code exception is default and verbosity is verbose'); + $this->assertMatchesRegularExpression('/\[Exception\]\s*Second exception/', $tester->getDisplay(), '->renderException() renders a pretty exception without code exception when code exception is 0 and verbosity is verbose'); + $this->assertMatchesRegularExpression('/\[Exception \(404\)\]\s*Third exception/', $tester->getDisplay(), '->renderException() renders a pretty exception with code exception when code exception is 404 and verbosity is verbose'); $tester->run(['command' => 'foo3:bar'], ['decorated' => true]); $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception3decorated.txt', $tester->getDisplay(true), '->renderException() renders a pretty exceptions with previous exceptions'); diff --git a/src/Symfony/Component/Console/Tests/Command/ListCommandTest.php b/src/Symfony/Component/Console/Tests/Command/ListCommandTest.php index 57687d4c60342..3908ca5bb21f2 100644 --- a/src/Symfony/Component/Console/Tests/Command/ListCommandTest.php +++ b/src/Symfony/Component/Console/Tests/Command/ListCommandTest.php @@ -23,7 +23,7 @@ public function testExecuteListsCommands() $commandTester = new CommandTester($command = $application->get('list')); $commandTester->execute(['command' => $command->getName()], ['decorated' => false]); - $this->assertRegExp('/help\s{2,}Displays help for a command/', $commandTester->getDisplay(), '->execute() returns a list of available commands'); + $this->assertMatchesRegularExpression('/help\s{2,}Displays help for a command/', $commandTester->getDisplay(), '->execute() returns a list of available commands'); } public function testExecuteListsCommandsWithXmlOption() @@ -31,7 +31,7 @@ public function testExecuteListsCommandsWithXmlOption() $application = new Application(); $commandTester = new CommandTester($command = $application->get('list')); $commandTester->execute(['command' => $command->getName(), '--format' => 'xml']); - $this->assertRegExp('/