diff --git a/modules/doc/library/Doc/DocParser.php b/modules/doc/library/Doc/DocParser.php index 40a6c298e..728dd1c08 100644 --- a/modules/doc/library/Doc/DocParser.php +++ b/modules/doc/library/Doc/DocParser.php @@ -160,12 +160,11 @@ class DocParser $cat = array_merge($cat, $chapter); } } - $html = preg_replace_callback( + return preg_replace_callback( '#
(.*?)\
#s', array($this, 'highlight'), Parsedown::instance()->text(implode('', $cat)) ); - return $html; } /** @@ -194,9 +193,9 @@ class DocParser return null; } $header = null; - if ($line && - $line[0] === '#' && - preg_match('/^#+/', $line, $match) === 1 + if ($line + && $line[0] === '#' + && preg_match('/^#+/', $line, $match) === 1 ) { // Atx-style $level = strlen($match[0]); @@ -205,9 +204,9 @@ class DocParser return null; } } elseif ( - $line && - ($line[0] === '=' || $line[0] === '-') && - preg_match('/^[=-]+\s*$/', $line, $match) === 1 + $line + && ($line[0] === '=' || $line[0] === '-') + && preg_match('/^[=-]+\s*$/', $line, $match) === 1 ) { // Setext $header = trim($lastLine); @@ -235,8 +234,8 @@ class DocParser */ protected function extractHeaderId(&$header) { - if ($header[0] === '<' && - preg_match('#(?:<(?Pa|span) id="(?P.+)">)#u', $header, $match) + if ($header[0] === '<' + && preg_match('#(?:<(?Pa|span) id="(?P.+)">)#u', $header, $match) ) { $header = str_replace($match[0], '', $header); return $match['id']; diff --git a/modules/doc/library/Doc/MarkdownFileIterator.php b/modules/doc/library/Doc/MarkdownFileIterator.php index b68195a3e..2fc8cef1b 100644 --- a/modules/doc/library/Doc/MarkdownFileIterator.php +++ b/modules/doc/library/Doc/MarkdownFileIterator.php @@ -20,7 +20,7 @@ class MarkdownFileIterator extends RecursiveFilterIterator public function accept() { $current = $this->getInnerIterator()->current(); - if (!$current->isFile()) { + if (! $current->isFile()) { return false; } $filename = $current->getFilename();