context = $context; $this->hookName = $hookName; $this->params = $params; } /** * Getter **/ public function __get($key) { switch ($key) { case "hookName": return $this->hookName; break; case "params": return $this->params; break; } throw new \Exception("Cannot access attribute {$key}"); } }