/** * Extracts the formatted header from the definition. * * @param Suite $suite * @param Definition $definition * * @return string[] */ private function extractHeader(Suite $suite, Definition $definition) { $pattern = $definition->getPattern(); $lines = array(); $lines[] = strtr('{suite} <def_dimmed>|</def_dimmed> <info>{type}</info> <def_regex>{regex}</def_regex>', array('{suite}' => $suite->getName(), '{type}' => $definition->getType(), '{regex}' => $pattern)); return $lines; }
protected final function getDefinitionType(Definition $definition, $onlyOne = false) { $this->keywords->setLanguage($this->translator->getLocale()); $method = 'get' . ucfirst($definition->getType()) . 'Keywords'; $keywords = explode('|', $this->keywords->{$method}()); if ($onlyOne) { return current($keywords); } return 1 < count($keywords) ? '[' . implode('|', $keywords) . ']' : implode('|', $keywords); }
/** * {@inheritdoc} */ public function getType() { return $this->definition->getType(); }