Skip to content

Commit e3bf197

Browse files
Merge branch '7.4' into 8.0
* 7.4: [Messenger] Allow to use custom http client for sqs messenger transport [JsonStreamer] Merge `PropertyMetadata` value transformers [Mailer] Relax regexp to parse message ids [Mailer] Fix parsing message ids in SMTP responses Reviewed translations [HttpClient] Consider cached responses without expiration as immediately stale [Routing] Indicate type of rejected object in CompiledUrlMatcherDumper [Workflow] Extract code from the data collector to a dedicated class [Messenger] Add `MessageSentToTransportsEvent` Add FormFlow for multistep forms management [HttpKernel][DebugBundle] Collect dumps when console profiling is enabled
2 parents 95fe9d4 + 797ed21 commit e3bf197

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

Matcher/Dumper/CompiledUrlMatcherDumper.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -465,11 +465,10 @@ public static function export(mixed $value): string
465465
if (null === $value) {
466466
return 'null';
467467
}
468+
if (\is_object($value)) {
469+
throw new \InvalidArgumentException(\sprintf('Symfony\Component\Routing\Route cannot contain objects, but "%s" given.', get_debug_type($value)));
470+
}
468471
if (!\is_array($value)) {
469-
if (\is_object($value)) {
470-
throw new \InvalidArgumentException('Symfony\Component\Routing\Route cannot contain objects.');
471-
}
472-
473472
return str_replace("\n", '\'."\n".\'', var_export($value, true));
474473
}
475474
if (!$value) {

Tests/Matcher/Dumper/CompiledUrlMatcherDumperTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ public function testGenerateDumperMatcherWithObject()
492492
$routeCollection->add('_', new Route('/', [new \stdClass()]));
493493
$dumper = new CompiledUrlMatcherDumper($routeCollection);
494494

495-
$this->expectExceptionMessage('Symfony\Component\Routing\Route cannot contain objects');
495+
$this->expectExceptionMessage('Symfony\Component\Routing\Route cannot contain objects, but "stdClass" given.');
496496
$this->expectException(\InvalidArgumentException::class);
497497

498498
$dumper->dump();

0 commit comments

Comments
 (0)