8000 Merge branch '5.0' · symfony/symfony@1b4ab81 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1b4ab81

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
2 parents d2649f2 + 0f8fe5d commit 1b4ab81

File tree

102 files changed

+130
-418
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+130
-418
lines changed

.appveyor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ init:
1717

1818
install:
1919
- mkdir c:\php && cd c:\php
20-
- appveyor DownloadFile https://github.com/symfony/binary-utils/releases/download/v0.1/php-7.2.9-Win32-VC15-x86.zip
21-
- 7z x php-7.2.9-Win32-VC15-x86.zip -y >nul
20+
- appveyor DownloadFile https://github.com/symfony/binary-utils/releases/download/v0.1/php-7.2.5-Win32-VC15-x86.zip
21+
- 7z x php-7.2.5-Win32-VC15-x86.zip -y >nul
2222
- cd ext
2323
- appveyor DownloadFile https://github.com/symfony/binary-utils/releases/download/v0.1/php_apcu-5.1.17-7.2-ts-vc15-x86.zip
2424
- 7z x php_apcu-5.1.17-7.2-ts-vc15-x86.zip -y >nul

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ addons:
1717

1818
env:
1919
global:
20-
- MIN_PHP=7.2.9
20+
- MIN_PHP=7.2.5
2121
- SYMFONY_PROCESS_PHP_TEST_BINARY=~/.phpenv/shims/php
2222
- MESSENGER_AMQP_DSN=amqp://localhost/%2f/messages
2323
- MESSENGER_REDIS_DSN=redis://127.0.0.1:7006/messages

UPGRADE-4.3.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ Form
9696
----
9797

9898
* Using the `format` option of `DateType` and `DateTimeType` when the `html5` option is enabled is deprecated.
99-
* Using names for buttons that do not start with a lowercase letter, a digit, or an underscore is deprecated and will lead to an
99+
* Using names for buttons that do not start with a letter, a digit, or an underscore is deprecated and will lead to an
100100
exception in 5.0.
101101
* Using names for buttons that do not contain only letters, digits, underscores, hyphens, and colons is deprecated and
102102
will lead to an exception in 5.0.

UPGRADE-5.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ Form
142142
without configuring a reference date.
143143
* Removed support for using `int` or `float` as data for the `NumberType` when the `input` option is set to `string`.
144144
* Removed support for using the `format` option of `DateType` and `DateTimeType` when the `html5` option is enabled.
145-
* Using names for buttons that do not start with a lowercase letter, a digit, or an underscore leads to an exception.
145+
* Using names for buttons that do not start with a letter, a digit, or an underscore leads to an exception.
146146
* Using names for buttons that do not contain only letters, digits, underscores, hyphens, and colons leads to an
147147
exception.
148148
* Using the `date_format`, `date_widget`, and `time_widget` options of the `DateTimeType` when the `widget` option is

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^7.2.9",
19+
"php": "^7.2.5",
2020
"ext-xml": "*",
2121
"doctrine/event-manager": "~1.0",
2222
"doctrine/persistence": "~1.0",

src/Symfony/Bridge/Doctrine/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^7.2.9",
19+
"php": "^7.2.5",
2020
"doctrine/event-manager": "~1.0",
2121
"doctrine/persistence": "~1.0",
2222
"symfony/polyfill-ctype": "~1.8",

src/Symfony/Bridge/Monolog/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^7.2.9",
19+
"php": "^7.2.5",
2020
"monolog/monolog": "^1.25.1|^2",
2121
"symfony/service-contracts": "^1.1|^2",
2222
"symfony/http-kernel": "^4.4|^5.0"

src/Symfony/Bridge/ProxyManager/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^7.2.9",
19+
"php": "^7.2.5",
2020
"symfony/dependency-injection": "^5.0",
2121
"ocramius/proxy-manager": "~2.1"
2222
},

src/Symfony/Bridge/Twig/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^7.2.9",
19+
"php": "^7.2.5",
2020
"symfony/translation-contracts": "^1.1|^2",
2121
"twig/twig": "^2.10|^3.0"
2222
},

src/Symfony/Bundle/DebugBundle/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^7.2.9",
19+
"php": "^7.2.5",
2020
"ext-xml": "*",
2121
"symfony/http-kernel": "^4.4|^5.0",
2222
"symfony/twig-bridge": "^4.4|^5.0",

src/Symfony/Bundle/FrameworkBundle/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^7.2.9",
19+
"php": "^7.2.5",
2020
"ext-xml": "*",
2121
"symfony/cache": "^4.4|^5.0",
2222
"symfony/config": "^5.0",

src/Symfony/Bundle/SecurityBundle/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^7.2.9",
19+
"php": "^7.2.5",
2020
"ext-xml": "*",
2121
"symfony/config": "^4.4|^5.0",
2222
"symfony/dependency-injection": "^4.4|^5.0",

src/Symfony/Bundle/TwigBundle/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^7.2.9",
19+
"php": "^7.2.5",
2020
"symfony/config": "^4.4|^5.0",
2121
"symfony/twig-bridge": "^5.0",
2222
"symfony/http-foundation": "^4.4|^5.0",

