Skip to content

Fix Serializable deprecations triggered by token mocks #41554

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

Merged
merged 1 commit into from
Jun 6, 2021

Conversation

derrabus
Copy link
Member

@derrabus derrabus commented Jun 5, 2021

Q A
Branch? 4.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets Part of #41552
License MIT
Doc PR N/A

On 4.4, TokenInterface extends Serializable but does not enforce implementations to implement __serialize() as well. When creating a mock from this interface, PHPUnit will emit code that triggers a deprecation warning on PHP 8.1.

This PR introduces stricter versions of TokenInterface to work around that problem.

My goal was to keep the diff small and mergable. We can probably drop most of the changes when merging to 5.2 because the two methods have been added there.

@nicolas-grekas
Copy link
Member

Thank you @derrabus.

@nicolas-grekas nicolas-grekas merged commit ec80d3c into symfony:4.4 Jun 6, 2021
@derrabus derrabus deleted the bugfix/serializable branch June 6, 2021 09:03
@derrabus
Copy link
Member Author

derrabus commented Jun 6, 2021

FYI: I've reverted the patch while merging up to 5.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants