r106804 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106803‎ | r106804 | r106805 >
Date:16:06, 20 December 2011
Author:reedy
Status:ok (Comments)
Tags:
Comment:
Few bits of documentation
Modified paths:
  • /trunk/extensions/AntiSpoof/AntiSpoof.php (modified) (history)
  • /trunk/extensions/AntiSpoof/SpoofUser.php (modified) (history)
  • /trunk/extensions/AntiSpoof/TestSpoof.php (modified) (history)

Diff [purge]

Index: trunk/extensions/AntiSpoof/AntiSpoof.php
@@ -148,8 +148,8 @@
149149 * (After a sucessful user rename)
150150 *
151151 * @param $uid
152 - * @param $oldName
153 - * @param $newName
 152+ * @param $oldName string
 153+ * @param $newName string
154154 * @return bool
155155 */
156156 function asAddRenameUserHook( $uid, $oldName, $newName ) {
Index: trunk/extensions/AntiSpoof/SpoofUser.php
@@ -1,6 +1,10 @@
22 <?php
33
44 class SpoofUser {
 5+
 6+ /**
 7+ * @param $name string
 8+ */
59 public function __construct( $name ) {
610 $this->mName = strval( $name );
711 list( $ok, $normalized ) = AntiSpoof::checkUnicodeString( $this->mName );
@@ -24,6 +28,7 @@
2529
2630 /**
2731 * Describe the error.
 32+ * @return null|string
2833 */
2934 public function getError() {
3035 return $this->mError;
@@ -31,6 +36,7 @@
3237
3338 /**
3439 * Get the normalized key form
 40+ * @return string|nuyll
3541 */
3642 public function getNormalized() {
3743 return $this->mNormalized;
@@ -96,6 +102,9 @@
97103 return false;
98104 }
99105 $fields = array();
 106+ /**
 107+ * @var $item SpoofUser
 108+ */
100109 foreach ( $items as $item ) {
101110 $fields[] = $item->insertFields();
102111 }
@@ -112,7 +121,6 @@
113122 * @param $oldName
114123 */
115124 public function update( $oldName ) {
116 -
117125 $dbw = wfGetDB( DB_MASTER );
118126
119127 if( $this->record() ) {
Index: trunk/extensions/AntiSpoof/TestSpoof.php
@@ -17,7 +17,7 @@
1818 require_once( dirname( __FILE__ ) . '/AntiSpoof_body.php' );
1919
2020 class TestSpoof extends PHPUnit_Framework_TestCase {
21 -
 21+
2222 public function providePositives() {
2323 return array(
2424 array( 'Laura Fiorucci', 'Låura Fiorucci' ),
@@ -28,7 +28,7 @@
2929 array( 'BetoCG', 'ВетоС6' )
3030 );
3131 }
32 -
 32+
3333 /**
3434 * @dataProvider providePositives
3535 * See http://www.phpunit.de/manual/3.4/en/appendixes.annotations.html#appendixes.annotations.dataProvider
@@ -36,7 +36,7 @@
3737 public function testCheckSpoofing( $userName, $spooferName ) {
3838 $Alice = new SpoofUser( $userName );
3939 $Eve = new SpoofUser( $spooferName );
40 -
 40+
4141 if ( $Eve->isLegal() ) {
4242 $this->assertEquals( $Alice->getNormalized(), $Eve->getNormalized(), "Check that '$spooferName' can't spoof account '$userName'");
4343 }

Comments

#Comment by Nikerabbit (talk | contribs)   07:02, 21 December 2011

Is null nuyll in Russian? :o

Status & tagging log