jenkins-bot has submitted this change and it was merged. Change subject: Run PHPCS from composer ......................................................................
Run PHPCS from composer Bug: T90943 Signed-off-by: Antoine Musso <[email protected]> Change-Id: I843d2a95ee638f80e83869e13ebb7ebe6381d1dd --- M .gitignore M CldrCurrencies.php M LocalNames/LocalNamesBe_tarask.php M LocalNames/LocalNamesEn.php M LocalNames/LocalNamesFa.php M LocalNames/LocalNamesJa.php M LocalNames/LocalNamesNds.php M LocalNames/LocalNamesSh.php M composer.json A phpcs.xml M rebuild.php 11 files changed, 40 insertions(+), 10 deletions(-) Approvals: Hashar: Looks good to me, approved jenkins-bot: Verified diff --git a/.gitignore b/.gitignore index 9915909..e9fa978 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,9 @@ -.svn *~ *.kate-swp .*.swp .idea core core.zip -node_modules/ +/node_modules/ +/vendor/ +/composer.lock diff --git a/CldrCurrencies.php b/CldrCurrencies.php index d094ced..1eaec2c 100644 --- a/CldrCurrencies.php +++ b/CldrCurrencies.php @@ -17,7 +17,7 @@ */ private static function loadData( $data ) { - //bail if we already have it + // bail if we already have it if ( isset( self::$cache[$data] ) ) { return; } @@ -38,7 +38,7 @@ throw new Exception( "Invalid 'data' parameter:\$data in " . __METHOD__ ); } - //go get it + // go get it if ( file_exists( $filename ) ) { require_once $filename; } @@ -70,21 +70,21 @@ if ( !is_null( $country_code ) ) { $country_code = strtoupper( $country_code ); if ( $country_code === 'UK' ) { - $country_code = 'GB'; //dang iso overlap... + $country_code = 'GB'; // dang iso overlap... } } - //get the default (either the 'root' language, or the original ISO code) + // get the default (either the 'root' language, or the original ISO code) $default = $currency_code; if ( array_key_exists( 'root', self::$cache['symbols'][$currency_code] ) ) { $default = self::$cache['symbols'][$currency_code]['root']; } - //language code might or might not exist + // language code might or might not exist if ( array_key_exists( $language_code, self::$cache['symbols'][$currency_code] ) ) { if ( is_array( self::$cache['symbols'][$currency_code][$language_code] ) ) { - //did we specify a country? If not: Default. + // did we specify a country? If not: Default. if ( !is_null( $country_code ) && array_key_exists( $country_code, @@ -107,7 +107,7 @@ return $default; } } else { - //we have no idea what you were going for, so you can have your old code back. + // we have no idea what you were going for, so you can have your old code back. return $currency_code; } } @@ -124,7 +124,7 @@ self::loadData( 'locale' ); $country_code = strtoupper( $country_code ); if ( $country_code === 'UK' ) { - $country_code = 'GB'; //iso overlap again + $country_code = 'GB'; // iso overlap again } if ( array_key_exists( $country_code, self::$cache['locale'] ) ) { return self::$cache['locale'][$country_code]; diff --git a/LocalNames/LocalNamesBe_tarask.php b/LocalNames/LocalNamesBe_tarask.php index 30f7a9b..d7d9bb5 100644 --- a/LocalNames/LocalNamesBe_tarask.php +++ b/LocalNames/LocalNamesBe_tarask.php @@ -1,4 +1,5 @@ <?php + $languageNames = array( 'ab' => 'абхаская', 'af' => 'афрыкаанс', diff --git a/LocalNames/LocalNamesEn.php b/LocalNames/LocalNamesEn.php index 659db64..02f4cdf 100644 --- a/LocalNames/LocalNamesEn.php +++ b/LocalNames/LocalNamesEn.php @@ -1,4 +1,5 @@ <?php + $languageNames = array( /* Not in CLDR 27.0.1. Balochi language diff --git a/LocalNames/LocalNamesFa.php b/LocalNames/LocalNamesFa.php index 842c344..3f61420 100644 --- a/LocalNames/LocalNamesFa.php +++ b/LocalNames/LocalNamesFa.php @@ -1,4 +1,5 @@ <?php + $languageNames = array( /* Not in CLDR 27.0.1. Name Gheg Albanian used by Ethnologue: diff --git a/LocalNames/LocalNamesJa.php b/LocalNames/LocalNamesJa.php index a6b8984..776ace8 100644 --- a/LocalNames/LocalNamesJa.php +++ b/LocalNames/LocalNamesJa.php @@ -1,4 +1,5 @@ <?php + $languageNames = array( /* Not in CLDR 27.0.1. Balochi language diff --git a/LocalNames/LocalNamesNds.php b/LocalNames/LocalNamesNds.php index 9c10117..b30dc4f 100644 --- a/LocalNames/LocalNamesNds.php +++ b/LocalNames/LocalNamesNds.php @@ -1,4 +1,5 @@ <?php + $languageNames = array( 'aa' => 'Afar', 'ab' => 'Abchaasch', diff --git a/LocalNames/LocalNamesSh.php b/LocalNames/LocalNamesSh.php index 3c36ef8..cde72ac 100644 --- a/LocalNames/LocalNamesSh.php +++ b/LocalNames/LocalNamesSh.php @@ -1,4 +1,5 @@ <?php + $languageNames = array( 'aa' => 'Afarski', 'ab' => 'Abkazijski', diff --git a/composer.json b/composer.json index 78114a1..db97123 100644 --- a/composer.json +++ b/composer.json @@ -6,5 +6,15 @@ "license": "GPL-2.0", "require": { "composer/installers": ">=1.0.1" + }, + "require-dev": { + "jakub-onderka/php-parallel-lint": "0.9", + "mediawiki/mediawiki-codesniffer": "0.4.0" + }, + "scripts": { + "test": [ + "parallel-lint . --exclude node_modules --exclude vendor", + "phpcs -p -s" + ] } } diff --git a/phpcs.xml b/phpcs.xml new file mode 100644 index 0000000..c27128f --- /dev/null +++ b/phpcs.xml @@ -0,0 +1,11 @@ +<?xml version="1.0"?> +<ruleset> + <rule ref="vendor/mediawiki/mediawiki-codesniffer/MediaWiki"/> + <file>.</file> + <arg name="extensions" value="php,php5,inc"/> + <arg name="encoding" value="utf8"/> + <exclude-pattern>CldrNames</exclude-pattern> + <exclude-pattern>LocalNames</exclude-pattern> + <exclude-pattern>node_modules</exclude-pattern> + <exclude-pattern>vendor</exclude-pattern> +</ruleset> diff --git a/rebuild.php b/rebuild.php index 4f1e68a..2295e51 100644 --- a/rebuild.php +++ b/rebuild.php @@ -465,6 +465,7 @@ * @param $code string * @return string */ +// @codingStandardsIgnoreStart function getRealCode( $code ) { $realCode = $code; if ( !strcmp( $code, 'kk' ) ) @@ -486,6 +487,7 @@ return $realCode; } +// @codingStandardsIgnoreEnd $maintClass = 'CLDRRebuild'; require_once RUN_MAINTENANCE_IF_MAIN; -- To view, visit https://gerrit.wikimedia.org/r/254396 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I843d2a95ee638f80e83869e13ebb7ebe6381d1dd Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/cldr Gerrit-Branch: master Gerrit-Owner: Hashar <[email protected]> Gerrit-Reviewer: Hashar <[email protected]> Gerrit-Reviewer: Legoktm <[email protected]> Gerrit-Reviewer: Paladox <[email protected]> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
