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.
This commit is contained in:
stephan.kasdorf
2024-03-27 13:49:56 +01:00
parent e92091f235
commit bef8735c43

View File

@@ -30,7 +30,7 @@ class Module extends Adapter\Module
protected function _set(string $name, $value): void protected function _set(string $name, $value): void
{ {
try { try {
$_class_properties = get_class_vars(__CLASS__); $_class_properties = get_class_vars(get_called_class());
if (array_key_exists($name, $_class_properties)) if (array_key_exists($name, $_class_properties))
{ {
$this->$name = $value; $this->$name = $value;
@@ -49,7 +49,7 @@ class Module extends Adapter\Module
protected function _get(string $name): mixed protected function _get(string $name): mixed
{ {
try { try {
$_class_properties = get_class_vars(__CLASS__); $_class_properties = get_class_vars(get_called_class());
if (array_key_exists($name, $_class_properties)) if (array_key_exists($name, $_class_properties))
{ {
return $this->$name; return $this->$name;