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

[ErrorHandler] Improve fileLinkFormat handling#50734

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

Conversation

nlemoine
Copy link
Contributor

@nlemoinenlemoine commentedJun 21, 2023
edited by nicolas-grekas
Loading

QA
Branch?6.4
Bug fix?no
New feature?yes
Deprecations?yes
TicketsFix#50619
LicenseMIT
Doc PR
  • Avoid repeating file link format guessing (logic is already in FileLinkFormatter class)
  • Always set a fileLinkFormat to a FileLinkFormatter object to handle path mappings properly

@carsonbot
Copy link

Hey!

I see that this is your first PR. That is great! Welcome!

Symfony has acontribution guide which I suggest you to read.

In short:

  • Always add tests
  • Keep backward compatibility (seehttps://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (seehttps://symfony.com/releases)
  • Features and deprecations must be submitted against the 6.4 branch.

Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change.

When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

@nlemoinenlemoineforce-pushed theErrorHandler/ImproveFileLinkFormat branch 3 times, most recently from58c831b to81c102dCompareJune 21, 2023 19:36
@GromNaNGromNaN self-requested a reviewJune 23, 2023 09:23
Copy link
Member

@GromNaNGromNaN left a comment
edited
Loading

Choose a reason for hiding this comment

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

Using theSymfony\Component\HttpKernel\Debug\FileLinkFormatter inSymfony\Component\ErrorHandler\ErrorRenderer\HtmlErrorRenderer is a good idea, but the 2 classes are not in the same composer packages.
I think theFileLinkFormatter should be moved tosymfony/error-handler: this package is already required bysymfony/http-kernel, but not in the other direction.

This can be done in a backward-compatible way by replacing the class with:

namespaceSymfony\Component\HttpKernel\Debug;useSymfony\Component\ErrorHandler\ErrorRenderer\FileLinkFormatterasNewFileLinkFormatter;/** @deprecated since 6.4, use Symfony\Component\ErrorHandler\ErrorRenderer\FileLinkFormatter */class FileLinkFormatterextends NewFileLinkFormatter{// Inherit all the methods from the parent}

I'll just ask @symfony/mergers opinion before you can start editing if you wish.

@nlemoine
Copy link
ContributorAuthor

nlemoine commentedJun 23, 2023
edited
Loading

Using the Symfony\Component\HttpKernel\Debug\FileLinkFormatter in Symfony\Component\ErrorHandler\ErrorRenderer\HtmlErrorRenderer is a good idea, but the 2 classes are not in the same composer packages.

That would be great! My original issue about was actually aiming to consolidate file link formatting and make it more consistent across components. Some business logic, that's already contained inFileLinkFormatter class, is repeated in various places:

Probably all those statements could be replaced with something like (long version):

if ($fileLinkFormatinstanceof FileLinkFormatter) {$this->fileLinkFormat =$fileLinkFormat;}else {$this->fileLinkFormat =class_exists(FileLinkFormatter::class) ?newFileLinkFormatter() :$fileLinkFormat;}

What do you think@GromNaN?

I'll just ask @symfony/mergers opinion before you can start editing if you wish.

That would be welcome!

@nlemoinenlemoineforce-pushed theErrorHandler/ImproveFileLinkFormat branch from29f3941 to32346bfCompareJune 23, 2023 13:57
@nicolas-grekasnicolas-grekas changed the title[ErrorHandler] Improve fileLinkFormat handling (#50619)[ErrorHandler] Improve fileLinkFormat handlingOct 16, 2023
@nicolas-grekasnicolas-grekasforce-pushed theErrorHandler/ImproveFileLinkFormat branch from32346bf to3cc9728CompareOctober 16, 2023 19:50
- Avoid repeating file link format guessing (logic is already in FileLinkFormatter class)- Always set a fileLinkFormat to a FileLinkFormatter object to handle path mappings properly
@nicolas-grekasnicolas-grekasforce-pushed theErrorHandler/ImproveFileLinkFormat branch from3cc9728 to510b77bCompareOctober 16, 2023 20:02
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.

I updated all references to the deprecated namespace.
This should be good to do (despite tests)

@fabpot
Copy link
Member

Thank you@nlemoine.

nicolas-grekas added a commit that referenced this pull requestOct 17, 2023
…fancyweb)This PR was merged into the 6.4 branch.Discussion----------[ErrorHandler] Fix file link format call in trace view| Q             | A| ------------- | ---| Branch?       | 6.4| Bug fix?      | yes| New feature?  | no| Deprecations? | no| Tickets       | no| License       | MITLeftover from#50734Commits-------c2f01c2 [ErrorHandler] Fix file link format call in trace view
nicolas-grekas added a commit that referenced this pull requestOct 17, 2023
…dre-daubois)This PR was merged into the 6.4 branch.Discussion----------[ErrorHandler] Fix expected missing return types| Q             | A| ------------- | ---| Branch?       | 6.4| Bug fix?      | yes| New feature?  | no| Deprecations? | no| Tickets       | -| License       | MITFollow up of#50734Commits-------842e6ab [ErrorHandler] Fix expected missing return types
@nlemoinenlemoine deleted the ErrorHandler/ImproveFileLinkFormat branchOctober 17, 2023 12:59
@nlemoine
Copy link
ContributorAuthor

Great, thanks!

This was referencedOct 21, 2023
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@GromNaNGromNaNGromNaN requested changes

@fabpotfabpotfabpot approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@ycerutoycerutoAwaiting requested review from ycerutoyceruto is a code owner

@xabbuhxabbuhAwaiting requested review from xabbuhxabbuh is a code owner

Assignees
No one assigned
Projects
None yet
Milestone
6.4
Development

Successfully merging this pull request may close these issues.

Improve fileLinkFormat / SYMFONY_IDE configuration outside Symfony
5 participants
@nlemoine@carsonbot@fabpot@nicolas-grekas@GromNaN

[8]ページ先頭

©2009-2025 Movatter.jp