From bef8735c43a2ef5a25e92771151ef1d9e85da543 Mon Sep 17 00:00:00 2001 From: "stephan.kasdorf" Date: Wed, 27 Mar 2024 13:49:56 +0100 Subject: [PATCH] Changed Class reference and renamed Module.php file The name of 'Module.php' file in 'core/c' directory has been renamed to lowercase 'module.php', ensuring consistency across all filenames. The code inside the file has been updated, replacing '__CLASS__' with 'get_called_class()', allowing the correct class scope to be referenced even in an inherited context and ensuring proper function of '_set' and '_get' methods. --- core/c/{Module.php => module.php} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename core/c/{Module.php => module.php} (91%) diff --git a/core/c/Module.php b/core/c/module.php similarity index 91% rename from core/c/Module.php rename to core/c/module.php index 49b2fe5..bb74fc5 100644 --- a/core/c/Module.php +++ b/core/c/module.php @@ -30,7 +30,7 @@ public function __construct() protected function _set(string $name, $value): void { try { - $_class_properties = get_class_vars(__CLASS__); + $_class_properties = get_class_vars(get_called_class()); if (array_key_exists($name, $_class_properties)) { $this->$name = $value; @@ -49,7 +49,7 @@ protected function _set(string $name, $value): void protected function _get(string $name): mixed { try { - $_class_properties = get_class_vars(__CLASS__); + $_class_properties = get_class_vars(get_called_class()); if (array_key_exists($name, $_class_properties)) { return $this->$name;