Commit a404e00b by Qiang Xue

simplified rule execution [skip ci]

parent face5262
...@@ -151,16 +151,12 @@ abstract class Manager extends Component ...@@ -151,16 +151,12 @@ abstract class Manager extends Component
*/ */
public function executeRule($ruleName, $params, $data) public function executeRule($ruleName, $params, $data)
{ {
if ($ruleName !== null) {
$rule = $this->getRule($ruleName); $rule = $this->getRule($ruleName);
if ($rule instanceof Rule) { if ($rule instanceof Rule) {
return $rule->execute($params, $data); return $rule->execute($params, $data);
} else { } else {
throw new InvalidConfigException("Rule not found: $ruleName"); throw new InvalidConfigException("Rule not found: $ruleName");
} }
} else {
return true;
}
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment