Skip to content
Permalink
Browse files

Merge branch '5.0'

* 5.0:
  [Routing] fix tests
  [DI] minor cleanup
  [Form] group constraints when calling the validator
  Remove wrong @group legacy annotations
  [DependencyInjection] Fix dumping multiple deprecated aliases
  allow button names to start with uppercase letter
  Allow PHP ^7.2.5
  States that the HttpClient provides a Http Async implementation
  [Routing] Fix ContainerLoader and ObjectLoaderTest
  [HttpKernel] Make ErrorListener::onKernelException()'s dispatcher argument explicit
  [HttpKernel] Drop deprecated ExceptionListener
  Removed extra whitespace
  [Security] Fix best encoder not wired using migrate_from
  • Loading branch information
nicolas-grekas committed Nov 21, 2019
2 parents d2649f2 + 0f8fe5d commit 1b4ab8108542daddd6ca96caf38b464ff3cc459a
Showing with 130 additions and 418 deletions.
  1. +2 −2 .appveyor.yml
  2. +1 −1 .travis.yml
  3. +1 −1 UPGRADE-4.3.md
  4. +1 −1 UPGRADE-5.0.md
  5. +1 −1 composer.json
  6. +1 −1 src/Symfony/Bridge/Doctrine/composer.json
  7. +1 −1 src/Symfony/Bridge/Monolog/composer.json
  8. +1 −1 src/Symfony/Bridge/ProxyManager/composer.json
  9. +1 −1 src/Symfony/Bridge/Twig/composer.json
  10. +1 −1 src/Symfony/Bundle/DebugBundle/composer.json
  11. +1 −1 src/Symfony/Bundle/FrameworkBundle/composer.json
  12. +1 −1 src/Symfony/Bundle/SecurityBundle/composer.json
  13. +1 −1 src/Symfony/Bundle/TwigBundle/composer.json
  14. +0 −2 src/Symfony/Bundle/WebProfilerBundle/Tests/DependencyInjection/ConfigurationTest.php
  15. +0 −2 src/Symfony/Bundle/WebProfilerBundle/Tests/DependencyInjection/WebProfilerExtensionTest.php
  16. +1 −1 src/Symfony/Bundle/WebProfilerBundle/composer.json
  17. +1 −1 src/Symfony/Component/Asset/composer.json
  18. +1 −1 src/Symfony/Component/BrowserKit/composer.json
  19. +1 −1 src/Symfony/Component/Cache/composer.json
  20. +1 −1 src/Symfony/Component/Config/composer.json
  21. +1 −1 src/Symfony/Component/Console/composer.json
  22. +1 −1 src/Symfony/Component/CssSelector/composer.json
  23. +1 −1 src/Symfony/Component/DependencyInjection/Definition.php
  24. +1 −1 src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php
  25. +24 −0 src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php
  26. +1 −1 src/Symfony/Component/DependencyInjection/composer.json
  27. +1 −1 src/Symfony/Component/DomCrawler/composer.json
  28. +1 −1 src/Symfony/Component/Dotenv/composer.json
  29. +1 −1 src/Symfony/Component/ErrorHandler/ErrorRenderer/HtmlErrorRenderer.php
  30. +1 −1 src/Symfony/Component/ErrorHandler/composer.json
  31. +1 −1 src/Symfony/Component/EventDispatcher/composer.json
  32. +1 −1 src/Symfony/Component/ExpressionLanguage/composer.json
  33. +1 −1 src/Symfony/Component/Filesystem/composer.json
  34. +1 −1 src/Symfony/Component/Finder/composer.json
  35. +1 −1 src/Symfony/Component/Form/CHANGELOG.md
  36. +7 −1 src/Symfony/Component/Form/Extension/Validator/Constraints/FormValidator.php
  37. +0 −8 src/Symfony/Component/Form/Tests/ButtonBuilderTest.php
  38. +7 −5 src/Symfony/Component/Form/Tests/Extension/Validator/Constraints/FormValidatorTest.php
  39. +1 −1 src/Symfony/Component/Form/composer.json
  40. +2 −1 src/Symfony/Component/HttpClient/composer.json
  41. +1 −1 src/Symfony/Component/HttpFoundation/composer.json
  42. +1 −0 src/Symfony/Component/HttpKernel/CHANGELOG.md
  43. +1 −2 src/Symfony/Component/HttpKernel/EventListener/ErrorListener.php
  44. +0 −127 src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php
  45. +0 −3 src/Symfony/Component/HttpKernel/Tests/Bundle/BundleTest.php
  46. +0 −159 src/Symfony/Component/HttpKernel/Tests/EventListener/ExceptionListenerTest.php
  47. +1 −1 src/Symfony/Component/HttpKernel/composer.json
  48. +1 −1 src/Symfony/Component/Inflector/composer.json
  49. +1 −1 src/Symfony/Component/Intl/composer.json
  50. +1 −1 src/Symfony/Component/Ldap/composer.json
  51. +1 −1 src/Symfony/Component/Lock/composer.json
  52. +1 −1 src/Symfony/Component/Mailer/Bridge/Amazon/composer.json
  53. +1 −1 src/Symfony/Component/Mailer/Bridge/Google/composer.json
  54. +1 −1 src/Symfony/Component/Mailer/Bridge/Mailchimp/composer.json
  55. +1 −1 src/Symfony/Component/Mailer/Bridge/Mailgun/composer.json
  56. +1 −1 src/Symfony/Component/Mailer/Bridge/Postmark/composer.json
  57. +1 −1 src/Symfony/Component/Mailer/Bridge/Sendgrid/composer.json
  58. +1 −1 src/Symfony/Component/Mailer/composer.json
  59. +1 −1 src/Symfony/Component/Messenger/composer.json
  60. +1 −1 src/Symfony/Component/Mime/composer.json
  61. +1 −1 src/Symfony/Component/Notifier/Bridge/Nexmo/composer.json
  62. +1 −1 src/Symfony/Component/Notifier/Bridge/Slack/composer.json
  63. +1 −1 src/Symfony/Component/Notifier/Bridge/Telegram/composer.json
  64. +1 −1 src/Symfony/Component/Notifier/Bridge/Twilio/composer.json
  65. +1 −1 src/Symfony/Component/Notifier/composer.json
  66. +1 −1 src/Symfony/Component/OptionsResolver/composer.json
  67. +1 −1 src/Symfony/Component/Process/composer.json
  68. +1 −1 src/Symfony/Component/PropertyAccess/composer.json
  69. +1 −1 src/Symfony/Component/PropertyInfo/composer.json
  70. +1 −1 src/Symfony/Component/Routing/Loader/ContainerLoader.php
  71. +1 −1 src/Symfony/Component/Routing/Loader/ObjectLoader.php
  72. +1 −4 src/Symfony/Component/Routing/Tests/Loader/ObjectLoaderTest.php
  73. +1 −1 src/Symfony/Component/Routing/composer.json
  74. +3 −1 src/Symfony/Component/Security/Core/Encoder/EncoderFactory.php
  75. +0 −3 src/Symfony/Component/Security/Core/Tests/Authentication/Provider/DaoAuthenticationProviderTest.php
  76. +0 −3 src/Symfony/Component/Security/Core/Tests/Authentication/Provider/UserAuthenticationProviderTest.php
  77. +2 −3 src/Symfony/Component/Security/Core/Tests/Encoder/EncoderFactoryTest.php
  78. +1 −1 src/Symfony/Component/Security/Core/composer.json
  79. +1 −1 src/Symfony/Component/Security/Csrf/composer.json
  80. +1 −1 src/Symfony/Component/Security/Guard/composer.json
  81. +0 −3 src/Symfony/Component/Security/Http/Tests/Firewall/ExceptionListenerTest.php
  82. +0 −3 src/Symfony/Component/Security/Http/Tests/Firewall/LogoutListenerTest.php
  83. +0 −3 src/Symfony/Component/Security/Http/Tests/RememberMe/AbstractRememberMeServicesTest.php
  84. +1 −1 src/Symfony/Component/Security/Http/composer.json
  85. +1 −1 src/Symfony/Component/Serializer/composer.json
  86. +1 −1 src/Symfony/Component/Stopwatch/composer.json
  87. +1 −1 src/Symfony/Component/String/composer.json
  88. +1 −1 src/Symfony/Component/Templating/composer.json
  89. +1 −1 src/Symfony/Component/Translation/composer.json
  90. +1 −1 src/Symfony/Component/Validator/composer.json
  91. +1 −1 src/Symfony/Component/VarDumper/composer.json
  92. +1 −1 src/Symfony/Component/VarExporter/composer.json
  93. +1 −1 src/Symfony/Component/WebLink/composer.json
  94. +0 −3 src/Symfony/Component/Workflow/Tests/WorkflowTest.php
  95. +1 −1 src/Symfony/Component/Workflow/composer.json
  96. +1 −1 src/Symfony/Component/Yaml/composer.json
  97. +1 −1 src/Symfony/Contracts/Cache/composer.json
  98. +1 −1 src/Symfony/Contracts/EventDispatcher/composer.json
  99. +1 −1 src/Symfony/Contracts/HttpClient/composer.json
  100. +1 −1 src/Symfony/Contracts/Service/composer.json
  101. +1 −1 src/Symfony/Contracts/Translation/composer.json
  102. +1 −1 src/Symfony/Contracts/composer.json
