router = $router; $this->callback = $callback; $this->router->trackGroup($this); } public function __call($method, $params) { $this->router->{$method}(...$params); return $this; } public function execute() { if (!$this->executed) { $this->executed = true; $this->router->executeGroupCallback($this->callback); } } public function __destruct() { $this->execute(); } }