Index: trunk/phase3/includes/parser/ParserOutput.php |
— | — | @@ -26,9 +26,8 @@ |
27 | 27 | * setCacheTime() sets the timestamp expressing when the page has been rendered. |
28 | 28 | * This doesn not control expiry, see updateCacheExpiry() for that! |
29 | 29 | */ |
30 | | - function setCacheTime( $t ) { return wfSetVar( $this->mCacheTime, $t ); } |
| 30 | + function setCacheTime( $t ) { return wfSetVar( $this->mCacheTime, $t ); } |
31 | 31 | |
32 | | - |
33 | 32 | /** |
34 | 33 | * Sets the number of seconds after which this object should expire. |
35 | 34 | * This value is used with the ParserCache. |
— | — | @@ -40,12 +39,14 @@ |
41 | 40 | function updateCacheExpiry( $seconds ) { |
42 | 41 | $seconds = (int)$seconds; |
43 | 42 | |
44 | | - if ( $this->mCacheExpiry === null || $this->mCacheExpiry > $seconds ) |
45 | | - $this->mCacheExpiry = $seconds; |
| 43 | + if ( $this->mCacheExpiry === null || $this->mCacheExpiry > $seconds ) { |
| 44 | + $this->mCacheExpiry = $seconds; |
| 45 | + } |
46 | 46 | |
47 | 47 | // hack: set old-style marker for uncacheable entries. |
48 | | - if ( $this->mCacheExpiry !== null && $this->mCacheExpiry <= 0 ) |
| 48 | + if ( $this->mCacheExpiry !== null && $this->mCacheExpiry <= 0 ) { |
49 | 49 | $this->mCacheTime = -1; |
| 50 | + } |
50 | 51 | } |
51 | 52 | |
52 | 53 | /** |
— | — | @@ -59,28 +60,36 @@ |
60 | 61 | function getCacheExpiry() { |
61 | 62 | global $wgParserCacheExpireTime; |
62 | 63 | |
63 | | - if ( $this->mCacheTime < 0 ) return 0; // old-style marker for "not cachable" |
| 64 | + if ( $this->mCacheTime < 0 ) { |
| 65 | + return 0; |
| 66 | + } // old-style marker for "not cachable" |
64 | 67 | |
65 | 68 | $expire = $this->mCacheExpiry; |
66 | 69 | |
67 | | - if ( $expire === null ) |
| 70 | + if ( $expire === null ) { |
68 | 71 | $expire = $wgParserCacheExpireTime; |
69 | | - else |
| 72 | + } else { |
70 | 73 | $expire = min( $expire, $wgParserCacheExpireTime ); |
| 74 | + } |
71 | 75 | |
72 | 76 | if( $this->containsOldMagic() ) { //compatibility hack |
73 | 77 | $expire = min( $expire, 3600 ); # 1 hour |
74 | 78 | } |
75 | 79 | |
76 | | - if ( $expire <= 0 ) return 0; // not cachable |
77 | | - else return $expire; |
| 80 | + if ( $expire <= 0 ) { |
| 81 | + return 0; // not cachable |
| 82 | + } else { |
| 83 | + return $expire; |
| 84 | + } |
78 | 85 | } |
79 | 86 | |
80 | | - |
| 87 | + /** |
| 88 | + * @return bool |
| 89 | + */ |
81 | 90 | function isCacheable() { |
82 | 91 | return $this->getCacheExpiry() > 0; |
83 | 92 | } |
84 | | - |
| 93 | + |
85 | 94 | /** |
86 | 95 | * Return true if this cached output object predates the global or |
87 | 96 | * per-article cache invalidation timestamps, or if it comes from |
Index: trunk/phase3/includes/parser/Preprocessor.php |
— | — | @@ -9,7 +9,11 @@ |
10 | 10 | * @ingroup Parser |
11 | 11 | */ |
12 | 12 | interface Preprocessor { |
13 | | - /** Create a new preprocessor object based on an initialised Parser object */ |
| 13 | + /** |
| 14 | + * Create a new preprocessor object based on an initialised Parser object |
| 15 | + * |
| 16 | + * @param $parser Parser |
| 17 | + */ |
14 | 18 | function __construct( $parser ); |
15 | 19 | |
16 | 20 | /** |
— | — | @@ -28,12 +32,19 @@ |
29 | 33 | */ |
30 | 34 | function newCustomFrame( $args ); |
31 | 35 | |
32 | | - /** Create a new custom node for programmatic use of parameter replacement as used in some extensions */ |
| 36 | + /** |
| 37 | + * Create a new custom node for programmatic use of parameter replacement as used in some extensions |
| 38 | + * |
| 39 | + * @param $values |
| 40 | + */ |
33 | 41 | function newPartNodeArray( $values ); |
34 | 42 | |
35 | 43 | /** |
36 | 44 | * Preprocess text to a PPNode |
37 | 45 | * |
| 46 | + * @param $text |
| 47 | + * @param $flags |
| 48 | + * |
38 | 49 | * @return PPNode |
39 | 50 | */ |
40 | 51 | function preprocessToObj( $text, $flags = 0 ); |
— | — | @@ -54,6 +65,9 @@ |
55 | 66 | /** |
56 | 67 | * Create a child frame |
57 | 68 | * |
| 69 | + * @param $args array |
| 70 | + * @param $title Title |
| 71 | + * |
58 | 72 | * @return PPFrame |
59 | 73 | */ |
60 | 74 | function newChild( $args = false, $title = false ); |
— | — | @@ -86,6 +100,8 @@ |
87 | 101 | |
88 | 102 | /** |
89 | 103 | * Returns true if there are no arguments in this frame |
| 104 | + * |
| 105 | + * @return bool |
90 | 106 | */ |
91 | 107 | function isEmpty(); |
92 | 108 | |
— | — | @@ -111,6 +127,8 @@ |
112 | 128 | |
113 | 129 | /** |
114 | 130 | * Returns true if the infinite loop check is OK, false if a loop is detected |
| 131 | + * |
| 132 | + * @return bool |
115 | 133 | */ |
116 | 134 | function loopCheck( $title ); |
117 | 135 | |
Index: trunk/phase3/includes/db/LBFactory_Single.php |
— | — | @@ -15,6 +15,8 @@ |
16 | 16 | } |
17 | 17 | |
18 | 18 | /** |
| 19 | + * @param $wiki |
| 20 | + * |
19 | 21 | * @return LoadBalancer_Single |
20 | 22 | */ |
21 | 23 | function newMainLB( $wiki = false ) { |
— | — | @@ -22,6 +24,8 @@ |
23 | 25 | } |
24 | 26 | |
25 | 27 | /** |
| 28 | + * @param $wiki |
| 29 | + * |
26 | 30 | * @return LoadBalancer_Single |
27 | 31 | */ |
28 | 32 | function getMainLB( $wiki = false ) { |
— | — | @@ -29,6 +33,9 @@ |
30 | 34 | } |
31 | 35 | |
32 | 36 | /** |
| 37 | + * @param $cluster |
| 38 | + * @param $wiki |
| 39 | + * |
33 | 40 | * @return LoadBalancer_Single |
34 | 41 | */ |
35 | 42 | function newExternalLB( $cluster, $wiki = false ) { |
— | — | @@ -36,12 +43,19 @@ |
37 | 44 | } |
38 | 45 | |
39 | 46 | /** |
| 47 | + * @param $cluster |
| 48 | + * @param $wiki |
| 49 | + * |
40 | 50 | * @return LoadBalancer_Single |
41 | 51 | */ |
42 | 52 | function &getExternalLB( $cluster, $wiki = false ) { |
43 | 53 | return $this->lb; |
44 | 54 | } |
45 | 55 | |
| 56 | + /** |
| 57 | + * @param $callback string|array |
| 58 | + * @param $params array |
| 59 | + */ |
46 | 60 | function forEachLB( $callback, $params = array() ) { |
47 | 61 | call_user_func_array( $callback, array_merge( array( $this->lb ), $params ) ); |
48 | 62 | } |
— | — | @@ -57,6 +71,9 @@ |
58 | 72 | */ |
59 | 73 | var $db; |
60 | 74 | |
| 75 | + /** |
| 76 | + * @param $params array |
| 77 | + */ |
61 | 78 | function __construct( $params ) { |
62 | 79 | $this->db = $params['connection']; |
63 | 80 | parent::__construct( array( 'servers' => array( array( |
Index: trunk/phase3/includes/filerepo/ForeignDBFile.php |
— | — | @@ -12,6 +12,13 @@ |
13 | 13 | * @ingroup FileRepo |
14 | 14 | */ |
15 | 15 | class ForeignDBFile extends LocalFile { |
| 16 | + |
| 17 | + /** |
| 18 | + * @param $title |
| 19 | + * @param $repo |
| 20 | + * @param $unused |
| 21 | + * @return ForeignDBFile |
| 22 | + */ |
16 | 23 | static function newFromTitle( $title, $repo, $unused = null ) { |
17 | 24 | return new self( $title, $repo ); |
18 | 25 | } |
— | — | @@ -19,6 +26,11 @@ |
20 | 27 | /** |
21 | 28 | * Create a ForeignDBFile from a title |
22 | 29 | * Do not call this except from inside a repo class. |
| 30 | + * |
| 31 | + * @param $row |
| 32 | + * @param $repo |
| 33 | + * |
| 34 | + * @return ForeignDBFile |
23 | 35 | */ |
24 | 36 | static function newFromRow( $row, $repo ) { |
25 | 37 | $title = Title::makeTitle( NS_FILE, $row->img_name ); |
— | — | @@ -35,21 +47,30 @@ |
36 | 48 | $watch = false, $timestamp = false ) { |
37 | 49 | $this->readOnlyError(); |
38 | 50 | } |
| 51 | + |
39 | 52 | function restore( $versions = array(), $unsuppress = false ) { |
40 | 53 | $this->readOnlyError(); |
41 | 54 | } |
| 55 | + |
42 | 56 | function delete( $reason, $suppress = false ) { |
43 | 57 | $this->readOnlyError(); |
44 | 58 | } |
| 59 | + |
45 | 60 | function move( $target ) { |
46 | 61 | $this->readOnlyError(); |
47 | 62 | } |
48 | | - |
| 63 | + |
| 64 | + /** |
| 65 | + * @return string |
| 66 | + */ |
49 | 67 | function getDescriptionUrl() { |
50 | 68 | // Restore remote behaviour |
51 | 69 | return File::getDescriptionUrl(); |
52 | 70 | } |
53 | 71 | |
| 72 | + /** |
| 73 | + * @return string |
| 74 | + */ |
54 | 75 | function getDescriptionText() { |
55 | 76 | // Restore remote behaviour |
56 | 77 | return File::getDescriptionText(); |
Index: trunk/phase3/includes/HTMLForm.php |
— | — | @@ -861,7 +861,7 @@ |
862 | 862 | |
863 | 863 | /** |
864 | 864 | * Initialise the object |
865 | | - * @param $params Associative Array. See HTMLForm doc for syntax. |
| 865 | + * @param $params array Associative Array. See HTMLForm doc for syntax. |
866 | 866 | */ |
867 | 867 | function __construct( $params ) { |
868 | 868 | $this->mParams = $params; |
Index: trunk/phase3/includes/Cdb_PHP.php |
— | — | @@ -16,6 +16,10 @@ |
17 | 17 | /** |
18 | 18 | * Take a modulo of a signed integer as if it were an unsigned integer. |
19 | 19 | * $b must be less than 0x40000000 and greater than 0 |
| 20 | + * |
| 21 | + * @param $a |
| 22 | + * @param $b |
| 23 | + * |
20 | 24 | * @return int |
21 | 25 | */ |
22 | 26 | public static function unsignedMod( $a, $b ) { |
— | — | @@ -48,6 +52,7 @@ |
49 | 53 | * The CDB hash function. |
50 | 54 | * |
51 | 55 | * @param $s |
| 56 | + * |
52 | 57 | * @return |
53 | 58 | */ |
54 | 59 | public static function hash( $s ) { |
— | — | @@ -116,6 +121,10 @@ |
117 | 122 | unset( $this->handle ); |
118 | 123 | } |
119 | 124 | |
| 125 | + /** |
| 126 | + * @param $key |
| 127 | + * @return bool|string |
| 128 | + */ |
120 | 129 | public function get( $key ) { |
121 | 130 | // strval is required |
122 | 131 | if ( $this->find( strval( $key ) ) ) { |
— | — | @@ -327,6 +336,11 @@ |
328 | 337 | $this->pos = $newpos; |
329 | 338 | } |
330 | 339 | |
| 340 | + /** |
| 341 | + * @param $keylen |
| 342 | + * @param $datalen |
| 343 | + * @param $h |
| 344 | + */ |
331 | 345 | protected function addend( $keylen, $datalen, $h ) { |
332 | 346 | $this->hplist[] = array( |
333 | 347 | 'h' => $h, |
— | — | @@ -355,6 +369,9 @@ |
356 | 370 | $this->write( $buf ); |
357 | 371 | } |
358 | 372 | |
| 373 | + /** |
| 374 | + * @throws MWException |
| 375 | + */ |
359 | 376 | protected function finish() { |
360 | 377 | // Hack for DBA cross-check |
361 | 378 | $this->hplist = array_reverse( $this->hplist ); |
Index: trunk/phase3/includes/media/Tiff.php |
— | — | @@ -17,6 +17,8 @@ |
18 | 18 | * Conversion to PNG for inline display can be disabled here... |
19 | 19 | * Note scaling should work with ImageMagick, but may not with GD scaling. |
20 | 20 | * |
| 21 | + * @param $file |
| 22 | + * |
21 | 23 | * @return bool |
22 | 24 | */ |
23 | 25 | function canRender( $file ) { |
— | — | @@ -28,6 +30,8 @@ |
29 | 31 | * Browsers don't support TIFF inline generally... |
30 | 32 | * For inline display, we need to convert to PNG. |
31 | 33 | * |
| 34 | + * @param $file |
| 35 | + * |
32 | 36 | * @return bool |
33 | 37 | */ |
34 | 38 | function mustRender( $file ) { |
— | — | @@ -35,9 +39,9 @@ |
36 | 40 | } |
37 | 41 | |
38 | 42 | /** |
39 | | - * @param $ext |
40 | | - * @param $mime |
41 | | - * @param null $params |
| 43 | + * @param $ext |
| 44 | + * @param $mime |
| 45 | + * @param $params |
42 | 46 | * @return bool |
43 | 47 | */ |
44 | 48 | function getThumbType( $ext, $mime, $params = null ) { |
Index: trunk/phase3/includes/HistoryBlob.php |
— | — | @@ -290,6 +290,8 @@ |
291 | 291 | /** |
292 | 292 | * Sets the location (cur_id) of the main object to which this object |
293 | 293 | * points |
| 294 | + * |
| 295 | + * @param $id int |
294 | 296 | */ |
295 | 297 | function setLocation( $id ) { |
296 | 298 | $this->mCurId = $id; |
— | — | @@ -482,6 +484,11 @@ |
483 | 485 | } |
484 | 486 | } |
485 | 487 | |
| 488 | + /** |
| 489 | + * @param $t1 |
| 490 | + * @param $t2 |
| 491 | + * @return string |
| 492 | + */ |
486 | 493 | function diff( $t1, $t2 ) { |
487 | 494 | # Need to do a null concatenation with warnings off, due to bugs in the current version of xdiff |
488 | 495 | # "String is not zero-terminated" |
— | — | @@ -491,6 +498,11 @@ |
492 | 499 | return $diff; |
493 | 500 | } |
494 | 501 | |
| 502 | + /** |
| 503 | + * @param $base |
| 504 | + * @param $diff |
| 505 | + * @return bool|string |
| 506 | + */ |
495 | 507 | function patch( $base, $diff ) { |
496 | 508 | if ( function_exists( 'xdiff_string_bpatch' ) ) { |
497 | 509 | wfSuppressWarnings(); |
— | — | @@ -561,6 +573,9 @@ |
562 | 574 | } |
563 | 575 | } |
564 | 576 | |
| 577 | + /** |
| 578 | + * @return array |
| 579 | + */ |
565 | 580 | function __sleep() { |
566 | 581 | $this->compress(); |
567 | 582 | if ( !count( $this->mItems ) ) { |
— | — | @@ -626,6 +641,8 @@ |
627 | 642 | /** |
628 | 643 | * Helper function for compression jobs |
629 | 644 | * Returns true until the object is "full" and ready to be committed |
| 645 | + * |
| 646 | + * @return bool |
630 | 647 | */ |
631 | 648 | function isHappy() { |
632 | 649 | return $this->mSize < $this->mMaxSize |