Beispiel #1
0
 /**
  * @param Message $message
  * @param Shared\StoryId $storyId
  * @throws Exception\Story
  * @return ChapterNumber
  */
 private function assertAndGetChapterNumberFromMessage(Message $message, StoryId $storyId)
 {
     $chapterNumber = Metadata::getChapterNumberFromMessage($message);
     if (!$storyId->equals($chapterNumber->storyId())) {
         throw Exception\Story::receivedMessageForDifferentStory($message, $storyId, $chapterNumber->storyId());
     }
     return $chapterNumber;
 }