Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Config] Fix generated comment for multiline "info"#60400

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:6.4fromGromNaN:gh-60317
May 14, 2025

Conversation

GromNaN
Copy link
Member

QA
Branch?6.4
Bug fix?yes
New feature?no
Deprecations?no
IssuesFix#60317
LicenseMIT

Instead of fixing the multiline comment formatting only for the "info" part, the* is now prepended to every line of the generated comment block.
nette/code-generator uses almost the same transformation:https://github.com/nette/php-generator/blob/42806049a7774a2bd316c958f5dcf01c6b5c56fa/src/PhpGenerator/Helpers.php#L60

}

if ($node instanceof EnumNode) {
$comment .= sprintf(' *@param ParamConfigurator|%s $value', implode('|', array_unique(array_map(fn ($a) => !$a instanceof \UnitEnum ? var_export($a, true) : '\\'.ltrim(var_export($a, true), '\\'), $node->getValues()))))."\n";
$comment .= sprintf('@param ParamConfigurator|%s $value', implode('|', array_unique(array_map(fn ($a) => !$a instanceof \UnitEnum ? var_export($a, true) : '\\'.ltrim(var_export($a, true), '\\'), $node->getValues()))))."\n";
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

When up-merging into 7.2, a backslash is added beforesprintf by6ce530c#diff-2aaa94a5e0cdde514853eddaf724fb3724c0501ddc5285af115bc1fe9c04d7ce

@@ -413,39 +413,43 @@ private function getComment(BaseNode $node): string
{
$comment = '';
if ('' !== $info = (string) $node->getInfo()) {
$comment .=' * '.$info."\n";
$comment .= $info."\n";
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

If we want a smaller fix applied only to the$info part, it would be:

$comment .=' *'.str_replace("\n","\n *",$info)."\n";

@alexandre-daubois
Copy link
Member

Could we edit existing fixtures to cover this (likesrc/Symfony/Component/Config/Tests/Builder/Fixtures/AddToList.php or any of the same folder) ?

@GromNaN
Copy link
MemberAuthor

Thanks@alexandre-daubois, I hadn't found where to test.

alexandre-daubois reacted with thumbs up emoji

@fabpot
Copy link
Member

Thank you@GromNaN.

@fabpotfabpot merged commit7a69d61 intosymfony:6.4May 14, 2025
6 checks passed
@GromNaNGromNaN deleted the gh-60317 branchMay 14, 2025 11:07
This was referencedMay 25, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@fabpotfabpotfabpot approved these changes

@alexandre-dauboisalexandre-dauboisalexandre-daubois approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
6.4
Development

Successfully merging this pull request may close these issues.

4 participants
@GromNaN@alexandre-daubois@fabpot@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp