Contraint Reason 추가
This commit is contained in:
@@ -255,7 +255,7 @@ abstract class BaseCommand{
|
|||||||
'destNation'=>$this->destNation,
|
'destNation'=>$this->destNation,
|
||||||
];
|
];
|
||||||
|
|
||||||
$this->reasonNotReservable = Constraint::testAll($this->reservableConstraints??[], $constraintInput, $this->env);
|
[$this->reasonConstraint, $this->reasonNotReservable] = Constraint::testAll($this->reservableConstraints??[], $constraintInput, $this->env);
|
||||||
$this->reservable = $this->reasonNotReservable === null;
|
$this->reservable = $this->reasonNotReservable === null;
|
||||||
return $this->reasonNotReservable;
|
return $this->reasonNotReservable;
|
||||||
}
|
}
|
||||||
@@ -291,7 +291,7 @@ abstract class BaseCommand{
|
|||||||
'destNation'=>$this->destNation,
|
'destNation'=>$this->destNation,
|
||||||
];
|
];
|
||||||
|
|
||||||
$this->reasonNotRunnable = Constraint::testAll($this->runnableConstraints??[], $constraintInput, $this->env);
|
[$this->reasonConstraint, $this->reasonNotRunnable] = Constraint::testAll($this->runnableConstraints??[], $constraintInput, $this->env);
|
||||||
$this->runnable = $this->reasonNotRunnable === null;
|
$this->runnable = $this->reasonNotRunnable === null;
|
||||||
return $this->reasonNotRunnable;
|
return $this->reasonNotRunnable;
|
||||||
|
|
||||||
|
|||||||
@@ -209,7 +209,7 @@ abstract class Constraint{
|
|||||||
|
|
||||||
|
|
||||||
if(!$constraint->test()){
|
if(!$constraint->test()){
|
||||||
return $constraint->reason();
|
return [\sammo\Util::getClassNameFromObj($constraint), $constraint->reason()];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user