settings = $settings; $this->dispatcher = $dispatcher; } /** * {@inheritdoc} */ public function handle(ServerRequestInterface $request): ResponseInterface { $this->assertAdmin($request->getAttribute('actor')); $settings = $request->getParsedBody(); $this->dispatcher->dispatch(new Event\Saving($settings)); foreach ($settings as $k => $v) { $this->dispatcher->dispatch(new Event\Serializing($k, $v)); $this->settings->set($k, $v); } $this->dispatcher->dispatch(new Event\Saved($settings)); return new EmptyResponse(204); } }