Exemple #1
0
 /**
  * @param string $source
  * @param ElementReflectionInterface $reflectionElement
  * @return string
  */
 public function highlightPhp($source, ElementReflectionInterface $reflectionElement)
 {
     return $this->resolveLink($this->getTypeName($source), $reflectionElement) ?: $this->highlighter->highlight((string) $source);
 }
 /**
  * @return string
  */
 private function getHighlightedCodeFromElement(ElementReflectionInterface $element)
 {
     $content = file_get_contents($element->getFileName());
     return $this->sourceCodeHighlighter->highlightAndAddLineNumbers($content);
 }
 /**
  * @return string
  */
 private function highlightCb(array $match)
 {
     $highlighted = $this->highlighter->highlight(trim(isset($match[3]) ? $match[3] : $match[2]));
     return "<pre>{$highlighted}</pre>";
 }
 /**
  * @return string
  */
 private function getHighlightedCodeFromElement(ReflectionElement $element)
 {
     $content = $this->charsetConvertor->convertFileToUtf($element->getFileName());
     return $this->sourceCodeHighlighter->highlightAndAddLineNumbers($content);
 }