src/Symfony/Bundle/WebProfilerBundle/Tests/DependencyInjection/ConfigurationTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ public function getDebugModes()
6060
}
6161

6262
/**
63-
* @group legacy
64-
*
6563
* @dataProvider getInterceptRedirectsConfiguration
6664
*/
6765
public function testConfigTreeUsingInterceptRedirects(bool $interceptRedirects, array $expectedResult)

src/Symfony/Bundle/WebProfilerBundle/Tests/DependencyInjection/WebProfilerExtensionTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,6 @@ public function getToolbarConfig()
142142
}
143143

144144
/**
145-
* @group legacy
146-
*
147145
* @dataProvider getInterceptRedirectsToolbarConfig
148146
*/
149147
public function testToolbarConfigUsingInterceptRedirects(

src/Symfony/Bundle/WebProfilerBundle/composer.json

Lines changed: 1 addi 10000 tion & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^7.2.9",
19+
"php": "^7.2.5",
2020
"symfony/config": "^4.4|^5.0",
2121
"symfony/framework-bundle": "^4.4|^5.0",
2222
"symfony/http-kernel": "^4.4|^5.0",

src/Symfony/Component/Asset/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^7.2.9"
19+
"php": "^7.2.5"
2020
},
2121
"suggest": {
2222
"symfony/http-foundation": ""

src/Symfony/Component/BrowserKit/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^7.2.9",
19+
"php": "^7.2.5",
2020
"symfony/dom-crawler": "^4.4|^5.0"
2121
},
2222
"require-dev": {

src/Symfony/Component/Cache/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"symfony/cache-implementation": "1.0"
2222
},
2323
"require": {
24-
"php": "^7.2.9",
24+
"php": "^7.2.5",
2525
"psr/cache": "~1.0",
2626
"psr/log": "~1.0",
2727
"symfony/cache-contracts": "^1.1.7|^2",

src/Symfony/Component/Config/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^7.2.9",
19+
"php": "^7.2.5",
2020
"symfony/filesystem": "^4.4|^5.0",
2121
"symfony/polyfill-ctype": "~1.8"
2222
},

src/Symfony/Component/Console/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^7.2.9",
19+
"php": "^7.2.5",
2020
"symfony/polyfill-mbstring": "~1.0",
2121
"symfony/polyfill-php73": "^1.8",
2222
"symfony/service-contracts": "^1.1|^2"

src/Symfony/Component/CssSelector/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
}
2121
],
2222
"require": {
23-
"php": "^7.2.9"
23+
"php": "^7.2.5"
2424
},
2525
"autoload": {
2626
"psr-4": { "Symfony\\Component\\CssSelector\\": "" },

src/Symfony/Component/DependencyInjection/Definition.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ public function addMethodCall(string $method, array $arguments = [], bool $retur
357357
if (empty($method)) {
358358
throw new InvalidArgumentException('Method name cannot be empty.');
359359
}
360-
$this->calls[] = 2 < \func_num_args() && func_get_arg(2) ? [$method, $arguments, true] : [$method, $arguments];
360+
$this->calls[] = $returnsClone ? [$method, $arguments, true] : [$method, $arguments];
361361

362362
return $this;
363363
}

src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1302,7 +1302,7 @@ private function addDeprecatedAliases(): string
13021302
$methodNameAlias = $this->generateMethodName($alias);
13031303
$idExported = $this->export($id);
13041304
$messageExported = $this->export($definition->getDeprecationMessage($alias));
1305-
$code = <<<EOF
1305+
$code .= <<<EOF
13061306
1307 10000 1307
/*{$this->docStar}
13081308
* Gets the $public '$alias' alias.

src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1339,6 +1339,30 @@ public function testWither()
13391339
$wither = $container->get('wither');
13401340
$this->assertInstanceOf(Foo::class, $wither->foo);
13411341
}
1342+
1343+
/**
1344+
* @group legacy
1345+
* @expectedDeprecation The "deprecated1" service alias is deprecated. You should stop using it, as it will be removed in the future.
1346+
* @expectedDeprecation The "deprecated2" service alias is deprecated. You should stop using it, as it will be removed in the future.
1347+
*/
1348+
public function testMultipleDeprecatedAliasesWorking()
1349+
{
1350+
$container = new ContainerBuilder();
1351+
$container->setDefinition('bar', new Definition('stdClass'))->setPublic(true);
1352+
$container->setAlias('deprecated1', 'bar')->setPublic(true)->setDeprecated('%alias_id% is deprecated');
1353+
$container->setAlias('deprecated2', 'bar')->setPublic(true)->setDeprecated('%alias_id% is deprecated');
1354+
$container->compile();
1355+
1356+
$dumper = new PhpDumper($container);
1357+
$dump = $dumper->dump(['class' => $class = __FUNCTION__]);
1358+
1359+
eval('?>'.$dump);
1360+
$container = new $class();
1361+
1362+
$this->assertInstanceOf(\stdClass::class, $container->get('bar'));
1363+
$this->assertInstanceOf(\stdClass::class, $container->get('deprecated1'));
1364+
$this->assertInstanceOf(\stdClass::class, $container->get('deprecated2'));
1365+
}
13421366
}
13431367

