private function checkNextLevelPaymentByPropertyIncrement(ProfessionNextLevel $professionNextLevel) { $relatedProperties = $this->sortAlphabetically($this->getRelatedProperties()); $missingPropertyAdjustment = false; switch ($relatedProperties) { case $this->sortAlphabetically([Strength::STRENGTH, Agility::AGILITY]): $missingPropertyAdjustment = $professionNextLevel->getStrengthIncrement()->getValue() === 0 && $professionNextLevel->getAgilityIncrement()->getValue() === 0; break; case $this->sortAlphabetically([Will::WILL, Intelligence::INTELLIGENCE]): $missingPropertyAdjustment = $professionNextLevel->getWillIncrement()->getValue() === 0 && $professionNextLevel->getIntelligenceIncrement()->getValue() === 0; break; case $this->sortAlphabetically([Knack::KNACK, Charisma::CHARISMA]): $missingPropertyAdjustment = $professionNextLevel->getKnackIncrement()->getValue() === 0 && $professionNextLevel->getCharismaIncrement()->getValue() === 0; break; } if ($missingPropertyAdjustment) { throw new Exceptions\MissingPropertyAdjustmentForPayment('The profession ' . $professionNextLevel->getProfession()->getValue() . ' of level ' . $professionNextLevel->getLevelRank()->getValue() . ' has to have adjusted either ' . implode(' or ', $this->getRelatedProperties())); } }