8000 [Routing] force stringable object to string in route parameter by garak · Pull Request #40342 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Routing] force stringable object to string in route parameter #40342

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 9 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix cs
  • Loading branch information
garak committed Mar 2, 2021
commit cacdfab451b218174513625b2e6921d4cb50dc73
2 changes: 1 addition & 1 deletion src/Symfony/Component/Routing/Generator/UrlGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ protected function doGenerate($variables, $defaults, $requirements, $tokens, $pa
$mergedParams = array_replace($defaults, $this->context->getParameters(), $parameters);

// force string for an object. See https://bugs.php.net/bug.php?id=66966
$parameters = array_map(static function ($param) { return is_object($param) ? (string) $param : $param; }, $parameters);
$parameters = array_map(static function ($param) { return \is_object($param) ? (string) $param : $param; }, $parameters);

// all params must be given
if ($diff = array_diff_key($variables, $mergedParams)) {
Expand Down
0