From cf08b61b1bbaaef3f44f46cef4e969124457cb9c Mon Sep 17 00:00:00 2001 From: Happy-melon Date: Mon, 21 Mar 2011 23:03:11 +0000 Subject: [PATCH] Follow-up r84475: fixing the warning is easy enough... :D Also some random tweaks to Database.php documentation. --- includes/Block.php | 2 +- includes/db/Database.php | 16 ++++++++-------- tests/phpunit/includes/BlockTest.php | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/includes/Block.php b/includes/Block.php index a082968908..78c30279bf 100644 --- a/includes/Block.php +++ b/includes/Block.php @@ -711,7 +711,7 @@ class Block { # It's okay to autoblock. Go ahead and create/insert the block. - $ipblock = Block::newFromDB( $autoblockIP ); + $ipblock = Block::newFromTarget( $autoblockIP ); if ( $ipblock ) { # If the user is already blocked. Then check if the autoblock would # exceed the user block. If it would exceed, then do nothing, else diff --git a/includes/db/Database.php b/includes/db/Database.php index f6ab1f63ae..223086f67d 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -1119,16 +1119,16 @@ abstract class DatabaseBase implements DatabaseType { * @param $table String: table name * @param $vars String: the selected variables * @param $conds Array: a condition map, terms are ANDed together. - * Items with numeric keys are taken to be literal conditions - * Takes an array of selected variables, and a condition map, which is ANDed - * e.g: selectRow( "page", array( "page_id" ), array( "page_namespace" => - * NS_MAIN, "page_title" => "Astronomy" ) ) would return an object where - * $obj- >page_id is the ID of the Astronomy article + * Items with numeric keys are taken to be literal conditions + * Takes an array of selected variables, and a condition map, which is ANDed + * e.g: selectRow( "page", array( "page_id" ), array( "page_namespace" => + * NS_MAIN, "page_title" => "Astronomy" ) ) would return an object where + * $obj- >page_id is the ID of the Astronomy article * @param $fname String: Calling function name * @param $options Array * @param $join_conds Array * - * @todo migrate documentation to phpdocumentor format + * @return ResultWrapper|Bool */ function selectRow( $table, $vars, $conds, $fname = 'DatabaseBase::selectRow', $options = array(), $join_conds = array() ) { $options['LIMIT'] = 1; @@ -3174,7 +3174,7 @@ class ResultWrapper implements Iterator { * Fields can be retrieved with $row->fieldname, with fields acting like * member variables. * - * @return MySQL row object + * @return object * @throws DBUnexpectedError Thrown if the database returns an error */ function fetchObject() { @@ -3185,7 +3185,7 @@ class ResultWrapper implements Iterator { * Fetch the next row from the given result object, in associative array * form. Fields are retrieved with $row['fieldname']. * - * @return MySQL row object + * @return Array * @throws DBUnexpectedError Thrown if the database returns an error */ function fetchRow() { diff --git a/tests/phpunit/includes/BlockTest.php b/tests/phpunit/includes/BlockTest.php index 9a531a2f46..362c9ec7e3 100644 --- a/tests/phpunit/includes/BlockTest.php +++ b/tests/phpunit/includes/BlockTest.php @@ -35,7 +35,7 @@ class BlockTest extends MediaWikiTestCase { function testInitializerFunctionsReturnCorrectBlock() { - $this->assertTrue( $this->block->equals( Block::newFromDB('UTBlockee') ), "newFromDB() returns the same block as the one that was made"); + $this->assertTrue( $this->block->equals( Block::newFromTarget('UTBlockee') ), "newFromTarget() returns the same block as the one that was made"); $this->assertTrue( $this->block->equals( Block::newFromID( 1 ) ), "newFromID() returns the same block as the one that was made"); -- 2.20.1