Skip to content

Commit a57a658

Browse files
Merge branch '4.4' into 5.0
* 4.4: (23 commits) [Filesystem] Handle paths on different drives [WebProfiler] Do not add src-elem CSP directives if they do not exist [Yaml] fix parse error when unindented collections contain a comment Execute docker dependent tests with github actions Update exception.html.php [3.4][Inflector] Improve testSingularize() argument name [Inflector] Fix testPluralize() arguments names [PhpUnitBridge] fix PHP 5.3 compat again Skip validation when email is an empty object fix sr_Latn translation [Validator] fix lazy property usage. Fix annotation [Debug][ErrorHandler] cleanup phpunit.xml.dist files [Translation] Fix for translation:update command updating ICU messages [PhpUnitBridge] fix compat with PHP 5.3 bumped Symfony version to 4.4.9 updated VERSION for 4.4.8 updated CHANGELOG for 4.4.8 provide a useful message when extension types don't match [Cache] Fixed not supported Redis eviction policies ...
2 parents a3ec370 + 245b822 commit a57a658

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

Extension/DependencyInjection/DependencyInjectionExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function getTypeExtensions(string $name)
6262
$extensions = [];
6363

6464
if (isset($this->typeExtensionServices[$name])) {
65-
foreach ($this->typeExtensionServices[$name] as $serviceId => $extension) {
65+
foreach ($this->typeExtensionServices[$name] as $extension) {
6666
$extensions[] = $extension;
6767

6868
$extendedTypes = [];
@@ -72,7 +72,7 @@ public function getTypeExtensions(string $name)
7272

7373
// validate the result of getExtendedTypes() to ensure it is consistent with the service definition
7474
if (!\in_array($name, $extendedTypes, true)) {
75-
throw new InvalidArgumentException(sprintf('The extended type specified for the service "%s" does not match the actual extended type. Expected "%s", given "%s".', $serviceId, $name, implode(', ', $extendedTypes)));
75+
throw new InvalidArgumentException(sprintf('The extended type "%s" specified for the type extension class "%s" does not match any of the actual extended types (["%s"]).', $name, \get_class($extension), implode('", "', $extendedTypes)));
7676
}
7777
}
7878
}

Form.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,7 @@ public function offsetExists($name)
958958
*
959959
* @return FormInterface The child form
960960
*
961-
* @throws \OutOfBoundsException if the named child does not exist
961+
* @throws OutOfBoundsException if the named child does not exist
962962
*/
963963
public function offsetGet($name)
964964
{

FormInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function add($child, string $type = null, array $options = []);
6060
*
6161
* @return self
6262
*
63-
* @throws \OutOfBoundsException if the named child does not exist
63+
* @throws Exception\OutOfBoundsException if the named child does not exist
6464
*/
6565
public function get(string $name);
6666

Tests/Extension/DependencyInjection/DependencyInjectionExtensionTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ public function testGetTypeExtensions()
4444
public function testThrowExceptionForInvalidExtendedType()
4545
{
4646
$this->expectException('Symfony\Component\Form\Exception\InvalidArgumentException');
47+
$this->expectExceptionMessage(sprintf('The extended type "unmatched" specified for the type extension class "%s" does not match any of the actual extended types (["test"]).', TestTypeExtension::class));
48+
4749
$extensions = [
4850
'unmatched' => new \ArrayIterator([new TestTypeExtension()]),
4951
];

0 commit comments

Comments
 (0)