public function __construct(SolverFactoryInterface $factory, $params = [], $rules = []) { $this->factory = $factory; $this->params = []; $this->rules = []; foreach ($params as $paramKey => $paramValue) { $this->setParam($paramKey, $paramValue); } foreach ($rules as $ruleException => $ruleHandler) { $this->setSolver($ruleException, $ruleHandler); } }