Index: trunk/phase3/includes/SquidPurgeClient.php |
— | — | @@ -33,6 +33,8 @@ |
34 | 34 | /** |
35 | 35 | * Open a socket if there isn't one open already, return it. |
36 | 36 | * Returns false on error. |
| 37 | + * |
| 38 | + * @return false|resource |
37 | 39 | */ |
38 | 40 | protected function getSocket() { |
39 | 41 | if ( $this->socket !== null ) { |
— | — | @@ -64,6 +66,7 @@ |
65 | 67 | |
66 | 68 | /** |
67 | 69 | * Get read socket array for select() |
| 70 | + * @return array |
68 | 71 | */ |
69 | 72 | public function getReadSocketsForSelect() { |
70 | 73 | if ( $this->readState == 'idle' ) { |
— | — | @@ -78,6 +81,7 @@ |
79 | 82 | |
80 | 83 | /** |
81 | 84 | * Get write socket array for select() |
| 85 | + * @return array |
82 | 86 | */ |
83 | 87 | public function getWriteSocketsForSelect() { |
84 | 88 | if ( !strlen( $this->writeBuffer ) ) { |
— | — | @@ -225,6 +229,10 @@ |
226 | 230 | while ( $this->socket && $this->processReadBuffer() === 'continue' ); |
227 | 231 | } |
228 | 232 | |
| 233 | + /** |
| 234 | + * @throws MWException |
| 235 | + * @return string |
| 236 | + */ |
229 | 237 | protected function processReadBuffer() { |
230 | 238 | switch ( $this->readState ) { |
231 | 239 | case 'idle': |
— | — | @@ -264,6 +272,10 @@ |
265 | 273 | } |
266 | 274 | } |
267 | 275 | |
| 276 | + /** |
| 277 | + * @param $line |
| 278 | + * @return |
| 279 | + */ |
268 | 280 | protected function processStatusLine( $line ) { |
269 | 281 | if ( !preg_match( '!^HTTP/(\d+)\.(\d+) (\d{3}) (.*)$!', $line, $m ) ) { |
270 | 282 | $this->log( 'invalid status line' ); |
— | — | @@ -280,6 +292,9 @@ |
281 | 293 | $this->readState = 'header'; |
282 | 294 | } |
283 | 295 | |
| 296 | + /** |
| 297 | + * @param $line string |
| 298 | + */ |
284 | 299 | protected function processHeaderLine( $line ) { |
285 | 300 | if ( preg_match( '/^Content-Length: (\d+)$/i', $line, $m ) ) { |
286 | 301 | $this->bodyRemaining = intval( $m[1] ); |
Index: trunk/phase3/includes/RawPage.php |
— | — | @@ -223,6 +223,10 @@ |
224 | 224 | return $this->parseArticleText( $text ); |
225 | 225 | } |
226 | 226 | |
| 227 | + /** |
| 228 | + * @param $text |
| 229 | + * @return string |
| 230 | + */ |
227 | 231 | function parseArticleText( $text ) { |
228 | 232 | if( $text === '' ) { |
229 | 233 | return ''; |
Index: trunk/phase3/includes/MacBinary.php |
— | — | @@ -31,6 +31,8 @@ |
32 | 32 | $this->loadHeader(); |
33 | 33 | } |
34 | 34 | |
| 35 | + private $valid, $version, $filename, $dataLength, $resourceLength, $handle; |
| 36 | + |
35 | 37 | /** |
36 | 38 | * The file must be seekable, such as local filesystem. |
37 | 39 | * Remote URLs probably won't work. |
Index: trunk/phase3/includes/LogPage.php |
— | — | @@ -56,6 +56,9 @@ |
57 | 57 | $this->sendToUDP = ( $udp == 'UDP' ); |
58 | 58 | } |
59 | 59 | |
| 60 | + /** |
| 61 | + * @return bool|int|null |
| 62 | + */ |
60 | 63 | protected function saveContent() { |
61 | 64 | global $wgLogRestrictions; |
62 | 65 | |
Index: trunk/phase3/includes/StringUtils.php |
— | — | @@ -13,6 +13,13 @@ |
14 | 14 | * Compared to delimiterReplace(), this implementation is fast but memory- |
15 | 15 | * hungry and inflexible. The memory requirements are such that I don't |
16 | 16 | * recommend using it on anything but guaranteed small chunks of text. |
| 17 | + * |
| 18 | + * @param $startDelim |
| 19 | + * @param $endDelim |
| 20 | + * @param $replace |
| 21 | + * @param $subject |
| 22 | + * |
| 23 | + * @return string |
17 | 24 | */ |
18 | 25 | static function hungryDelimiterReplace( $startDelim, $endDelim, $replace, $subject ) { |
19 | 26 | $segments = explode( $startDelim, $subject ); |
— | — | @@ -36,17 +43,19 @@ |
37 | 44 | * This implementation is slower than hungryDelimiterReplace but uses far less |
38 | 45 | * memory. The delimiters are literal strings, not regular expressions. |
39 | 46 | * |
| 47 | + * If the start delimiter ends with an initial substring of the end delimiter, |
| 48 | + * e.g. in the case of C-style comments, the behaviour differs from the model |
| 49 | + * regex. In this implementation, the end must share no characters with the |
| 50 | + * start, so e.g. /*\/ is not considered to be both the start and end of a |
| 51 | + * comment. /*\/xy/*\/ is considered to be a single comment with contents /xy/. |
| 52 | + * |
40 | 53 | * @param $startDelim String: start delimiter |
41 | 54 | * @param $endDelim String: end delimiter |
42 | 55 | * @param $callback Callback: function to call on each match |
43 | 56 | * @param $subject String |
44 | 57 | * @param $flags String: regular expression flags |
| 58 | + * @return string |
45 | 59 | */ |
46 | | - # If the start delimiter ends with an initial substring of the end delimiter, |
47 | | - # e.g. in the case of C-style comments, the behaviour differs from the model |
48 | | - # regex. In this implementation, the end must share no characters with the |
49 | | - # start, so e.g. /*/ is not considered to be both the start and end of a |
50 | | - # comment. /*/xy/*/ is considered to be a single comment with contents /xy/. |
51 | 60 | static function delimiterReplaceCallback( $startDelim, $endDelim, $callback, $subject, $flags = '' ) { |
52 | 61 | $inputPos = 0; |
53 | 62 | $outputPos = 0; |
— | — | @@ -180,6 +189,9 @@ |
181 | 190 | /** |
182 | 191 | * Workalike for explode() with limited memory usage. |
183 | 192 | * Returns an Iterator |
| 193 | + * @param $separator |
| 194 | + * @param $subject |
| 195 | + * @return \ArrayIterator|\ExplodeIterator |
184 | 196 | */ |
185 | 197 | static function explode( $separator, $subject ) { |
186 | 198 | if ( substr_count( $subject, $separator ) > 1000 ) { |