Index: trunk/extensions/AntiSpoof/AntiSpoof.php |
— | — | @@ -148,8 +148,8 @@ |
149 | 149 | * (After a sucessful user rename) |
150 | 150 | * |
151 | 151 | * @param $uid |
152 | | - * @param $oldName |
153 | | - * @param $newName |
| 152 | + * @param $oldName string |
| 153 | + * @param $newName string |
154 | 154 | * @return bool |
155 | 155 | */ |
156 | 156 | function asAddRenameUserHook( $uid, $oldName, $newName ) { |
Index: trunk/extensions/AntiSpoof/SpoofUser.php |
— | — | @@ -1,6 +1,10 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | 4 | class SpoofUser { |
| 5 | + |
| 6 | + /** |
| 7 | + * @param $name string |
| 8 | + */ |
5 | 9 | public function __construct( $name ) { |
6 | 10 | $this->mName = strval( $name ); |
7 | 11 | list( $ok, $normalized ) = AntiSpoof::checkUnicodeString( $this->mName ); |
— | — | @@ -24,6 +28,7 @@ |
25 | 29 | |
26 | 30 | /** |
27 | 31 | * Describe the error. |
| 32 | + * @return null|string |
28 | 33 | */ |
29 | 34 | public function getError() { |
30 | 35 | return $this->mError; |
— | — | @@ -31,6 +36,7 @@ |
32 | 37 | |
33 | 38 | /** |
34 | 39 | * Get the normalized key form |
| 40 | + * @return string|nuyll |
35 | 41 | */ |
36 | 42 | public function getNormalized() { |
37 | 43 | return $this->mNormalized; |
— | — | @@ -96,6 +102,9 @@ |
97 | 103 | return false; |
98 | 104 | } |
99 | 105 | $fields = array(); |
| 106 | + /** |
| 107 | + * @var $item SpoofUser |
| 108 | + */ |
100 | 109 | foreach ( $items as $item ) { |
101 | 110 | $fields[] = $item->insertFields(); |
102 | 111 | } |
— | — | @@ -112,7 +121,6 @@ |
113 | 122 | * @param $oldName |
114 | 123 | */ |
115 | 124 | public function update( $oldName ) { |
116 | | - |
117 | 125 | $dbw = wfGetDB( DB_MASTER ); |
118 | 126 | |
119 | 127 | if( $this->record() ) { |
Index: trunk/extensions/AntiSpoof/TestSpoof.php |
— | — | @@ -17,7 +17,7 @@ |
18 | 18 | require_once( dirname( __FILE__ ) . '/AntiSpoof_body.php' ); |
19 | 19 | |
20 | 20 | class TestSpoof extends PHPUnit_Framework_TestCase { |
21 | | - |
| 21 | + |
22 | 22 | public function providePositives() { |
23 | 23 | return array( |
24 | 24 | array( 'Laura Fiorucci', 'Låura Fiorucci' ), |
— | — | @@ -28,7 +28,7 @@ |
29 | 29 | array( 'BetoCG', 'ВетоС6' ) |
30 | 30 | ); |
31 | 31 | } |
32 | | - |
| 32 | + |
33 | 33 | /** |
34 | 34 | * @dataProvider providePositives |
35 | 35 | * See http://www.phpunit.de/manual/3.4/en/appendixes.annotations.html#appendixes.annotations.dataProvider |
— | — | @@ -36,7 +36,7 @@ |
37 | 37 | public function testCheckSpoofing( $userName, $spooferName ) { |
38 | 38 | $Alice = new SpoofUser( $userName ); |
39 | 39 | $Eve = new SpoofUser( $spooferName ); |
40 | | - |
| 40 | + |
41 | 41 | if ( $Eve->isLegal() ) { |
42 | 42 | $this->assertEquals( $Alice->getNormalized(), $Eve->getNormalized(), "Check that '$spooferName' can't spoof account '$userName'"); |
43 | 43 | } |