Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[HttpFoundation] ReturnTypeWillChange attribute missing in RedisSessionHandler::updateTimestamp() #45483

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
luxemate opened this issue Feb 19, 2022 · 2 comments

Comments

@luxemate
Copy link
Contributor

luxemate commented Feb 19, 2022

Symfony version(s) affected

4.4.37

Description

Greetings,

In this commit f7abdec#diff-41ab8decc1c9a80a9eddc61fb2c29602aaf1a82c80d0a0dfe45bab694a56b9ae the attribute was added, but it didn't land to 4.4 branch, while this one 1261a41#diff-41ab8decc1c9a80a9eddc61fb2c29602aaf1a82c80d0a0dfe45bab694a56b9ae fixing the RedisSessionHandler::gc() has landed to 4.4.

Was it a mistake or it was done intentionally? Shall I open a PR to fix just updateTimestamp() method, or there is a possibility the missing commit will be merged into 4.4?

In PHP 8.1 it causes:

Deprecated: Return type of Symfony\Component\HttpFoundation\Session\Storage\Handler\RedisSessionHandler::updateTimestamp($sessionId, $data) should either be compatible with SessionUpdateTimestampHandlerInterface::updateTimestamp(string $id, string $data): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /app/vendor/symfony/http-foundation/Session/Storage/Handler/RedisSessionHandler.php on line 119

How to reproduce

Nothing to reproduce.

Possible Solution

No response

Additional Context

No response

@nicolas-grekas
Copy link
Member

It look like we also missed adding the annotation to MongoDbSessionHandler.
Would you mind sending a PR on branch 4.4 to add the missing attributes, as we did on other handlers?

@luxemate
Copy link
Contributor Author

Will do.

nicolas-grekas added a commit that referenced this issue Feb 21, 2022
…es (luxemate)

This PR was merged into the 4.4 branch.

Discussion
----------

[HttpFoundation] Fix missing ReturnTypeWillChange attributes

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #45483
| License       | MIT
| Doc PR        |

Fixes deprecation notices in PHP 8.1 by adding the missing ReturnTypeWillChange attributes to the methods that implement the PHP built-in interfaces.

Commits
-------

89e6eed Fix missing ReturnTypeWillChange attributes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants