$val) { $key = isset($aliases[$key]) ? $aliases[$key] : $key; if (property_exists($this, $key)) { $this->{$key} = $val; } } } public function set(string $key, $property, array $data, callable $fn = null) { if (isset($data[$key]) && property_exists($this, $property)) { $value = $fn ? call_user_func($fn, $data[$key]) : $data[$key]; $this->$property = $value; } } }