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

[HttpKernel] Move@internal fromAbstractSessionListener class to its methods and properties#53057

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

Conversation

@Florian-Merle
Copy link
Contributor

@Florian-MerleFlorian-Merle commentedDec 13, 2023
edited
Loading

QA
Branch?5.4
Bug fix?yes
New feature?no
Deprecations?no
Issues
LicenseMIT

TheAbstractSessionListener being marked as internal, its public constantNO_AUTO_CACHE_CONTROL_HEADER should not be used while the documentationstates it can.

In fact, static analysis tools like psalm says there is an error with code using this constant.

ERROR: InternalClass - xxx.php:32:33 - Symfony\Component\HttpKernel\EventListener\AbstractSessionListener is internal to Symfony but called from xxx (see https://psalm.dev/174)        $response->headers->set(AbstractSessionListener::NO_AUTO_CACHE_CONTROL_HEADER, 'true');

Another solution is to make every method of theAbstractSessionListener internal but this means the class could be extended.
Also, maybe the classAbstractSessionListener should not be internal, but I don't think so.
This is why I introduced a new interface that is not internal and allows to not introduce BC.

The documentation will need to be updated if this pull request is merged, I'd be happy to do it later.

As discussed, I made public/protected properties and methods internal and removed the original internal mark on the class.
This solves the issue and allows us to use theAbstractSessionListener::NO_AUTO_CACHE_CONTROL_HEADER const just like the documentation says we can.

@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 7.1 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

@chalasr
Copy link
Member

chalasr commentedDec 13, 2023
edited
Loading

I suggest tomakeAbstractSessionListener@final instead of@internal remove the@internal flag from the abstract classand mark all of its methods as@internal instead, so we don't have to introduce an interface for a single constant and this PR can target 5.4 as a bugfix.

@stof
Copy link
Member

an abstract class being defined as@final does not make any sense.

@chalasr
Copy link
Member

Right, stoffed again 😅
Proposal updated to just mark its methods as internal.

@Florian-MerleFlorian-Merleforce-pushed themove-no-auto-cache-control-header-constant branch from733f4c4 todcf62d8CompareDecember 14, 2023 13:10
@Florian-MerleFlorian-Merle changed the base branch from7.1 to5.4December 14, 2023 13:10
@Florian-MerleFlorian-Merle changed the title[HttpKernel] Move const NO_AUTO_CACHE_CONTROL_HEADER to new interface…[HttpKernel] Move @internal from AbstractSessionListener class to its methods and propertiesDec 14, 2023
@chalasrchalasr modified the milestones:7.1,5.4Dec 14, 2023
* Deprecate the`fileLinkFormat` parameter of`DebugHandlersListener`
* Add support for configuring log level, and status code by exception class
* Allow ignoring "kernel.reset" methods that don't exist with "on_invalid" attribute
* Un-mark`AbstractSessionListener` as internal and mark all of its public/protected method/properties as internal
Copy link
Member

Choose a reason for hiding this comment

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

Should be reverted as changelogs are auto-generated for bugfix releases

OskarStark and asrorbekh reacted with thumbs up emoji
Copy link
Member

@chalasrchalasr left a comment

Choose a reason for hiding this comment

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

with minor comment

@OskarStarkOskarStark changed the title[HttpKernel] Move @internal from AbstractSessionListener class to its methods and properties[HttpKernel] Move@internal fromAbstractSessionListener class to its methods and propertiesDec 16, 2023
@fabpotfabpotforce-pushed themove-no-auto-cache-control-header-constant branch fromdcf62d8 todefe229CompareDecember 17, 2023 19:08
@fabpot
Copy link
Member

Thank you@Florian-Merle.

Florian-Merle reacted with hooray emoji

@fabpotfabpot merged commit1de8768 intosymfony:5.4Dec 17, 2023
@Florian-MerleFlorian-Merle deleted the move-no-auto-cache-control-header-constant branchDecember 18, 2023 15:26
This was referencedDec 30, 2023
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

@chalasrchalasrchalasr approved these changes

@dunglasdunglasAwaiting requested review from dunglas

@OskarStarkOskarStarkAwaiting requested review from OskarStark

Assignees

No one assigned

Projects

None yet

Milestone

5.4

Development

Successfully merging this pull request may close these issues.

5 participants

@Florian-Merle@carsonbot@chalasr@stof@fabpot

[8]ページ先頭

©2009-2025 Movatter.jp