X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FBlock.php;h=45bae28249cc530d45d32c31a4239dc59693891c;hb=1c68a1ee86e051adbab747eacade5de39ec148ba;hp=3896369ce4dc62edd3d7c7922bbb8973cd3f192f;hpb=d74a185fd315a75b41c9f2a8832ac70437de0e37;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Block.php b/includes/Block.php index 3896369ce4..45bae28249 100644 --- a/includes/Block.php +++ b/includes/Block.php @@ -347,7 +347,7 @@ class Block { /** * Given a database row from the ipblocks table, initialize * member variables - * @param ResultWrapper $row A row from the ipblocks table + * @param stdClass $row A row from the ipblocks table */ protected function initFromRow( $row ) { $this->setTarget( $row->ipb_address ); @@ -382,7 +382,7 @@ class Block { /** * Create a new Block object from a database row - * @param ResultWrapper $row Row from the ipblocks table + * @param stdClass $row Row from the ipblocks table * @return Block */ public static function newFromRow( $row ) { @@ -967,7 +967,7 @@ class Block { $method = __METHOD__; $dbw = wfGetDB( DB_MASTER ); - $dbw->onTransactionIdle( function() use ( $dbw, $method ) { + $dbw->onTransactionIdle( function () use ( $dbw, $method ) { $dbw->delete( 'ipblocks', array( 'ipb_expiry < ' . $dbw->addQuotes( $dbw->timestamp() ) ), $method ); } ); @@ -1104,13 +1104,13 @@ class Block { * - Other softblocks are chosen over autoblocks * - If there are multiple exact or range blocks at the same level, the one chosen * is random - + * * @param array $ipChain List of IPs (strings). This is used to determine how "close" * a block is to the server, and if a block matches exactly, or is in a range. * The order is furthest from the server to nearest e.g., (Browser, proxy1, proxy2, * local-squid, ...) * @param array $block Array of blocks - * @return Block|null the "best" block from the list + * @return Block|null The "best" block from the list */ public static function chooseBlock( array $blocks, array $ipChain ) { if ( !count( $blocks ) ) { @@ -1123,7 +1123,7 @@ class Block { // Sort hard blocks before soft ones and secondarily sort blocks // that disable account creation before those that don't. - usort( $blocks, function( Block $a, Block $b ) { + usort( $blocks, function ( Block $a, Block $b ) { $aWeight = (int)$a->isHardblock() . (int)$a->prevents( 'createaccount' ); $bWeight = (int)$b->isHardblock() . (int)$b->prevents( 'createaccount' ); return strcmp( $bWeight, $aWeight ); // highest weight first @@ -1368,7 +1368,7 @@ class Block { $this->getId(), $lang->formatExpiry( $this->mExpiry ), (string)$intended, - $lang->timeanddate( wfTimestamp( TS_MW, $this->mTimestamp ), true ), + $lang->userTimeAndDate( $this->mTimestamp, $context->getUser() ), ); } }