임관 추가. 유니크 복권 추첨을 General 클래스 용으로 변경

This commit is contained in:
2018-10-21 15:20:27 +09:00
parent 6c5c2d40bc
commit ff87555eba
38 changed files with 467 additions and 165 deletions
+32
View File
@@ -0,0 +1,32 @@
<?php
namespace sammo\Constraint;
class NotBeNeutral extends Constraint{
const REQ_VALUES = Constraint::REQ_GENERAL;
public function checkInputValues(bool $throwExeception=true){
if(!parent::checkInputValues($throwExeception) && !$throwException){
return false;
}
if(!key_exists('nation', $this->general)){
if(!$throwExeception){return false; }
throw new \InvalidArgumentException("require nation in general");
}
return true;
}
public function test():bool{
$this->checkInputValues();
$this->tested = true;
if($this->general['nation'] != 0){
return true;
}
$this->reason = "재야입니다.";
return false;
}
}