Skip to content

Commit 0cea658

Browse files
authored
Add returns to end of functions (#422)
PhpStorm flags functions that don't have returns at the end so this PR rearranges code so that the returns are always at the end, or in one case adds one that was missing.
1 parent f16e2cb commit 0cea658

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

include/layout.inc

+4-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ function highlight_php($code, $return = FALSE)
4343
) . '</div>';
4444

4545
if ($return) { return $highlighted; }
46-
else { echo $highlighted; }
46+
echo $highlighted;
47+
return null;
4748
}
4849

4950
// Same as highlight_php() but does not require '<?php' in $code
@@ -54,8 +55,8 @@ function highlight_php_trimmed($code, $return = false)
5455
$highlighted_code = preg_replace("/\&lt;\?php(\<br \/\>)+/", '', $highlighted_code, 1);
5556

5657
if ($return) { return $highlighted_code; }
57-
5858
echo $highlighted_code;
59+
return null;
5960
}
6061

6162
// Stats pages still need this
@@ -549,6 +550,7 @@ function get_news_changes()
549550
$title = $NEWS_ENTRIES[0]["title"];
550551
return "<a href='{$link}'>{$title}</a>";
551552
}
553+
return false;
552554
}
553555

554556
function news_toc($sections = null) {

0 commit comments

Comments
 (0)