@@ -17,8 +17,8 @@ init:

install:
- mkdir c:\php && cd c:\php
- appveyor DownloadFile https://github.com/symfony/binary-utils/releases/download/v0.1/php-7.2.9-Win32-VC15-x86.zip
- 7z x php-7.2.9-Win32-VC15-x86.zip -y >nul
- appveyor DownloadFile https://github.com/symfony/binary-utils/releases/download/v0.1/php-7.2.5-Win32-VC15-x86.zip
- 7z x php-7.2.5-Win32-VC15-x86.zip -y >nul
- cd ext
- appveyor DownloadFile https://github.com/symfony/binary-utils/releases/download/v0.1/php_apcu-5.1.17-7.2-ts-vc15-x86.zip
- 7z x php_apcu-5.1.17-7.2-ts-vc15-x86.zip -y >nul
@@ -17,7 +17,7 @@ addons:

env:
global:
- MIN_PHP=7.2.9
- MIN_PHP=7.2.5
- SYMFONY_PROCESS_PHP_TEST_BINARY=~/.phpenv/shims/php
- MESSENGER_AMQP_DSN=amqp://localhost/%2f/messages
- MESSENGER_REDIS_DSN=redis://127.0.0.1:7006/messages
@@ -96,7 +96,7 @@ Form
----

