/** * @param SkillRank $skillRank * @throws \DrdPlus\Skills\Exceptions\UnexpectedRankValue */ private function guardSkillRankSequence(SkillRank $skillRank) { if ($this->getMaxSkillRankValue() + 1 !== $skillRank->getValue()) { throw new Exceptions\UnexpectedRankValue('New skill rank has to follow rank sequence, expected ' . ($this->getMaxSkillRankValue() + 1) . ", got {$skillRank->getValue()}"); } }