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

[WebProfilerBundle] Fix missing indent on non php files opended in the profiler#60867

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

Open
phcorp wants to merge2 commits intosymfony:6.4
base:6.4
Choose a base branch
Loading
fromphcorp:web-profiler-bundle-file-formatting

Conversation

phcorp
Copy link

@phcorpphcorp commentedJun 21, 2025
edited
Loading

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

This fixes non-php files indent in profiler.

Testing

Considering any project running athttps://127.0.0.1:8000

Non-php file:https://127.0.0.1:8000/_profiler/open?file=config/packages/framework.yaml&line=0
PHP file:https://127.0.0.1:8000/_profiler/open?file=src/Kernel.php&line=0

@xabbuh
Copy link
Member

The CI failures look related.

@phcorpphcorpforce-pushed theweb-profiler-bundle-file-formatting branch from5eb2fec to5aa9f2fCompareJune 21, 2025 15:52
@@ -241,7 +287,7 @@ protected static function fixCodeMarkup(string $line): string
// missing </span> tag at the end of line
$opening = strpos($line, '<span');
$closing = strpos($line, '</span>');
if (false !== $opening && (false === $closing || $closing> $opening)) {
if (false !== $opening && (false === $closing || $closing< $opening)) {
Copy link
Author

@phcorpphcorpJun 21, 2025
edited
Loading

Choose a reason for hiding this comment

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

note: there was a double</span> at the end of the line ; maybe the logic was broken, it added a</span> at the end of the line when an opening span was found and the opening span was before the closing span which seems perfectly fine.

nicolas-grekas reacted with thumbs up emoji
@phcorpphcorpforce-pushed theweb-profiler-bundle-file-formatting branch 4 times, most recently from08bd097 to2951d06CompareJune 21, 2025 16:34

return $this->formatFileExcerpt(
array_map(
static fn (string $line): string => self::fixCodeMarkup($line),

Choose a reason for hiding this comment

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

Suggested change
staticfn (string$line):string =>self::fixCodeMarkup($line),
self::fixCodeMarkup(...),

Copy link
Author

Choose a reason for hiding this comment

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

done.

Copy link
Member

@nicolas-grekasnicolas-grekas left a comment

Choose a reason for hiding this comment

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

Thanks for the PR.
Since this is a bugfix, it should target the lowest affected (and maintained) branch.
Can you please check which one it is and rebase+retarget?

@symfonysymfony deleted a comment fromcarsonbotJun 23, 2025
@phcorpphcorpforce-pushed theweb-profiler-bundle-file-formatting branch from2951d06 to26675ffCompareJune 26, 2025 11:34
@phcorpphcorp changed the base branch from7.4 to6.4June 26, 2025 11:34
@phcorpphcorpforce-pushed theweb-profiler-bundle-file-formatting branch from26675ff to2800a6aCompareJune 26, 2025 11:36
@phcorpphcorpforce-pushed theweb-profiler-bundle-file-formatting branch from2800a6a to268718dCompareJune 26, 2025 11:50
@phcorp
Copy link
Author

Thanks for the PR. Since this is a bugfix, it should target the lowest affected (and maintained) branch. Can you please check which one it is and rebase+retarget?

done. There are failing tests that seem unrelated to this PR and I couldn't change the milestone that was set by the automation


public static function fileExcerptIntegrationProvider()
{
$fixturesPath = realpath(__DIR__.\DIRECTORY_SEPARATOR.'..'.\DIRECTORY_SEPARATOR.'Fixtures');
Copy link
Author

Choose a reason for hiding this comment

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

note: I'm not sure if using a relative path to access fixtures path is ok, this testCodeExtensionTest.php was moved in upper branches so it will failed if fixtures are not also moved

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas left review comments

Assignees
No one assigned
Projects
None yet
Milestone
7.4
Development

Successfully merging this pull request may close these issues.

[WebProfilerBundle] Missing indent on non php files opended in the profiler
4 participants
@phcorp@xabbuh@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp