From 5ce5092621f355c7663c5bb2e2d25eb8e6b375cf Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Fri, 9 May 2014 21:54:07 +0200 Subject: [PATCH] Pass phpcs-strict on includes/site/ Change-Id: Ibc3f29e21dd5bcfd5ea641a58f8d3f641948741d --- includes/site/MediaWikiSite.php | 28 ++++++++++++++++------------ includes/site/Site.php | 22 +++++++++++++--------- includes/site/SiteList.php | 5 ++--- includes/site/SiteSQLStore.php | 7 ++++--- 4 files changed, 35 insertions(+), 27 deletions(-) diff --git a/includes/site/MediaWikiSite.php b/includes/site/MediaWikiSite.php index 2a86b31edf..4854bcba66 100644 --- a/includes/site/MediaWikiSite.php +++ b/includes/site/MediaWikiSite.php @@ -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; } - } diff --git a/includes/site/Site.php b/includes/site/Site.php index 59230c71f5..e3559f5059 100644 --- a/includes/site/Site.php +++ b/includes/site/Site.php @@ -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 { +} diff --git a/includes/site/SiteList.php b/includes/site/SiteList.php index 69924500ca..dfe4ec5e0d 100644 --- a/includes/site/SiteList.php +++ b/includes/site/SiteList.php @@ -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 { +} diff --git a/includes/site/SiteSQLStore.php b/includes/site/SiteSQLStore.php index d14569a1c3..f382d9880c 100644 --- a/includes/site/SiteSQLStore.php +++ b/includes/site/SiteSQLStore.php @@ -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 ); } - } -- 2.20.1