15 public function validate($string, $config, $context)
17 $string = trim($string);
24 $tokens = $this->
split($string, $config, $context);
25 $tokens = $this->
filter($tokens, $config, $context);
29 return implode(
' ', $tokens);
39 protected function split($string, $config, $context)
48 $pattern =
'/(?:(?<=\s)|\A)' .
49 '((?:--|-?[A-Za-z_])[A-Za-z_\-0-9]*)' .
51 preg_match_all($pattern, $string, $matches);
64 protected function filter($tokens, $config, $context)