From 46b071b2d44682bc3686a7a084cd03002ccece6a Mon Sep 17 00:00:00 2001 From: Ayesh Karunaratne Date: Mon, 14 Aug 2023 10:55:56 +0800 Subject: [PATCH] [PHP 8.3] Fix `get_class()` deprecations In PHP 8.3, [calling `get_class()` and `get_parent_class()` functions without arguments is deprecated](https://php.watch/versions/8.3/get_class-get_parent_class-parameterless-deprecated). This fixes them with identical alternatives that do not cause the deprecation notice. References: - [PHP RFC: Deprecate functions with overloaded signatures](https://wiki.php.net/rfc/deprecate_functions_with_overloaded_signatures) - [PHP 8.3: get_class() and get_parent_class() function calls without arguments deprecated](https://php.watch/versions/8.3/get_class-get_parent_class-parameterless-deprecated) --- src/Extension/ExtendableTrait.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Extension/ExtendableTrait.php b/src/Extension/ExtendableTrait.php index 9c54c4b89..5b0a25c02 100644 --- a/src/Extension/ExtendableTrait.php +++ b/src/Extension/ExtendableTrait.php @@ -386,7 +386,7 @@ public function extendableGet($name) } } - $parent = get_parent_class(); + $parent = get_parent_class($this); if ($parent !== false && method_exists($parent, '__get')) { return parent::__get($name); } @@ -413,7 +413,7 @@ public function extendableSet($name, $value) /* * This targets trait usage in particular */ - $parent = get_parent_class(); + $parent = get_parent_class($this); if ($parent !== false && method_exists($parent, '__set')) { parent::__set($name, $value); } @@ -457,7 +457,7 @@ public function extendableCall($name, $params = null) } } - $parent = get_parent_class(); + $parent = get_parent_class($this); if ($parent !== false && method_exists($parent, '__call')) { return parent::__call($name, $params); }