From 44086925657b7ea33b99a7da98bd9ac564cfae5d Mon Sep 17 00:00:00 2001 From: hide_d Date: Wed, 11 Mar 2020 21:49:41 +0900 Subject: [PATCH] =?UTF-8?q?Contraint=20Reason=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/sammo/Command/BaseCommand.php | 4 ++-- hwe/sammo/Constraint/Constraint.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hwe/sammo/Command/BaseCommand.php b/hwe/sammo/Command/BaseCommand.php index 83cbdfeb..1c95c116 100644 --- a/hwe/sammo/Command/BaseCommand.php +++ b/hwe/sammo/Command/BaseCommand.php @@ -255,7 +255,7 @@ abstract class BaseCommand{ '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; return $this->reasonNotReservable; } @@ -291,7 +291,7 @@ abstract class BaseCommand{ '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; return $this->reasonNotRunnable; diff --git a/hwe/sammo/Constraint/Constraint.php b/hwe/sammo/Constraint/Constraint.php index 8ef1c656..202fcb9b 100644 --- a/hwe/sammo/Constraint/Constraint.php +++ b/hwe/sammo/Constraint/Constraint.php @@ -209,7 +209,7 @@ abstract class Constraint{ if(!$constraint->test()){ - return $constraint->reason(); + return [\sammo\Util::getClassNameFromObj($constraint), $constraint->reason()]; } }