Jackmcbarn has uploaded a new change for review. https://gerrit.wikimedia.org/r/221051
Change subject: Fix some PHPCS issues ...................................................................... Fix some PHPCS issues Change-Id: I6289ce362f8dfde7baf2b665f082820898844973 --- M includes/actions/InfoAction.php M includes/api/ApiFeedWatchlist.php M includes/api/ApiFormatPhp.php M includes/cache/MessageCache.php M includes/htmlform/HTMLTextAreaField.php M includes/htmlform/HTMLTextField.php M includes/libs/BufferingStatsdDataFactory.php M includes/libs/normal/UtfNormalUtil.php M includes/media/FormatMetadata.php M includes/parser/ParserCache.php M includes/poolcounter/PoolCounter.php M includes/profiler/output/ProfilerOutputDump.php M includes/title/MalformedTitleException.php 13 files changed, 28 insertions(+), 17 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/51/221051/1 diff --git a/includes/actions/InfoAction.php b/includes/actions/InfoAction.php index 203c687..bf86b51 100644 --- a/includes/actions/InfoAction.php +++ b/includes/actions/InfoAction.php @@ -448,7 +448,8 @@ } } $expiry = $title->getRestrictionExpiry( $restrictionType ); - $formattedexpiry = $this->msg( 'parentheses', $this->getLanguage()->formatExpiry( $expiry ) )->escaped(); + $formattedexpiry = $this->msg( 'parentheses', + $this->getLanguage()->formatExpiry( $expiry ) )->escaped(); $message .= $this->msg( 'word-separator' )->escaped() . $formattedexpiry; // Messages: restriction-edit, restriction-move, restriction-create, diff --git a/includes/api/ApiFeedWatchlist.php b/includes/api/ApiFeedWatchlist.php index d1beef8..853b138 100644 --- a/includes/api/ApiFeedWatchlist.php +++ b/includes/api/ApiFeedWatchlist.php @@ -126,7 +126,8 @@ $msg = wfMessage( 'watchlist' )->inContentLanguage()->text(); - $feedTitle = $this->getConfig()->get( 'Sitename' ) . ' - ' . $msg . ' [' . $this->getConfig()->get( 'LanguageCode' ) . ']'; + $feedTitle = $this->getConfig()->get( 'Sitename' ) . ' - ' . $msg . + ' [' . $this->getConfig()->get( 'LanguageCode' ) . ']'; $feedUrl = SpecialPage::getTitleFor( 'Watchlist' )->getFullURL(); $feed = new $feedClasses[$params['feedformat']] ( diff --git a/includes/api/ApiFormatPhp.php b/includes/api/ApiFormatPhp.php index d88dd40..6420a5b 100644 --- a/includes/api/ApiFormatPhp.php +++ b/includes/api/ApiFormatPhp.php @@ -68,7 +68,8 @@ preg_match( '/\<\s*cross-domain-policy\s*\>/i', $text ) ) { $this->dieUsage( - 'This response cannot be represented using format=php. See https://bugzilla.wikimedia.org/show_bug.cgi?id=66776', + 'This response cannot be represented using format=php. ' . + 'See https://bugzilla.wikimedia.org/show_bug.cgi?id=66776', 'internalerror' ); } diff --git a/includes/cache/MessageCache.php b/includes/cache/MessageCache.php index 79f4d6c..585fcd3 100644 --- a/includes/cache/MessageCache.php +++ b/includes/cache/MessageCache.php @@ -1113,7 +1113,8 @@ if ( !$title || !$title instanceof Title ) { global $wgTitle; - wfDebugLog( 'GlobalTitleFail', __METHOD__ . ' called by ' . wfGetAllCallers( 5 ) . ' with no title set.' ); + wfDebugLog( 'GlobalTitleFail', __METHOD__ . ' called by ' . + wfGetAllCallers( 5 ) . ' with no title set.' ); $title = $wgTitle; } // Sometimes $wgTitle isn't set either... diff --git a/includes/htmlform/HTMLTextAreaField.php b/includes/htmlform/HTMLTextAreaField.php index a4ed95f..e4f78b2 100644 --- a/includes/htmlform/HTMLTextAreaField.php +++ b/includes/htmlform/HTMLTextAreaField.php @@ -14,7 +14,7 @@ function getSpellCheck() { $val = isset( $this->mParams['spellcheck'] ) ? $this->mParams['spellcheck'] : null; - if( is_bool( $val ) ) { + if ( is_bool( $val ) ) { // "spellcheck" attribute literally requires "true" or "false" to work. return $val === true ? 'true' : 'false'; } diff --git a/includes/htmlform/HTMLTextField.php b/includes/htmlform/HTMLTextField.php index 06b397f..9c5b868 100644 --- a/includes/htmlform/HTMLTextField.php +++ b/includes/htmlform/HTMLTextField.php @@ -7,7 +7,7 @@ function getSpellCheck() { $val = isset( $this->mParams['spellcheck'] ) ? $this->mParams['spellcheck'] : null; - if( is_bool( $val ) ) { + if ( is_bool( $val ) ) { // "spellcheck" attribute literally requires "true" or "false" to work. return $val === true ? 'true' : 'false'; } diff --git a/includes/libs/BufferingStatsdDataFactory.php b/includes/libs/BufferingStatsdDataFactory.php index 457237a..0caf90b 100644 --- a/includes/libs/BufferingStatsdDataFactory.php +++ b/includes/libs/BufferingStatsdDataFactory.php @@ -23,7 +23,6 @@ use Liuggio\StatsdClient\Entity\StatsdDataInterface; use Liuggio\StatsdClient\Factory\StatsdDataFactory; - /** * A factory for application metric data. * diff --git a/includes/libs/normal/UtfNormalUtil.php b/includes/libs/normal/UtfNormalUtil.php index ad9a2b9..9ed9bc2 100644 --- a/includes/libs/normal/UtfNormalUtil.php +++ b/includes/libs/normal/UtfNormalUtil.php @@ -27,6 +27,7 @@ use UtfNormal\Utils; + /** * Return UTF-8 sequence for a given Unicode code point. * diff --git a/includes/media/FormatMetadata.php b/includes/media/FormatMetadata.php index 17e3dda..0fee8cc 100644 --- a/includes/media/FormatMetadata.php +++ b/includes/media/FormatMetadata.php @@ -1732,8 +1732,9 @@ } /** - * Turns an XMP-style multivalue array into a single value by dropping all but the first value. - * If the value is not a multivalue array (or a multivalue array inside a multilang array), it is returned unchanged. + * Turns an XMP-style multivalue array into a single value by dropping all but the first + * value. If the value is not a multivalue array (or a multivalue array inside a multilang + * array), it is returned unchanged. * See mediawiki.org/wiki/Manual:File_metadata_handling#Multi-language_array_format * @param mixed $value * @return mixed The value, or the first value if there were multiple ones @@ -1742,7 +1743,8 @@ protected function resolveMultivalueValue( $value ) { if ( !is_array( $value ) ) { return $value; - } elseif ( isset( $value['_type'] ) && $value['_type'] === 'lang' ) { // if this is a multilang array, process fields separately + } elseif ( isset( $value['_type'] ) && $value['_type'] === 'lang' ) { + // if this is a multilang array, process fields separately $newValue = array(); foreach ( $value as $k => $v ) { $newValue[$k] = $this->resolveMultivalueValue( $v ); diff --git a/includes/parser/ParserCache.php b/includes/parser/ParserCache.php index 117b6e7..44b0bc9 100644 --- a/includes/parser/ParserCache.php +++ b/includes/parser/ParserCache.php @@ -217,7 +217,6 @@ ? $article->getPage() : $article; - if ( !$useOutdated && $value->expired( $touched ) ) { wfIncrStats( "pcache.miss.expired" ); $cacheTime = $value->getCacheTime(); diff --git a/includes/poolcounter/PoolCounter.php b/includes/poolcounter/PoolCounter.php index 5692d73..1ec14aa 100644 --- a/includes/poolcounter/PoolCounter.php +++ b/includes/poolcounter/PoolCounter.php @@ -192,10 +192,11 @@ } /** - * Given a key (any string) and the number of lots, returns a slot number (an integer from the [0..($slots-1)] range). - * This is used for a global limit on the number of instances of a given type that can acquire a lock. - * The hashing is deterministic so that PoolCounter::$workers is always an upper limit of how many instances with - * the same key can acquire a lock. + * Given a key (any string) and the number of lots, returns a slot number (an integer from + * the [0..($slots-1)] range). This is used for a global limit on the number of instances of + * a given type that can acquire a lock. The hashing is deterministic so that + * PoolCounter::$workers is always an upper limit of how many instances with the same key + * can acquire a lock. * * @param string $key PoolCounter instance key (any string) * @param int $slots The number of slots (max allowed value is 65536) diff --git a/includes/profiler/output/ProfilerOutputDump.php b/includes/profiler/output/ProfilerOutputDump.php index bf4b85c2..09f5688 100644 --- a/includes/profiler/output/ProfilerOutputDump.php +++ b/includes/profiler/output/ProfilerOutputDump.php @@ -45,7 +45,11 @@ public function log( array $stats ) { $data = $this->collector->getRawData(); - $filename = sprintf( "%s/%s.%s%s", $this->params['outputDir'], uniqid(), $this->collector->getProfileID(), $this->suffix ); + $filename = sprintf( "%s/%s.%s%s", + $this->params['outputDir'], + uniqid(), + $this->collector->getProfileID(), + $this->suffix ); file_put_contents( $filename, serialize( $data ) ); } } diff --git a/includes/title/MalformedTitleException.php b/includes/title/MalformedTitleException.php index fb89e4f..0892ce4 100644 --- a/includes/title/MalformedTitleException.php +++ b/includes/title/MalformedTitleException.php @@ -30,7 +30,8 @@ /** * @param string $errorMessage Localisation message describing the error (since MW 1.26) * @param string $titleText The invalid title text (since MW 1.26) - * @param string[] $errorMessageParameters Additional parameters for the error message. $titleText will be appended if it's not null. (since MW 1.26) + * @param string[] $errorMessageParameters Additional parameters for the error message. + * $titleText will be appended if it's not null. (since MW 1.26) */ public function __construct( $errorMessage = null, $titleText = null, $errorMessageParameters = array() ) { $this->errorMessage = $errorMessage; -- To view, visit https://gerrit.wikimedia.org/r/221051 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6289ce362f8dfde7baf2b665f082820898844973 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Jackmcbarn <jackmcb...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits