8000 [2.3] Static Code Analysis for Components by kalessil · Pull Request #17085 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[2.3] Static Code Analysis for Components #17085

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
Prev Previous commit
Next Next commit
Php Inspections (EA Extended): make sprintf pattern (inline variable)…
… consistent
  • Loading branch information
kalessil committed Dec 25, 2015
commit 001647476be433fcce00b98653fff6a434dea054
2 changes: 1 addition & 1 deletion src/Symfony/Component/HttpFoundation/HeaderBag.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function __toString()
foreach ($this->headers as $name => $values) {
$name = implode('-', array_map('ucfirst', explode('-', $name)));
foreach ($values as $value) {
$content .= sprintf("%-${max}s %s", $name.':', $value);
$content .= sprintf("%-${max}s %s\r\n", $name.':', $value);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

personally, I prefer {$max}; it generates much cleaner tokens when parsing (think e.g. static analyzers)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It were 4 more cases with sprintf and inline variables, as ${...} structure. Should I make adjustments to {$...} then?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

go for me

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

${...} -> {$...}: done

}
}

Expand Down
0