* Using the `format` option of `DateType` and `DateTimeType` when the `html5` option is enabled is deprecated.
* Using names for buttons that do not start with a lowercase letter, a digit, or an underscore is deprecated and will lead to an
* Using names for buttons that do not start with a letter, a digit, or an underscore is deprecated and will lead to an
exception in 5.0.
* Using names for buttons that do not contain only letters, digits, underscores, hyphens, and colons is deprecated and
will lead to an exception in 5.0.
@@ -142,7 +142,7 @@ Form
without configuring a reference date.
* Removed support for using `int` or `float` as data for the `NumberType` when the `input` option is set to `string`.
* Removed support for using the `format` option of `DateType` and `DateTimeType` when the `html5` option is enabled.
* Using names for buttons that do not start with a lowercase letter, a digit, or an underscore leads to an exception.
* Using names for buttons that do not start with a letter, a digit, or an underscore leads to an exception.
* Using names for buttons that do not contain only letters, digits, underscores, hyphens, and colons leads to an
exception.
* Using the `date_format`, `date_widget`, and `time_widget` options of the `DateTimeType` when the `widget` option is
@@ -16,7 +16,7 @@
}
],
"require": {
"php": "^7.2.9",
"php": "^7.2.5",
"ext-xml": "*",
"doctrine/event-manager": "~1.0",
"doctrine/persistence": "~1.0",
@@ -16,7 +16,7 @@
}
],
"require": {
"php": "^7.2.9",
"php": "^7.2.5",
"doctrine/event-manager": "~1.0",
"doctrine/persistence": "~1.0",
"symfony/polyfill-ctype": "~1.8",
@@ -16,7 +16,7 @@
}
],
"require": {
"php": "^7.2.9",
"php": "^7.2.5",
"monolog/monolog": "^1.25.1|^2",
"symfony/service-contracts": "^1.1|^2",
"symfony/http-kernel": "^4.4|^5.0"
@@ -16,7 +16,7 @@
}
],
"require": {
"php": "^7.2.9",
"php": "^7.2.5",
"symfony/dependency-injection": "^5.0",
"ocramius/proxy-manager": "~2.1"
},
@@ -16,7 +16,7 @@
}
],
"require": {
"php": "^7.2.9",
"php": "^7.2.5",
"symfony/translation-contracts": "^1.1|^2",
"twig/twig": "^2.10|^3.0"
},
@@ -16,7 +16,7 @@
}
],
"require": {
"php": "^7.2.9",
"php": "^7.2.5",
"ext-xml": "*",
"symfony/http-kernel": "^4.4|^5.0",
"symfony/twig-bridge": "^4.4|^5.0",
@@ -16,7 +16,7 @@
}
],
"require": {
"php": "^7.2.9",
"php": "^7.2.5",
"ext-xml": "*",
"symfony/cache": "^4.4|^5.0",
"symfony/config": "^5.0",
@@ -16,7 +16,7 @@
}
],
"require": {
"php": "^7.2.9",
"php": "^7.2.5",
"ext-xml": "*",
"symfony/config": "^4.4|^5.0",
"symfony/dependency-injection": "^4.4|^5.0",
@@ -16,7 +16,7 @@
}
],
"require": {
"php": "^7.2.9",
"php": "^7.2.5",
"symfony/config": "^4.4|^5.0",
"symfony/twig-bridge": "^5.0",
"symfony/http-foundation": "^4.4|^5.0",
@@ -60,8 +60,6 @@ public function getDebugModes()
}
/**
* @group legacy
*
* @dataProvider getInterceptRedirectsConfiguration
*/
public function testConfigTreeUsingInterceptRedirects(bool $interceptRedirects, array $expectedResult)
@@ -142,8 +142,6 @@ public function getToolbarConfig()
}
/**
* @group legacy
*
* @dataProvider getInterceptRedirectsToolbarConfig
*/
public function testToolbarConfigUsingInterceptRedirects(
@@ -16,7 +16,7 @@
}
],
"require": {
"php": "^7.2.9",
"php": "^7.2.5",
"symfony/config": "^4.4|^5.0",
"symfony/framework-bundle": "^4.4|^5.0",
"symfony/http-kernel": "^4.4|^5.0",
@@ -16,7 +16,7 @@
}
],
"require": {
"php": "^7.2.9"
"php": "^7.2.5"
},
"suggest": {
"symfony/http-foundation": ""
@@ -16,7 +16,7 @@
}
],
"require": {
"php": "^7.2.9",
"php": "^7.2.5",
"symfony/dom-crawler": "^4.4|^5.0"
},
"require-dev": {
@@ -21,7 +21,7 @@
"symfony/cache-implementation": "1.0"
},
"require": {
"php": "^7.2.9",
"php": "^7.2.5",
"psr/cache": "~1.0",
"psr/log": "~1.0",
"symfony/cache-contracts": "^1.1.7|^2",
@@ -16,7 +16,7 @@
}
],
"require": {
"php": "^7.2.9",
"php": "^7.2.5",
"symfony/filesystem": "^4.4|^5.0",
"symfony/polyfill-ctype": "~1.8"
},
@@ -16,7 +16,7 @@
}
],
"require": {
"php": "^7.2.9",
"php": "^7.2.5",
"symfony/polyfill-mbstring": "~1.0",
"symfony/polyfill-php73": "^1.8",
"symfony/service-contracts": "^1.1|^2"
@@ -20,7 +20,7 @@
}
],
"require": {
"php": "^7.2.9"
"php": "^7.2.5"
},
"autoload": {
"psr-4": { "Symfony\\Component\\CssSelector\\": "" },
@@ -357,7 +357,7 @@ public function addMethodCall(string $method, array $arguments = [], bool $retur
if (empty($method)) {
throw new InvalidArgumentException('Method name cannot be empty.');
}
$this->calls[] = 2 < \func_num_args() && func_get_arg(2) ? [$method, $arguments, true] : [$method, $arguments];
$this->calls[] = $returnsClone ? [$method, $arguments, true] : [$method, $arguments];
return $this;
}
@@ -1302,7 +1302,7 @@ private function addDeprecatedAliases(): string
$methodNameAlias = $this->generateMethodName($alias);
$idExported = $this->export($id);
$messageExported = $this->export($definition->getDeprecationMessage($alias));
$code = <<<EOF
$code .= <<<EOF
/*{$this->docStar}
* Gets the $public '$alias' alias.
@@ -1339,6 +1339,30 @@ public function testWither()
$wither = $container->get('wither');
$this->assertInstanceOf(Foo::class, $wither->foo);
}
/**
* @group legacy
* @expectedDeprecation The "deprecated1" service alias is deprecated. You should stop using it, as it will be removed in the future.
* @expectedDeprecation The "deprecated2" service alias is deprecated. You should stop using it, as it will be removed in the future.
*/
public function testMultipleDeprecatedAliasesWorking()
{
$container = new ContainerBuilder();
$container->setDefinition('bar', new Definition('stdClass'))->setPublic(true);
$container->setAlias('deprecated1', 'bar')->setPublic(true)->setDeprecated('%alias_id% is deprecated');
$container->setAlias('deprecated2', 'bar')->setPublic(true)->setDeprecated('%alias_id% is deprecated');
$container->compile();
$dumper = new PhpDumper($container);
$dump = $dumper->dump(['class' => $class = __FUNCTION__]);
eval('?>'.$dump);
$container = new $class();
$this->assertInstanceOf(\stdClass::class, $container->get('bar'));
$this->assertInstanceOf(\stdClass::class, $container->get('deprecated1'));
$this->assertInstanceOf(\stdClass::class, $container->get('deprecated2'));
}
}
class Rot13EnvVarProcessor implements EnvVarProcessorInterface
@@ -16,7 +16,7 @@
}
],
"require": {
"php": "^7.2.9",
"php": "^7.2.5",
"psr/container": "^1.0",
"symfony/service-contracts": "^1.1.6|^2"
},
@@ -16,7 +16,7 @@
}
],
"require": {
"php": "^7.2.9",
"php": "^7.2.5",
"symfony/polyfill-ctype": "~1.8",
"symfony/polyfill-mbstring": "~1.0"
},
@@ -16,7 +16,7 @@
}
],
"require": {
"php": "^7.2.9"
"php": "^7.2.5"
},
"require-dev": {
"symfony/process": "^4.4|^5.0"
@@ -52,7 +52,7 @@ public function __construct(bool $debug = false, string $charset = null, $fileLi
/**
* {@inheritdoc}
*/
public function render(\Throwable $exception): FlattenException
public function render(\Throwable $exception): FlattenException
{
$exception = FlattenException::createFromThrowable($exception, null, [
'Content-Type' => 'text/html; charset='.$this->charset,
@@ -16,7 +16,7 @@
}
],
"require": {
"php": "^7.2.9",
"php": "^7.2.5",
"psr/log": "^1.0",
"symfony/var-dumper": "^4.4|^5.0"
},
@@ -16,7 +16,7 @@
}
],
"require": {
"php": "^7.2.9",
"php": "^7.2.5",
"symfony/event-dispatcher-contracts": "^2"
},
"require-dev": {
@@ -16,7 +16,7 @@
}
],
"require": {
"php": "^7.2.9",
"php": "^7.2.5",
"symfony/cache": "^4.4|^5.0",
"symfony/service-contracts": "^1.1|^2"
},
@@ -16,7 +16,7 @@
}
],
"require": {
"php": "^7.2.9",
"php": "^7.2.5",
"symfony/polyfill-ctype": "~1.8"
},
"autoload": {
@@ -16,7 +16,7 @@
}
],
"require": {
"php": "^7.2.9"
"php": "^7.2.5"
},
"autoload": {
"psr-4": { "Symfony\\Component\\Finder\\": "" },
@@ -41,7 +41,7 @@ CHANGELOG

* added a `symbol` option to the `PercentType` that allows to disable or customize the output of the percent character
* Using the `format` option of `DateType` and `DateTimeType` when the `html5` option is enabled is deprecated.
* Using names for buttons that do not start with a lowercase letter, a digit, or an underscore is deprecated and will lead to an
* Using names for buttons that do not start with a letter, a digit, or an underscore is deprecated and will lead to an
exception in 5.0.
* Using names for buttons that do not contain only letters, digits, underscores, hyphens, and colons is deprecated and
will lead to an exception in 5.0.
@@ -76,6 +76,8 @@ public function validate($form, Constraint $formConstraint)
}
}
} else {
$groupedConstraints = [];
foreach ($constraints as $constraint) {
// For the "Valid" constraint, validate the data in all groups
if ($constraint instanceof Valid) {
@@ -88,7 +90,7 @@ public function validate($form, Constraint $formConstraint)
// matching group
foreach ($groups as $group) {
if (\in_array($group, $constraint->groups)) {
$validator->atPath('data')->validate($form->getData(), $constraint, $group);
$groupedConstraints[$group][] = $constraint;
// Prevent duplicate validation
if (!$constraint instanceof Composite) {
@@ -97,6 +99,10 @@ public function validate($form, Constraint $formConstraint)
}
}
}
foreach ($groupedConstraints as $group => $constraint) {
$validator->atPath('data')->validate($form->getData(), $constraint, $group);
}
}
} elseif (!$form->isSynchronized()) {
$childrenSynchronized = true;
@@ -47,14 +47,6 @@ public function testNameContainingIllegalCharacters()
$this->assertInstanceOf('\Symfony\Component\Form\ButtonBuilder', new ButtonBuilder('button[]'));
}
/**
* @group legacy
*/
public function testNameStartingWithIllegalCharacters()
{
$this->assertInstanceOf('\Symfony\Component\Form\ButtonBuilder', new ButtonBuilder('Button'));
}
public function getInvalidNames()
{
return [

0 comments on commit 1b4ab81

Please sign in to comment.
You can’t perform that action at this time.