Example #1
0
 public function handle($command)
 {
     $paste = $this->pasteRepository->getByHash($command->hash);
     if (!$paste->isOwnerBy($command->author)) {
         throw new \RuntimeException('Paste is not owned by this person.... change this ');
     }
     $this->pasteRepository->delete($paste);
     return new DeletePasteResponse($paste);
 }