keyNick = '민심'; $this->key = 'trust'; $this->reqVal = $this->arg; if(!key_exists($this->key, $this->city)){ if(!$throwExeception){return false; } throw new \InvalidArgumentException("require {$this->key} in city"); } return true; } public function test():bool{ $this->checkInputValues(); $this->tested = true; if($this->city[$this->key] >= $this->reqVal){ return true; } $this->reason = "민심이 낮아 주민들이 도망갑니다."; return false; } }