コード例 #1
0
 /**
  * @param SkillRank $skillRank
  * @throws \DrdPlus\Skills\Exceptions\CanNotVerifyOwningSkill
  */
 private function guardRelatedSkillOfRank(SkillRank $skillRank)
 {
     if ($this !== $skillRank->getSkill()) {
         if (static::class !== get_class($skillRank->getSkill())) {
             throw new Exceptions\CanNotVerifyOwningSkill('New skill rank belongs to different skill class. Expected ' . static::class . ', got ' . get_class($skillRank->getSkill()));
         } else {
             throw new Exceptions\CanNotVerifyOwningSkill('New skill rank belongs to different instance of skill class ' . static::class);
         }
     }
 }
コード例 #2
0
 /**
  * @param PsychicalSkill $psychicalSkill
  * @param PsychicalSkillPoint $psychicalSkillPoint
  * @param PositiveInteger $requiredRankValue
  * @throws \DrdPlus\Skills\Exceptions\CanNotVerifyOwningSkill
  * @throws \DrdPlus\Skills\Exceptions\CanNotVerifyPaidSkillPoint
  */
 public function __construct(PsychicalSkill $psychicalSkill, PsychicalSkillPoint $psychicalSkillPoint, PositiveInteger $requiredRankValue)
 {
     $this->psychicalSkill = $psychicalSkill;
     $this->psychicalSkillPoint = $psychicalSkillPoint;
     parent::__construct($psychicalSkill, $psychicalSkillPoint, $requiredRankValue);
 }
コード例 #3
0
 public function __construct(Skill $owningSkill, SkillPoint $skillPoint, PositiveInteger $requiredRankValue)
 {
     $this->skill = $owningSkill;
     parent::__construct($owningSkill, $skillPoint, $requiredRankValue);
 }
コード例 #4
0
 /**
  * @param CombinedSkill $combinedSkill
  * @param CombinedSkillPoint $combinedSkillPoint
  * @param PositiveInteger $requiredRankValue
  * @throws \DrdPlus\Skills\Exceptions\CanNotVerifyOwningSkill
  * @throws \DrdPlus\Skills\Exceptions\CanNotVerifyPaidSkillPoint
  */
 public function __construct(CombinedSkill $combinedSkill, CombinedSkillPoint $combinedSkillPoint, PositiveInteger $requiredRankValue)
 {
     $this->combinedSkill = $combinedSkill;
     $this->combinedSkillPoint = $combinedSkillPoint;
     parent::__construct($combinedSkill, $combinedSkillPoint, $requiredRankValue);
 }