13441368
class Rot13EnvVarProcessor implements EnvVarProcessorInterface

src/Symfony/Component/DependencyInjection/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^7.2.9",
19+
"php": "^7.2.5",
2020
"psr/container": "^1.0",
2121
"symfony/service-contracts": "^1.1.6|^2"
2222
},

src/Symfony/Component/DomCrawler/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^7.2.9",
19+
"php": "^7.2.5",
2020
"symfony/polyfill-ctype": "~1.8",
2121
"symfony/polyfill-mbstring": "~1.0"
2222
},

src/Symfony/Component/Dotenv/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^7.2.9"
19+
"php": "^7.2.5"
2020
},
2121
"require-dev": {
2222
"symfony/process": "^4.4|^5.0"

src/Symfony/Component/ErrorHandler/ErrorRenderer/HtmlErrorRenderer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function __construct(bool $debug = false, string $charset = null, $fileLi
5252
/**
5353
* {@inheritdoc}
5454
*/
55-
public function render(\Throwable $exception): FlattenException
55+
public function render(\Throwable $exception): FlattenException
5656
{
5757
$exception = FlattenException::createFromThrowable($exception, null, [
5858
'Content-Type' => 'text/html; charset='.$this->charset,

src/Symfony/Component/ErrorHandler/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^7.2.9",
19+
"php": "^7.2.5",
2020
"psr/log": "^1.0",
2121
"symfony/var-dumper": "^4.4|^5.0"
2222
},

src/Symfony/Component/EventDispatcher/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^7.2.9",
19+
"php": "^7.2.5",
2020
"symfony/event-dispatcher-contracts": "^2"
2121
},
2222
"require-dev": {

src/Symfony/Component/ExpressionLanguage/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^7.2.9",
19+
"php": "^7.2.5",
2020
"symfony/cache": "^4.4|^5.0",
2121
"symfony/service-contracts": "^1.1|^2"
2222
},

src/Symfony/Component/Filesystem/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^7.2.9",
19+
"php": "^7.2.5",
2020
"symfony/polyfill-ctype": "~1.8"
2121
},
2222
"autoload": {

src/Symfony/Component/Finder/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^7.2.9"
19+
"php": "^7.2.5"
2020
},
2121
"autoload": {
2222
"psr-4": { "Symfony\\Component\\Finder\\": "" },

src/Symfony/Component/Form/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ CHANGELOG
4141

4242
* added a `symbol` option to the `PercentType` that allows to disable or customize the output of the percent character
4343
* Using the `format` option of `DateType` and `DateTimeType` when the `html5` option is enabled is deprecated.
44-
* Using names for buttons that do not start with a lowercase letter, a digit, or an underscore is deprecated and will lead to an
44+
* Using names for buttons that do not start with a letter, a digit, or an underscore is deprecated and will lead to an
4545
exception in 5.0.
4646
* Using names for buttons that do not contain only letters, digits, underscores, hyphens, and colons is deprecated and
4747
will lead to an exception in 5.0.

src/Symfony/Component/Form/Extension/Validator/Constraints/FormValidator.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ public function validate($form, Constraint $formConstraint)
7676
}
7777
}
7878
} else {
79+
$groupedConstraints = [];
80+
7981
foreach ($constraints as $constraint) {
8082
// For the "Valid" constraint, validate the data in all groups
8183
if ($constraint instanceof Valid) {
@@ -88,7 +90,7 @@ public function validate($form, Constraint $formConstraint)
8890
// matching group
8991
foreach ($groups as $group) {
9092
if (\in_array($group, $constraint->groups)) {
91-
$validator->atPath('data')->validate($form->getData(), $constraint, $group);
93+
$groupedConstraints[$group][] = $constraint;
9294

9395
// Prevent duplicate validation
9496
if (!$constraint instanceof Composite) {
@@ -97,6 +99,10 @@ public function validate($form, Constraint $formConstraint)
9799
}
98100
}
99101
}
102+
103+
foreach ($groupedConstraints as $group => $constraint) {
104+
$validator->atPath('data')->validate($form->getData(), $constraint, $group);
105+
}
100106
}
101107
} elseif (!$form->isSynchronized()) {
102108
$childrenSynchronized = true;

src/Symfony/Component/Form/Tests/ButtonBuilderTest.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,6 @@ public function testNameContainingIllegalCharacters()
4747
$this->assertInstanceOf('\Symfony\Component\Form\ButtonBuilder', new ButtonBuilder('button[]'));
4848
}
4949

50-
/**
51-
* @group legacy
52-
*/
53-
public function testNameStartingWithIllegalCharacters()
54-
{
55-
$this->assertInstanceOf('\Symfony\Component\Form\ButtonBuilder', new ButtonBuilder('Button'));
56-
}
57-
5850
public function getInvalidNames()
5951
{
6052
return [

0 commit comments

Comments
 (0)
0