Skip to content

Commit f6ffed0

Browse files
committed
Merge branch '2.6' into 2.7
* 2.6: [2.6][Validator] Fix BC for Validator's validate method Very small typo fix Fix quoting style consistency. [DependencyInjection] Fail when dumping a Definition with no class nor factory Normalizing recursively - see #9096 No change - the normalizeParams is a copy-and-paste of the earlier logic fixes issue with logging array of non-utf8 data fix validation for Maestro UK card numbers Conflicts: src/Symfony/Component/Security/Http/Firewall/DigestAuthenticationListener.php src/Symfony/Component/Validator/Validator/LegacyValidator.php
2 parents aebae80 + 6e27ca9 commit f6ffed0

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

Dumper/PhpDumper.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,11 +1301,6 @@ private function dumpValue($value, $interpolate = true)
13011301
foreach ($value->getArguments() as $argument) {
13021302
$arguments[] = $this->dumpValue($argument);
13031303
}
1304-
$class = $this->dumpValue($value->getClass());
1305-
1306-
if (false !== strpos($class, '$')) {
1307-
throw new RuntimeException('Cannot dump definitions which have a variable class name.');
1308-
}
13091304

13101305
if (null !== $value->getFactory()) {
13111306
$factory = $value->getFactory();
@@ -1343,6 +1338,15 @@ private function dumpValue($value, $interpolate = true)
13431338
}
13441339
}
13451340

1341+
$class = $value->getClass();
1342+
if (null === $class) {
1343+
throw new RuntimeException('Cannot dump definitions which have no class nor factory.');
1344+
}
1345+
$class = $this->dumpValue($class);
1346+
if (false !== strpos($class, '$')) {
1347+
throw new RuntimeException('Cannot dump definitions which have a variable class name.');
1348+
}
1349+
13461350
return sprintf('new \\%s(%s)', substr(str_replace('\\\\', '\\', $class), 1, -1), implode(', ', $arguments));
13471351
} elseif ($value instanceof Variable) {
13481352
return '$'.$value;

0 commit comments

Comments
 (0)