- Issue created by @Natallia
- 🇮🇳India Vishal Choudhary Dharmshala
Related to -> 4. 780 docroot/core/lib/Drupal/Core/Url.php get_class() without argument.
Example:
If you want to get the class name of the current object, you need to replace the following code:
1. get_class();$class = get_class();
Should be replaced with
$class = get_class($this);
2. get_called_class();
$class = get_called_class();
Should be Replaced with
$class = get_called_class(self::class);
- 🇮🇳India anchal_gupta
I have uploaded the patch.
Addressed #3
Please review it. - Status changed to Needs review
over 1 year ago 8:49am 29 March 2023 - @natallia opened merge request.
As It is implies that functionality of code will not be touched:
The changes 1. get_class() -> get_class($this) and 2. get_called_class() -> get_called_class(self::class) are both not equivalent (e.g. see Example2 from https://www.php.net/manual/en/function.get-class.php)
and the changes in the merge request are taken from proposal here https://wiki.php.net/rfc/deprecations_php_8_1- Status changed to RTBC
over 1 year ago 1:42pm 29 March 2023 - 🇺🇸United States smustgrave
Removing credit for #4 as it's expected to test your path before uploading.
Reviewing MR 3741
Searched for get_class() found 5 instances that were covered
Searched for get_called_class() found 1 that was covered
Searched for get_parent_class and found 0Looks good
Good work!
- Status changed to Fixed
over 1 year ago 2:38pm 29 March 2023 - 🇬🇧United Kingdom catch
Committed/pushed to 10.1.x, cherry-picked to 10.0.x and 9.5.x, thanks!
Automatically closed - issue fixed for 2 weeks with no activity.