示例#1
0
 /**
  * {@inheritdoc}
  *
  * @param  TemplateInterface $template
  * @return mixed|string
  */
 public function getMessage(TemplateInterface $template)
 {
     $vars = $this->getTemplateVars($template);
     $tpl = $this->match->isNegated() ? $template->getNegatedTemplate() : $template->getDefaultTemplate();
     foreach ($vars as $name => $value) {
         $tpl = str_replace('{{' . $name . '}}', $this->objectToString($value), $tpl);
     }
     return $tpl;
 }