From e0280511404a3afa795ca6bac5ded8beb106e9cd Mon Sep 17 00:00:00 2001 From: Reedy Date: Sun, 9 Dec 2012 03:12:12 +0000 Subject: [PATCH] Add a handful of missing @return Change-Id: I21b218e6694600a2d2df4dd0a6b2b5cd2e10f1f9 --- includes/Sanitizer.php | 1 + includes/db/DatabaseMysql.php | 4 ++++ includes/db/LoadBalancer.php | 1 + includes/diff/DifferenceEngine.php | 2 ++ includes/filerepo/file/ForeignDBFile.php | 5 +++++ includes/filerepo/file/LocalFile.php | 2 +- includes/job/Job.php | 2 ++ 7 files changed, 16 insertions(+), 1 deletion(-) diff --git a/includes/Sanitizer.php b/includes/Sanitizer.php index c2d34b0b37..ff79c5949c 100644 --- a/includes/Sanitizer.php +++ b/includes/Sanitizer.php @@ -647,6 +647,7 @@ class Sanitizer { * * @param $params * @param $element + * @return bool */ static function validateTag( $params, $element ) { $params = Sanitizer::decodeTagAttributes( $params ); diff --git a/includes/db/DatabaseMysql.php b/includes/db/DatabaseMysql.php index c5100b5c21..4ac77075e0 100644 --- a/includes/db/DatabaseMysql.php +++ b/includes/db/DatabaseMysql.php @@ -744,6 +744,7 @@ class DatabaseMysql extends DatabaseBase { * @param $write array * @param $method string * @param $lowPriority bool + * @return bool */ public function lockTables( $read, $write, $method, $lowPriority = true ) { $items = array(); @@ -759,13 +760,16 @@ class DatabaseMysql extends DatabaseBase { } $sql = "LOCK TABLES " . implode( ',', $items ); $this->query( $sql, $method ); + return true; } /** * @param $method string + * @return bool */ public function unlockTables( $method ) { $this->query( "UNLOCK TABLES", $method ); + return true; } /** diff --git a/includes/db/LoadBalancer.php b/includes/db/LoadBalancer.php index d42a152858..13fa466523 100644 --- a/includes/db/LoadBalancer.php +++ b/includes/db/LoadBalancer.php @@ -732,6 +732,7 @@ class LoadBalancer { /** * @param $conn + * @return bool * @throws DBConnectionError */ function reportConnectionError( &$conn ) { diff --git a/includes/diff/DifferenceEngine.php b/includes/diff/DifferenceEngine.php index a3239a3e86..c8f1d7f54d 100644 --- a/includes/diff/DifferenceEngine.php +++ b/includes/diff/DifferenceEngine.php @@ -735,6 +735,7 @@ class DifferenceEngine extends ContextSource { * @param $old Content: old content * @param $new Content: new content * + * @return bool|string * @since 1.21 * @throws MWException if $old or $new are not instances of TextContent. */ @@ -760,6 +761,7 @@ class DifferenceEngine extends ContextSource { * * @param $otext String: old text, must be already segmented * @param $ntext String: new text, must be already segmented + * @return bool|string * @deprecated since 1.21, use generateContentDiffBody() instead! */ function generateDiffBody( $otext, $ntext ) { diff --git a/includes/filerepo/file/ForeignDBFile.php b/includes/filerepo/file/ForeignDBFile.php index a03df85e5e..b0a1ebfcc6 100644 --- a/includes/filerepo/file/ForeignDBFile.php +++ b/includes/filerepo/file/ForeignDBFile.php @@ -58,6 +58,7 @@ class ForeignDBFile extends LocalFile { * @param $srcPath String * @param $flags int * @param $options Array + * @return \FileRepoStatus * @throws MWException */ function publish( $srcPath, $flags = 0, array $options = array() ) { @@ -72,6 +73,7 @@ class ForeignDBFile extends LocalFile { * @param $source string * @param $watch bool * @param $timestamp bool|string + * @return bool * @throws MWException */ function recordUpload( $oldver, $desc, $license = '', $copyStatus = '', $source = '', @@ -82,6 +84,7 @@ class ForeignDBFile extends LocalFile { /** * @param $versions array * @param $unsuppress bool + * @return \FileRepoStatus * @throws MWException */ function restore( $versions = array(), $unsuppress = false ) { @@ -91,6 +94,7 @@ class ForeignDBFile extends LocalFile { /** * @param $reason string * @param $suppress bool + * @return \FileRepoStatus * @throws MWException */ function delete( $reason, $suppress = false ) { @@ -99,6 +103,7 @@ class ForeignDBFile extends LocalFile { /** * @param $target Title + * @return \FileRepoStatus * @throws MWException */ function move( $target ) { diff --git a/includes/filerepo/file/LocalFile.php b/includes/filerepo/file/LocalFile.php index 5acaf04b3a..ee4944860b 100644 --- a/includes/filerepo/file/LocalFile.php +++ b/includes/filerepo/file/LocalFile.php @@ -2382,7 +2382,7 @@ class LocalFileRestoreBatch { /** * Delete unused files in the deleted zone. * This should be called from outside the transaction in which execute() was called. - * @return FileRepoStatus|void + * @return FileRepoStatus */ function cleanup() { if ( !$this->cleanupBatch ) { diff --git a/includes/job/Job.php b/includes/job/Job.php index e23d1c3477..24e9093622 100644 --- a/includes/job/Job.php +++ b/includes/job/Job.php @@ -83,6 +83,7 @@ abstract class Job { * removed later on, when the first one is popped. * * @param $jobs array of Job objects + * @return bool * @deprecated 1.21 */ public static function batchInsert( $jobs ) { @@ -97,6 +98,7 @@ abstract class Job { * large batches of jobs can cause slave lag. * * @param $jobs array of Job objects + * @return bool * @deprecated 1.21 */ public static function safeBatchInsert( $jobs ) { -- 2.20.1