Closed (fixed)
Project:
Unused Modules
Version:
8.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Nov 2023 at 17:55 UTC
Updated:
21 May 2024 at 12:19 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
sandeepsingh199 commentedHi @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.
Comment #3
cosmin-hm commentedThank 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)PHP 8.2.16, Drupal 10.2.4
Comment #4
delacosta456 commentedhi
as mentioned by @cosmin-hodis-mindras after applying patch on my own side too the error message changed to exactly message reported (#3) . i am on D10.2.5 and php8.2.17
Thanks
Comment #10
astonvictor commentedI was able to reproduce it by using PHP 8.2 version.
Should work now.
Comment #11
astonvictor commented