Skip to content

Commit

Permalink
Changed Class reference and renamed Module.php file
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
maschinen-stockert committed Mar 27, 2024
1 parent e92091f commit bef8735
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/c/Module.php → core/c/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit bef8735

Please sign in to comment.