public function &__get(string $name)
{
$class = get_class($this);
$name = ucfirst($name);
// Return null if no getter is found
$value = null;
// Tests for possible getters
static $types = ['get', 'is'];
foreach ($types as $type) {
$getter = $type . $name;
if (self::hasMethod($class, $getter)) {
// It's necessary to save the value to a variable first because of using &
$value = $this->{$getter}();
break;
}
}
return $value;
}