불가침 외교 커맨드 부활. 버그 수정

This commit is contained in:
2020-03-12 15:58:14 +09:00
parent 59f7448aa7
commit d1bc434ced
13 changed files with 440 additions and 88 deletions
+7 -2
View File
@@ -195,7 +195,8 @@ abstract class Constraint{
continue;
}
$method = __NAMESPACE__.'\\'.$constraintArgs[0].'::build';
$constraintName = $constraintArgs[0];
$method = __NAMESPACE__.'\\'.$constraintName.'::build';
/** @var \sammo\Constraint\Constraint $contraint */
$constraint = call_user_func($method,$input);
@@ -209,7 +210,11 @@ abstract class Constraint{
if(!$constraint->test()){
return [\sammo\Util::getClassNameFromObj($constraint), $constraint->reason()];
if($constraint->reason() === null){
throw new \RuntimeException('Reason is not set:'.$constraintName);
}
return [$constraintName, $constraint->reason()];
}
}