Pass phpcs-strict on includes/site/
authorSiebrand Mazeland <siebrand@kitano.nl>
Fri, 9 May 2014 19:54:07 +0000 (21:54 +0200)
committerSiebrand Mazeland <siebrand@kitano.nl>
Fri, 9 May 2014 19:54:07 +0000 (21:54 +0200)
Change-Id: Ibc3f29e21dd5bcfd5ea641a58f8d3f641948741d

includes/site/MediaWikiSite.php
includes/site/Site.php
includes/site/SiteList.php
includes/site/SiteSQLStore.php

index 2a86b31..4854bcb 100644 (file)
@@ -33,7 +33,6 @@
  * @ingroup Site
  */
 class MediaWikiSite extends Site {
-
        const PATH_FILE = 'file_path';
        const PATH_PAGE = 'page_path';
 
@@ -76,14 +75,16 @@ class MediaWikiSite extends Site {
        }
 
        /**
-        * Returns the normalized form of the given page title, using the normalization rules of the given site.
-        * If the given title is a redirect, the redirect weill be resolved and the redirect target is returned.
+        * Returns the normalized form of the given page title, using the
+        * normalization rules of the given site. If the given title is a redirect,
+        * the redirect weill be resolved and the redirect target is returned.
         *
-        * @note  : This actually makes an API request to the remote site, so beware that this function is slow and depends
-        *          on an external service.
+        * @note This actually makes an API request to the remote site, so beware
+        *   that this function is slow and depends on an external service.
         *
-        * @note  : If MW_PHPUNIT_TEST is defined, the call to the external site is skipped, and the title
-        *          is normalized using the local normalization rules as implemented by the Title class.
+        * @note If MW_PHPUNIT_TEST is defined, the call to the external site is
+        *   skipped, and the title is normalized using the local normalization
+        *   rules as implemented by the Title class.
         *
         * @see Site::normalizePageName
         *
@@ -103,8 +104,10 @@ class MediaWikiSite extends Site {
 
                // Go on call the external site
                if ( defined( 'MW_PHPUNIT_TEST' ) ) {
-                       // If the code is under test, don't call out to other sites, just normalize locally.
-                       // Note: this may cause results to be inconsistent with the actual normalization used by the respective remote site!
+                       // If the code is under test, don't call out to other sites, just
+                       // normalize locally.
+                       // Note: this may cause results to be inconsistent with the actual
+                       // normalization used by the respective remote site!
 
                        $t = Title::newFromText( $pageName );
                        return $t->getPrefixedText();
@@ -152,12 +155,14 @@ class MediaWikiSite extends Site {
                $page = static::extractPageRecord( $data, $pageName );
 
                if ( isset( $page['missing'] ) ) {
-                       wfDebugLog( "MediaWikiSite", "call to <$url> returned a marker for a missing page title! " . $ret );
+                       wfDebugLog( "MediaWikiSite", "call to <$url> returned a marker for a missing page title! "
+                               . $ret );
                        return false;
                }
 
                if ( isset( $page['invalid'] ) ) {
-                       wfDebugLog( "MediaWikiSite", "call to <$url> returned a marker for an invalid page title! " . $ret );
+                       wfDebugLog( "MediaWikiSite", "call to <$url> returned a marker for an invalid page title! "
+                               . $ret );
                        return false;
                }
 
@@ -348,5 +353,4 @@ class MediaWikiSite extends Site {
 
                return $filePath;
        }
-
 }
index 59230c7..e3559f5 100644 (file)
@@ -27,7 +27,6 @@
  * @author Jeroen De Dauw < jeroendedauw@gmail.com >
  */
 class Site implements Serializable {
-
        const TYPE_UNKNOWN = 'unknown';
        const TYPE_MEDIAWIKI = 'mediawiki';
 
@@ -340,11 +339,12 @@ class Site implements Serializable {
        }
 
        /**
-        * Returns the main path type, that is the type of the path that should generally be used to construct links
-        * to the target site.
+        * Returns the main path type, that is the type of the path that should
+        * generally be used to construct links to the target site.
         *
-        * This default implementation returns Site::PATH_LINK as the default path type. Subclasses can override this
-        * to define a different default path type, or return false to disable site links.
+        * This default implementation returns Site::PATH_LINK as the default path
+        * type. Subclasses can override this to define a different default path
+        * type, or return false to disable site links.
         *
         * @since 1.21
         *
@@ -541,7 +541,9 @@ class Site implements Serializable {
         * @return string[]
         */
        public function getInterwikiIds() {
-               return array_key_exists( self::ID_INTERWIKI, $this->localIds ) ? $this->localIds[self::ID_INTERWIKI] : array();
+               return array_key_exists( self::ID_INTERWIKI, $this->localIds )
+                       ? $this->localIds[self::ID_INTERWIKI]
+                       : array();
        }
 
        /**
@@ -553,7 +555,9 @@ class Site implements Serializable {
         * @return string[]
         */
        public function getNavigationIds() {
-               return array_key_exists( self::ID_EQUIVALENT, $this->localIds ) ? $this->localIds[self::ID_EQUIVALENT] : array();
+               return array_key_exists( self::ID_EQUIVALENT, $this->localIds )
+                       ? $this->localIds[self::ID_EQUIVALENT] :
+                       array();
        }
 
        /**
@@ -693,10 +697,10 @@ class Site implements Serializable {
                $this->setForward( $fields['forward'] );
                $this->setInternalId( $fields['internalid'] );
        }
-
 }
 
 /**
  * @deprecated
  */
-class SiteObject extends Site {}
+class SiteObject extends Site {
+}
index 6992450..dfe4ec5 100644 (file)
@@ -27,7 +27,6 @@
  * @author Jeroen De Dauw < jeroendedauw@gmail.com >
  */
 class SiteList extends GenericArrayObject {
-
        /**
         * Internal site identifiers pointing to their sites offset value.
         *
@@ -350,10 +349,10 @@ class SiteList extends GenericArrayObject {
 
                return $serializationData;
        }
-
 }
 
 /**
  * @deprecated
  */
-class SiteArray extends SiteList {}
+class SiteArray extends SiteList {
+}
index d14569a..f382d98 100644 (file)
@@ -29,7 +29,6 @@
  * @author Jeroen De Dauw < jeroendedauw@gmail.com >
  */
 class SiteSQLStore implements SiteStore {
-
        /**
         * @since 1.21
         *
@@ -169,7 +168,10 @@ class SiteSQLStore implements SiteStore {
                }
 
                if ( $siteRow->hasField( 'language' ) ) {
-                       $site->setLanguageCode( $siteRow->getField( 'language' ) === '' ? null : $siteRow->getField( 'language' ) );
+                       $site->setLanguageCode( $siteRow->getField( 'language' ) === ''
+                               ? null
+                               : $siteRow->getField( 'language' )
+                       );
                }
 
                if ( $siteRow->hasField( 'source' ) ) {
@@ -504,5 +506,4 @@ class Sites extends SiteSQLStore {
        public function getSiteGroup( $group ) {
                return $this->getSites()->getGroup( $group );
        }
-
 }