inputReader = $inputReader; $this->postNotesService = $postNotesService; $this->privilegeService = $privilegeService; $this->postNoteViewProxy = $postNoteViewProxy; } public function getMethods() { return ['PUT']; } public function getUrl() { return '/api/notes/:postNoteId'; } public function work($args) { $postNote = $this->postNotesService->getById($args['postNoteId']); $this->privilegeService->assertPrivilege(Privilege::EDIT_POST_NOTES); $formData = new PostNoteFormData($this->inputReader); $postNote = $this->postNotesService->updatePostNote($postNote, $formData); return $this->postNoteViewProxy->fromEntity($postNote); } }