Follow-up r84475: fixing the warning is easy enough... :D Also some random tweaks...
authorHappy-melon <happy-melon@users.mediawiki.org>
Mon, 21 Mar 2011 23:03:11 +0000 (23:03 +0000)
committerHappy-melon <happy-melon@users.mediawiki.org>
Mon, 21 Mar 2011 23:03:11 +0000 (23:03 +0000)
includes/Block.php
includes/db/Database.php
tests/phpunit/includes/BlockTest.php

index a082968..78c3027 100644 (file)
@@ -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
index f6ab1f6..223086f 100644 (file)
@@ -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() {
index 9a531a2..362c9ec 100644 (file)
@@ -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");