jenkins-bot has submitted this change and it was merged. Change subject: Style fixes in LanguageFallbackChain ......................................................................
Style fixes in LanguageFallbackChain Change-Id: I8318d544179e99724ac36c5495ca08b9e5eb4270 --- M lib/includes/LanguageFallbackChain.php 1 file changed, 6 insertions(+), 21 deletions(-) Approvals: Tobias Gritschacher: Looks good to me, approved jenkins-bot: Verified diff --git a/lib/includes/LanguageFallbackChain.php b/lib/includes/LanguageFallbackChain.php index a92c269..3d64cfa 100644 --- a/lib/includes/LanguageFallbackChain.php +++ b/lib/includes/LanguageFallbackChain.php @@ -1,25 +1,12 @@ <?php namespace Wikibase; + use \Language; /** - * Object representing a language fallback chain used in Wikibase. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * http://www.gnu.org/copyleft/gpl.html + * FIXME: this class is not a language fallback chain. It takes and uses a fallback chain. + * The name thus needs to be updated to not be misleading. * * @since 0.4 * @@ -68,14 +55,12 @@ foreach ( $this->chain as $languageWithConversion ) { $fetchCode = $languageWithConversion->getFetchLanguageCode(); - $sourceCode = $languageWithConversion->getSourceLanguageCode(); - $languageCode = $languageWithConversion->getLanguageCode(); if ( isset( $data[$fetchCode] ) ) { return array( 'value' => $languageWithConversion->translate( $data[$fetchCode] ), - 'language' => $languageCode, - 'source' => $sourceCode, + 'language' => $languageWithConversion->getLanguageCode(), + 'source' => $languageWithConversion->getSourceLanguageCode(), ); } } @@ -96,8 +81,8 @@ * ), or null when no data with a valid language code can be found. */ public function extractPreferredValueOrAny( $data ) { - $preferred = $this->extractPreferredValue( $data ); + if ( $preferred ) { return $preferred; } -- To view, visit https://gerrit.wikimedia.org/r/80382 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8318d544179e99724ac36c5495ca08b9e5eb4270 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Jeroen De Dauw <jeroended...@gmail.com> Gerrit-Reviewer: Tobias Gritschacher <tobias.gritschac...@wikimedia.de> Gerrit-Reviewer: jenkins-bot _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits