Piwik\API\Proxy::setDocumentation PHP Method

setDocumentation() private method

Will be displayed in the API page
private setDocumentation ( ReflectionClass $rClass, string $className )
$rClass ReflectionClass Instance of ReflectionClass
$className string Name of the class
    private function setDocumentation($rClass, $className)
    {
        // Doc comment
        $doc = $rClass->getDocComment();
        $doc = str_replace(" * " . PHP_EOL, "<br>", $doc);
        // boldify the first line only if there is more than one line, otherwise too much bold
        if (substr_count($doc, '<br>') > 1) {
            $firstLineBreak = strpos($doc, "<br>");
            $doc = "<div class='apiFirstLine'>" . substr($doc, 0, $firstLineBreak) . "</div>" . substr($doc, $firstLineBreak + strlen("<br>"));
        }
        $doc = preg_replace("/(@package)[a-z _A-Z]*/", "", $doc);
        $doc = preg_replace("/(@method).*/", "", $doc);
        $doc = str_replace(array("\t", "\n", "/**", "*/", " * ", " *", "  ", "\t*", "  *  @package"), " ", $doc);
        // replace 'foo' and `bar` and "foobar" with code blocks... much magic
        $doc = preg_replace('/`(.*?)`/', '<code>$1</code>', $doc);
        $this->metadataArray[$className]['__documentation'] = $doc;
    }