- Issue created by @webmestre
- Status changed to Needs review
12 months ago 11:18am 25 November 2023 - 🇮🇳India SandeepSingh199
Hi @webmestre, The warning "Deprecated function: Use of 'self' in callables is deprecated" typically occurs when a class method references itself using the self keyword in a way that involves a callable. This is a change introduced in PHP >=8.1. You can modify your code to use the static keyword instead of self. The static keyword refers to the class in which it is used, allowing for late static binding. This change ensures compatibility with PHP >=8.1 and eliminates the deprecation warning.
In my case I am not facing any deprecated function error, but if you getting this error, try with this patch.
- 🇷🇴Romania Cosmin Hodis-Mindras
Thank you for the patch. However, the PHP message is now:
Deprecated function: Use of "static" in callables is deprecated in Drupal\unused_modules\UnusedModulesHelperService::getEnabledModules() (line 75 of /modules/contrib/unused_modules/src/UnusedModulesHelperService.php)
- 🇧🇯Benin delacosta456
hi
as mentioned by @cosmin-hodis-mindras after applying patch on my own side too the error message changed to exactly message reported ( #3 🐛 Deprecated function: Use of "self" in callables Needs review ) . i am on D10.2.5 and php8.2.17Thanks
- First commit to issue fork.
- Merge request !14Draft: Resolve #3404077 "Deprecated function use" → (Closed) created by AstonVictor
-
AstonVictor →
committed 6bf60c88 on 8.x-1.x
Issue #3404077 - Fix php 8.2 bug
-
AstonVictor →
committed 6bf60c88 on 8.x-1.x
- 🇺🇦Ukraine AstonVictor
I was able to reproduce it by using PHP 8.2 version.
Should work now.
- Status changed to Fixed
7 months ago 12:15pm 7 May 2024 Automatically closed - issue fixed for 2 weeks with no activity.