Skip to content

Commit

Permalink
doc/cs: Begin additional if conditions on a new line
Browse files Browse the repository at this point in the history
  • Loading branch information
lippserd committed Jun 13, 2014
1 parent 7f6010e commit 8fe1d49
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
19 changes: 9 additions & 10 deletions modules/doc/library/Doc/DocParser.php
Expand Up @@ -160,12 +160,11 @@ public function getChapter($chapterName)
$cat = array_merge($cat, $chapter);
}
}
$html = preg_replace_callback(
return preg_replace_callback(
'#<pre><code class="language-php">(.*?)\</code></pre>#s',
array($this, 'highlight'),
Parsedown::instance()->text(implode('', $cat))
);
return $html;
}

/**
Expand Down Expand Up @@ -194,9 +193,9 @@ protected function extractHeader($line, $lastLine)
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]);
Expand All @@ -205,9 +204,9 @@ protected function extractHeader($line, $lastLine)
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);
Expand Down Expand Up @@ -235,8 +234,8 @@ protected function extractHeader($line, $lastLine)
*/
protected function extractHeaderId(&$header)
{
if ($header[0] === '<' &&
preg_match('#(?:<(?P<tag>a|span) id="(?P<id>.+)"></(?P=tag)>)#u', $header, $match)
if ($header[0] === '<'
&& preg_match('#(?:<(?P<tag>a|span) id="(?P<id>.+)"></(?P=tag)>)#u', $header, $match)
) {
$header = str_replace($match[0], '', $header);
return $match['id'];
Expand Down
2 changes: 1 addition & 1 deletion modules/doc/library/Doc/MarkdownFileIterator.php
Expand Up @@ -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();
Expand Down

0 comments on commit 8fe1d49

Please sign in to comment.