From: Siebrand Mazeland Date: Wed, 20 Nov 2013 04:49:59 +0000 (+0100) Subject: Update documentation and break long lines X-Git-Tag: 1.31.0-rc.0~18010^2~1 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=5bec2e90d131efa804f0f3792f01d3183ad89a73;p=lhc%2Fweb%2Fwiklou.git Update documentation and break long lines Also remove some superfluous newlines. Change-Id: I904d6ddeb976434708d5a22df9e8abd2e6f60a6c --- diff --git a/includes/content/AbstractContent.php b/includes/content/AbstractContent.php index 42d39feedd..e1b1f01926 100644 --- a/includes/content/AbstractContent.php +++ b/includes/content/AbstractContent.php @@ -32,7 +32,6 @@ * @ingroup Content */ abstract class AbstractContent implements Content { - /** * Name of the content model this Content object represents. * Use with CONTENT_MODEL_XXX constants @@ -264,7 +263,7 @@ abstract class AbstractContent implements Content { break; } // Redirects to some special pages are not permitted - if ( $newtitle instanceOf Title && $newtitle->isValidRedirectTarget() ) { + if ( $newtitle instanceof Title && $newtitle->isValidRedirectTarget() ) { // The new title passes the checks, so make that our current // title so that further recursion can be checked $title = $newtitle; @@ -404,7 +403,8 @@ abstract class AbstractContent implements Content { } /** - * This default implementation always returns false. Subclasses may override this to supply matching logic. + * This default implementation always returns false. Subclasses may override + * this to supply matching logic. * * @see Content::matchMagicWord * diff --git a/includes/content/Content.php b/includes/content/Content.php index f43e88f60a..da49ced4ec 100644 --- a/includes/content/Content.php +++ b/includes/content/Content.php @@ -32,7 +32,6 @@ * @ingroup Content */ interface Content { - /** * @since 1.21 * @@ -363,7 +362,8 @@ interface Content { * * @param Title $target the new redirect target * - * @return Content a new Content object with the updated redirect (or $this if this Content object isn't a redirect) + * @return Content a new Content object with the updated redirect (or $this + * if this Content object isn't a redirect) */ public function updateRedirect( Title $target ); @@ -438,11 +438,11 @@ interface Content { * This may be used to check the content's consistency with global state. This function should * NOT write any information to the database. * - * Note that this method will usually be called inside the same transaction bracket that will be used - * to save the new revision. + * Note that this method will usually be called inside the same transaction + * bracket that will be used to save the new revision. * - * Note that this method is called before any update to the page table is performed. This means that - * $page may not yet know a page ID. + * Note that this method is called before any update to the page table is + * performed. This means that $page may not yet know a page ID. * * @since 1.21 * @@ -451,9 +451,9 @@ interface Content { * @param int $baseRevId the ID of the current revision * @param User $user * - * @return Status A status object indicating whether the content was successfully prepared for saving. - * If the returned status indicates an error, a rollback will be performed and the - * transaction aborted. + * @return Status A status object indicating whether the content was + * successfully prepared for saving. If the returned status indicates + * an error, a rollback will be performed and the transaction aborted. * * @see see WikiPage::doEditContent() */ diff --git a/includes/content/ContentHandler.php b/includes/content/ContentHandler.php index c34ac31031..d396570303 100644 --- a/includes/content/ContentHandler.php +++ b/includes/content/ContentHandler.php @@ -31,7 +31,6 @@ * @ingroup Content */ class MWContentSerializationException extends MWException { - } /** @@ -54,7 +53,6 @@ class MWContentSerializationException extends MWException { * @ingroup Content */ abstract class ContentHandler { - /** * Switch for enabling deprecation warnings. Used by ContentHandler::deprecated() * and ContentHandler::runLegacyHooks(). @@ -333,7 +331,8 @@ abstract class ContentHandler { $handler = new $class( $modelId ); if ( !( $handler instanceof ContentHandler ) ) { - throw new MWException( "$class from \$wgContentHandlers is not compatible with ContentHandler" ); + throw new MWException( "$class from \$wgContentHandlers is not " . + "compatible with ContentHandler" ); } } @@ -603,9 +602,11 @@ abstract class ContentHandler { /** * Get the language in which the content of the given page is written. * - * This default implementation just returns $wgContLang (except for pages in the MediaWiki namespace) + * This default implementation just returns $wgContLang (except for pages + * in the MediaWiki namespace) * - * Note that the pages language is not cacheable, since it may in some cases depend on user settings. + * Note that the pages language is not cacheable, since it may in some + * cases depend on user settings. * * Also note that the page language may or may not depend on the actual content of the page, * that is, this method may load the content in order to determine the language. @@ -1086,7 +1087,8 @@ abstract class ContentHandler { wfRestoreWarnings(); - wfWarn( "Using obsolete hook $event via ContentHandler::runLegacyHooks()! Handlers: " . implode( ', ', $handlerInfo ), 2 ); + wfWarn( "Using obsolete hook $event via ContentHandler::runLegacyHooks()! Handlers: " . + implode( ', ', $handlerInfo ), 2 ); } // convert Content objects to text diff --git a/includes/content/CssContentHandler.php b/includes/content/CssContentHandler.php index cb5a349d30..7becabb888 100644 --- a/includes/content/CssContentHandler.php +++ b/includes/content/CssContentHandler.php @@ -28,7 +28,6 @@ * @ingroup Content */ class CssContentHandler extends TextContentHandler { - public function __construct( $modelId = CONTENT_MODEL_CSS ) { parent::__construct( $modelId, array( CONTENT_FORMAT_CSS ) ); } @@ -46,6 +45,8 @@ class CssContentHandler extends TextContentHandler { /** * Returns the english language, because CSS is english, and should be handled as such. * + * @param Title $title + * @param Content $content * @return Language wfGetLangObj( 'en' ) * * @see ContentHandler::getPageLanguage() @@ -57,6 +58,8 @@ class CssContentHandler extends TextContentHandler { /** * Returns the english language, because CSS is english, and should be handled as such. * + * @param Title $title + * @param Content $content * @return Language wfGetLangObj( 'en' ) * * @see ContentHandler::getPageViewLanguage() diff --git a/includes/content/JavaScriptContentHandler.php b/includes/content/JavaScriptContentHandler.php index 33fa917213..064c422f85 100644 --- a/includes/content/JavaScriptContentHandler.php +++ b/includes/content/JavaScriptContentHandler.php @@ -28,7 +28,6 @@ * @todo make ScriptContentHandler base class, do highlighting stuff there? */ class JavaScriptContentHandler extends TextContentHandler { - public function __construct( $modelId = CONTENT_MODEL_JAVASCRIPT ) { parent::__construct( $modelId, array( CONTENT_FORMAT_JAVASCRIPT ) ); } @@ -46,6 +45,8 @@ class JavaScriptContentHandler extends TextContentHandler { /** * Returns the english language, because JS is english, and should be handled as such. * + * @param Title $title + * @param Content $content * @return Language wfGetLangObj( 'en' ) * * @see ContentHandler::getPageLanguage() @@ -57,6 +58,8 @@ class JavaScriptContentHandler extends TextContentHandler { /** * Returns the english language, because JS is english, and should be handled as such. * + * @param Title $title + * @param Content $content * @return Language wfGetLangObj( 'en' ) * * @see ContentHandler::getPageViewLanguage() diff --git a/includes/content/MessageContent.php b/includes/content/MessageContent.php index 59aca651b0..e780846cfa 100644 --- a/includes/content/MessageContent.php +++ b/includes/content/MessageContent.php @@ -34,7 +34,6 @@ * @ingroup Content */ class MessageContent extends AbstractContent { - /** * @var Message */ @@ -130,6 +129,7 @@ class MessageContent extends AbstractContent { /** * @see Content::isCountable * + * @param bool $hasLinks * @return bool false */ public function isCountable( $hasLinks = null ) { @@ -139,6 +139,10 @@ class MessageContent extends AbstractContent { /** * @see Content::getParserOutput * + * @param Title $title + * @param int $revId Optional revision ID + * @param ParserOptions $options + * @param bool $generateHtml Wether to generate HTML * @return ParserOutput */ public function getParserOutput( diff --git a/includes/content/TextContent.php b/includes/content/TextContent.php index d4a303cbb9..d03d61e913 100644 --- a/includes/content/TextContent.php +++ b/includes/content/TextContent.php @@ -33,7 +33,6 @@ * @ingroup Content */ class TextContent extends AbstractContent { - public function __construct( $text, $model_id = CONTENT_MODEL_TEXT ) { parent::__construct( $model_id ); diff --git a/includes/content/TextContentHandler.php b/includes/content/TextContentHandler.php index a6d8be8cca..c4584aed51 100644 --- a/includes/content/TextContentHandler.php +++ b/includes/content/TextContentHandler.php @@ -29,8 +29,9 @@ * @ingroup Content */ class TextContentHandler extends ContentHandler { - - public function __construct( $modelId = CONTENT_MODEL_TEXT, $formats = array( CONTENT_FORMAT_TEXT ) ) { + public function __construct( $modelId = CONTENT_MODEL_TEXT, + $formats = array( CONTENT_FORMAT_TEXT ) + ) { parent::__construct( $modelId, $formats ); } diff --git a/includes/content/WikitextContent.php b/includes/content/WikitextContent.php index fb186e949a..1f96bdca13 100644 --- a/includes/content/WikitextContent.php +++ b/includes/content/WikitextContent.php @@ -31,7 +31,6 @@ * @ingroup Content */ class WikitextContent extends TextContent { - public function __construct( $text ) { parent::__construct( $text, CONTENT_MODEL_WIKITEXT ); } @@ -196,7 +195,7 @@ class WikitextContent extends TextContent { } /** - * @see Content::updateRedirect() + * @see Content::updateRedirect() * * This implementation replaces the first link on the page with the given new target * if this Content object is a redirect. Otherwise, this method returns $this. @@ -205,7 +204,8 @@ class WikitextContent extends TextContent { * * @param Title $target * - * @return Content a new Content object with the updated redirect (or $this if this Content object isn't a redirect) + * @return Content a new Content object with the updated redirect (or $this + * if this Content object isn't a redirect) */ public function updateRedirect( Title $target ) { if ( !$this->isRedirect() ) { diff --git a/includes/content/WikitextContentHandler.php b/includes/content/WikitextContentHandler.php index b1b461fbd1..1e8fd05c1a 100644 --- a/includes/content/WikitextContentHandler.php +++ b/includes/content/WikitextContentHandler.php @@ -29,7 +29,6 @@ * @ingroup Content */ class WikitextContentHandler extends TextContentHandler { - public function __construct( $modelId = CONTENT_MODEL_WIKITEXT ) { parent::__construct( $modelId, array( CONTENT_FORMAT_WIKITEXT ) ); } @@ -72,7 +71,9 @@ class WikitextContentHandler extends TextContentHandler { } $mwRedir = MagicWord::get( 'redirect' ); - $redirectText = $mwRedir->getSynonym( 0 ) . ' [[' . $optionalColon . $destination->getFullText() . ']]'; + $redirectText = $mwRedir->getSynonym( 0 ) . + ' [[' . $optionalColon . $destination->getFullText() . ']]'; + if ( $text != '' ) { $redirectText .= "\n" . $text; }