Example #1
0
 protected function error(Context $context, $name)
 {
     $expected = $this->expected;
     if (is_string($this->with)) {
         $expected = $context->trans($this->with);
     }
     throw (new Error($this->getErrorMessage("filter.rule.compare.{$this->op}")))->setArgs(["%value%" => $context->getValue($name), "%name%" => $context->trans($name), "%expected%" => $expected])->setName(is_string($this->with) ? $name . "." . $this->with : $name);
 }