Skip to content
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

Add attribute to avoid Deprecated notice #4

Merged
merged 1 commit into from
Nov 16, 2021
Merged

Add attribute to avoid Deprecated notice #4

merged 1 commit into from
Nov 16, 2021

Conversation

karyna-t
Copy link

@karyna-t karyna-t commented Nov 5, 2021

In PHP 8.1, >> non-final internal methods now require overriding methods to declare a compatible return type, otherwise a deprecated notice is emitted during inheritance validation.
RFC: https://wiki.php.net/rfc/internal_method_return_types

Because of this, we receive a deprecation notice when running our code with PHP8.1.

This PR adds #[ReturnTypeWillChange] attribute where it is needed, in order to avoid the described problem and keep backward compatibility.

@karyna-t
Copy link
Author

Hi @ezimuel , this problem is quite critical for us. Could you check this PR please?

@ezimuel
Copy link
Owner

ezimuel commented Nov 12, 2021

@karyna-tsymbal-atwix thanks for the PR. Did you find other functions where we need to override methods for PHP 8.1? Thanks!

@karyna-t
Copy link
Author

@ezimuel I've checked the codebase for this particular problem with return type, and found only those 2 files.
(maybe there are some other 8.1 compatibility problems but so far we haven't encountered them:)

@ezimuel ezimuel merged commit 4117a1e into ezimuel:master Nov 16, 2021
@ezimuel
Copy link
Owner

ezimuel commented Nov 16, 2021

@karyna-tsymbal-atwix thanks for the PR!

@ezimuel
Copy link
Owner

ezimuel commented Nov 16, 2021

@karyna-tsymbal-atwix I just released version 1.2.0.

@karyna-t
Copy link
Author

Perfect, thanks a lot @ezimuel !

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

Successfully merging this pull request may close these issues.

2 participants