From: Sam Reed Date: Sat, 21 May 2011 19:54:24 +0000 (+0000) Subject: More documentation tweaks and updates X-Git-Tag: 1.31.0-rc.0~30028 X-Git-Url: https://git.heureux-cyclage.org/index.php?a=commitdiff_plain;h=12a9b1d2fb2960d44729b8ea30fa43ba14278399;p=lhc%2Fweb%2Fwiklou.git More documentation tweaks and updates --- diff --git a/includes/LogPage.php b/includes/LogPage.php index ee18d67e7a..184e76830f 100644 --- a/includes/LogPage.php +++ b/includes/LogPage.php @@ -56,6 +56,9 @@ class LogPage { $this->sendToUDP = ( $udp == 'UDP' ); } + /** + * @return bool|int|null + */ protected function saveContent() { global $wgLogRestrictions; diff --git a/includes/MacBinary.php b/includes/MacBinary.php index 6643c074e9..1605cc0b6e 100644 --- a/includes/MacBinary.php +++ b/includes/MacBinary.php @@ -31,6 +31,8 @@ class MacBinary { $this->loadHeader(); } + private $valid, $version, $filename, $dataLength, $resourceLength, $handle; + /** * The file must be seekable, such as local filesystem. * Remote URLs probably won't work. diff --git a/includes/RawPage.php b/includes/RawPage.php index c722c1c18d..5804bf9bcb 100644 --- a/includes/RawPage.php +++ b/includes/RawPage.php @@ -223,6 +223,10 @@ class RawPage { return $this->parseArticleText( $text ); } + /** + * @param $text + * @return string + */ function parseArticleText( $text ) { if( $text === '' ) { return ''; diff --git a/includes/SquidPurgeClient.php b/includes/SquidPurgeClient.php index 664f59a047..3de685781d 100644 --- a/includes/SquidPurgeClient.php +++ b/includes/SquidPurgeClient.php @@ -33,6 +33,8 @@ class SquidPurgeClient { /** * Open a socket if there isn't one open already, return it. * Returns false on error. + * + * @return false|resource */ protected function getSocket() { if ( $this->socket !== null ) { @@ -64,6 +66,7 @@ class SquidPurgeClient { /** * Get read socket array for select() + * @return array */ public function getReadSocketsForSelect() { if ( $this->readState == 'idle' ) { @@ -78,6 +81,7 @@ class SquidPurgeClient { /** * Get write socket array for select() + * @return array */ public function getWriteSocketsForSelect() { if ( !strlen( $this->writeBuffer ) ) { @@ -225,6 +229,10 @@ class SquidPurgeClient { while ( $this->socket && $this->processReadBuffer() === 'continue' ); } + /** + * @throws MWException + * @return string + */ protected function processReadBuffer() { switch ( $this->readState ) { case 'idle': @@ -264,6 +272,10 @@ class SquidPurgeClient { } } + /** + * @param $line + * @return + */ protected function processStatusLine( $line ) { if ( !preg_match( '!^HTTP/(\d+)\.(\d+) (\d{3}) (.*)$!', $line, $m ) ) { $this->log( 'invalid status line' ); @@ -280,6 +292,9 @@ class SquidPurgeClient { $this->readState = 'header'; } + /** + * @param $line string + */ protected function processHeaderLine( $line ) { if ( preg_match( '/^Content-Length: (\d+)$/i', $line, $m ) ) { $this->bodyRemaining = intval( $m[1] ); diff --git a/includes/StringUtils.php b/includes/StringUtils.php index c1e617a044..f405e616fe 100644 --- a/includes/StringUtils.php +++ b/includes/StringUtils.php @@ -13,6 +13,13 @@ class StringUtils { * Compared to delimiterReplace(), this implementation is fast but memory- * hungry and inflexible. The memory requirements are such that I don't * recommend using it on anything but guaranteed small chunks of text. + * + * @param $startDelim + * @param $endDelim + * @param $replace + * @param $subject + * + * @return string */ static function hungryDelimiterReplace( $startDelim, $endDelim, $replace, $subject ) { $segments = explode( $startDelim, $subject ); @@ -36,17 +43,19 @@ class StringUtils { * This implementation is slower than hungryDelimiterReplace but uses far less * memory. The delimiters are literal strings, not regular expressions. * + * If the start delimiter ends with an initial substring of the end delimiter, + * e.g. in the case of C-style comments, the behaviour differs from the model + * regex. In this implementation, the end must share no characters with the + * start, so e.g. /*\/ is not considered to be both the start and end of a + * comment. /*\/xy/*\/ is considered to be a single comment with contents /xy/. + * * @param $startDelim String: start delimiter * @param $endDelim String: end delimiter * @param $callback Callback: function to call on each match * @param $subject String * @param $flags String: regular expression flags + * @return string */ - # If the start delimiter ends with an initial substring of the end delimiter, - # e.g. in the case of C-style comments, the behaviour differs from the model - # regex. In this implementation, the end must share no characters with the - # start, so e.g. /*/ is not considered to be both the start and end of a - # comment. /*/xy/*/ is considered to be a single comment with contents /xy/. static function delimiterReplaceCallback( $startDelim, $endDelim, $callback, $subject, $flags = '' ) { $inputPos = 0; $outputPos = 0; @@ -180,6 +189,9 @@ class StringUtils { /** * Workalike for explode() with limited memory usage. * Returns an Iterator + * @param $separator + * @param $subject + * @return \ArrayIterator|\ExplodeIterator */ static function explode( $separator, $subject ) { if ( substr_count( $subject, $separator ) > 1000 ) {