-
Notifications
You must be signed in to change notification settings - Fork 974
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
Replace trait with abstract class to avoid Deprecated Functionality issue in PHP 8.1 #1175
Replace trait with abstract class to avoid Deprecated Functionality issue in PHP 8.1 #1175
Conversation
Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually? |
@karyna-tsymbal-atwix thanks for the PR. I'll review it asap. In the meantime, I merged your PR at ezimuel/ringphp#4 and released |
Hello @ezimuel |
Hi @ezimuel , PHP 8.1 is released, so we'd really appreciate it if you continue reviewing this PR 🙏 regarding this file where there was an issue in builds: |
Hello @ezimuel |
@andrewbess, @karyna-tsymbal-atwix sorry for my late reply. I'm going to review and merge this PR asap, hopefully next week. The goal is to release it with |
@ezimuel Could you please advice scheduled release date for 7.16.0 ? |
@karyna-tsymbal-atwix thanks for this PR, I just merged. |
@xmav I'm going to release |
Hello @ezimuel |
…ssue in PHP 8.1 (#1175) * Replace trait with abstract class to avoid deprecation functionality issue * fix phpcs fail
Just released elasticsearch-php 7.16.0 including the fix for PHP 8.1. Thanks again to @karyna-tsymbal-atwix for the PR! |
In PHP 8.1, Calling a static method directly on a trait is deprecated.
(see https://www.php.net/manual/en/migration81.deprecated.php#migration81.deprecated.core.static-trait)
Because of this, we receive such a deprecation notice when running our code with PHP8.1:
Deprecated Functionality: Calling static trait method Elasticsearch\Namespaces\BooleanRequestWrapper::performRequest is deprecated, it should only be called on a class using the trait
The simplest solution is to replace trait with abstract class.
We also can make performRequest function non-static, but there will be naming conflicts (classes that use it already have the function with the same name). Thus there will more BIC changes.