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

[HttpFoundation] Add ReturnTypeWillChange to SessionHandlers#41495

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
derrabus merged 1 commit intosymfony:4.4fromnikic:return-type-will-change
Jun 1, 2021

Conversation

@nikic
Copy link
Contributor

QA
Branch?4.4
Bug fix?yes
New feature?no
Deprecations?maybe?
Tickets
LicenseMIT
Doc PR

This adds#[ReturnTypeWillChange] annotations forSessionHandler methods to satisfy theTentative Return Types RFC. This doesn't cover all classes (e.g.MockPdo is also affected), just the ones relating toSessionHandler etc.

It's worth noting that thegc() method is spec'd asint|false on our side, so I've updated type hints accordingly. The method used to return bool prior to PHP 7.1.

sstok reacted with rocket emoji
@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 5.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

derrabus reacted with rocket emoji

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!

sstok reacted with heart emoji
publicfunctiongc($maxlifetime)
{
return (bool)$this->handler->gc($maxlifetime);
return (int)$this->handler->gc($maxlifetime);

Choose a reason for hiding this comment

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

should we remove the cast to letfalse get through?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

I've adjusted this to pass through thefalse return value. I would be happy to just drop it completely though, I'm not sure why these casts are present.

Copy link
Member

Choose a reason for hiding this comment

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

I would say the cast was there to make implementations returningint|false satisfy the@return bool that was assumed. I don't think it makes sense to convert that to aint cast.

nicolas-grekas reacted with thumbs up emoji
@nikicnikicforce-pushed thereturn-type-will-change branch from2528bfc to2247d0bCompareJune 1, 2021 14:08
Copy link
Member

@derrabusderrabus left a comment

Choose a reason for hiding this comment

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

Thank you for your first Symfony contribution,@nikic! 😅

sstok reacted with laugh emoji
@carsonbotcarsonbot changed the titleAdd ReturnTypeWillChange to SessionHandlers[HttpFoundation] Add ReturnTypeWillChange to SessionHandlersJun 1, 2021
@derrabusderrabusforce-pushed thereturn-type-will-change branch from1f91140 to8954b4fCompareJune 1, 2021 19:14
@derrabus
Copy link
Member

Thank you@nikic.

@derrabusderrabus merged commitb439213 intosymfony:4.4Jun 1, 2021
@stof
Copy link
Member

stof commentedJun 2, 2021

When merging that to the 6.0 branch, I think we should add the actual return type rather than the attribute

nikic, derrabus, and sstok reacted with thumbs up emoji

@fabpotfabpot mentioned this pull requestJun 2, 2021
@derrabus
Copy link
Member

Following the discussion on#41290, I suggest to merge these changes up as-is until we are able to trigger deprecation warnings based on the attribute.

nicolas-grekas reacted with thumbs up emoji

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

Reviewers

@stofstofstof left review comments

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@derrabusderrabusderrabus approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

4.4

Development

Successfully merging this pull request may close these issues.

5 participants

@nikic@carsonbot@derrabus@stof@nicolas-grekas

[8]ページ先頭

©2009-2025 Movatter.jp