Add some PHPdoc comments as suggested by Scrutinizier

This commit is contained in:
jgen 2017-03-08 23:02:26 -08:00
parent c379420a1f
commit 17307820e8
7 changed files with 43 additions and 4 deletions

View file

@ -509,7 +509,7 @@ class Database {
}
/**
* @return bool
* @return boolean|null
* @throws SCoreException
*/
public function commit() {
@ -525,7 +525,7 @@ class Database {
}
/**
* @return bool
* @return boolean|null
* @throws SCoreException
*/
public function rollback() {
@ -566,6 +566,10 @@ class Database {
return $this->engine->name;
}
/**
* @param null|PDO $db
* @param string $sql
*/
private function count_execs($db, $sql, $inputarray) {
if ((defined('DEBUG_SQL') && DEBUG_SQL === true) || (!defined('DEBUG_SQL') && @$_GET['DEBUG_SQL'])) {
$fp = @fopen("data/sql.log", "a");

View file

@ -175,6 +175,10 @@ class Image {
return $images;
}
/**
* @param string[] $tags
* @return boolean
*/
public function validate_accel($tags) {
$yays = 0;
$nays = 0;

View file

@ -86,6 +86,12 @@ xanax
$event->panel->add_block($sb);
}
/**
* Throws if the comment contains banned words.
* @param string $comment
* @param CommentPostingException|SCoreException $ex
* @throws CommentPostingException|SCoreException if the comment contains banned words.
*/
private function test_text($comment, $ex) {
$comment = strtolower($comment);
@ -105,6 +111,9 @@ xanax
}
}
/**
* @return string[]
*/
private function get_words() {
global $config;
$words = array();

View file

@ -157,6 +157,11 @@ class SetupBlock extends Block {
$this->body .= "<input type='hidden' name='_type_$name' value='int'>\n";
}
/**
* @param string $name
* @param string[] $options
* @param null|string $label
*/
public function add_choice_option($name, $options, $label=null) {
global $config;
$current = $config->get_string($name);
@ -176,6 +181,11 @@ class SetupBlock extends Block {
$this->body .= $html;
}
/**
* @param string $name
* @param string[] $options
* @param null|string $label
*/
public function add_multichoice_option($name, $options, $label=null) {
global $config;
$current = $config->get_array($name);

View file

@ -220,7 +220,7 @@ class Wiki extends Extension {
/**
* @param string $title
* @param int|null $revision
* @param integer $revision
* @return WikiPage
*/
private function get_page($title, $revision=-1) {

View file

@ -114,6 +114,9 @@ do_install();
// utilities {{{
// TODO: Can some of these be pushed into "core/util.inc.php" ?
/**
* @return int
*/
function check_gd_version() {
$gdversion = 0;
@ -129,6 +132,9 @@ function check_gd_version() {
return $gdversion;
}
/**
* @return int
*/
function check_im_version() {
$convert_check = exec("convert");
@ -469,6 +475,12 @@ EOD;
echo "\n";
} // }}}
/**
* @param boolean $isPDO
* @param string $errorMessage1
* @param string $errorMessage2
* @param integer $exitCode
*/
function handle_db_errors(/*bool*/ $isPDO, /*str*/ $errorMessage1, /*str*/ $errorMessage2, /*int*/ $exitCode) {
$errorMessage1Extra = ($isPDO ? "Please check and ensure that the database configuration options are all correct." : "Please check the server log files for more information.");
print <<<EOD

View file

@ -242,7 +242,7 @@ EOD;
/**
* @param string $link
* @param null|string $desc
* @param array $pages_matched
* @param string[] $pages_matched
* @return null|string
*/
public function navlinks($link, $desc, $pages_matched) {