Update documentation and break long lines
authorSiebrand Mazeland <s.mazeland@xs4all.nl>
Wed, 20 Nov 2013 04:49:59 +0000 (05:49 +0100)
committerSiebrand Mazeland <s.mazeland@xs4all.nl>
Wed, 20 Nov 2013 05:02:37 +0000 (06:02 +0100)
Also remove some superfluous newlines.

Change-Id: I904d6ddeb976434708d5a22df9e8abd2e6f60a6c

includes/content/AbstractContent.php
includes/content/Content.php
includes/content/ContentHandler.php
includes/content/CssContentHandler.php
includes/content/JavaScriptContentHandler.php
includes/content/MessageContent.php
includes/content/TextContent.php
includes/content/TextContentHandler.php
includes/content/WikitextContent.php
includes/content/WikitextContentHandler.php

index 42d39fe..e1b1f01 100644 (file)
@@ -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
         *
index f43e88f..da49ced 100644 (file)
@@ -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()
         */
index c34ac31..d396570 100644 (file)
@@ -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
index cb5a349..7becabb 100644 (file)
@@ -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()
index 33fa917..064c422 100644 (file)
@@ -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()
index 59aca65..e780846 100644 (file)
@@ -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(
index d4a303c..d03d61e 100644 (file)
@@ -33,7 +33,6 @@
  * @ingroup Content
  */
 class TextContent extends AbstractContent {
-
        public function __construct( $text, $model_id = CONTENT_MODEL_TEXT ) {
                parent::__construct( $model_id );
 
index a6d8be8..c4584ae 100644 (file)
@@ -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 );
        }
 
index fb186e9..1f96bdc 100644 (file)
@@ -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() ) {
index b1b461f..1e8fd05 100644 (file)
@@ -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;
                }