jenkins-bot has submitted this change and it was merged.

Change subject: Run PHPCS from composer
......................................................................


Run PHPCS from composer

Bug: T90943
Change-Id: I843d2a95ee638f80e83869e13ebb7ebe6381d1dd
---
M SpecialNotifyTranslators.php
M TranslationNotifications.i18n.php
M TranslationNotifications.php
M composer.json
M maintenance/FixTranslationNotificationsEmptyLangPrefs.php
A phpcs.xml
M scripts/DigestEmailer.php
7 files changed, 23 insertions(+), 9 deletions(-)

Approvals:
  Hashar: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/SpecialNotifyTranslators.php b/SpecialNotifyTranslators.php
index 2f40f24..e488515 100644
--- a/SpecialNotifyTranslators.php
+++ b/SpecialNotifyTranslators.php
@@ -540,7 +540,7 @@
        protected function sendTranslationNotificationEmail( User $user,
                $languagesToNotify = array()
        ) {
-               global $wgNoReplyAddress, 
$wgTranslationNotificationsAlwaysHttpsInEmail;
+               global $wgNoReplyAddress;
 
                $relevantLanguages = $this->getRelevantLanguages( $user, 
$languagesToNotify );
                $userFirstLanguage = Language::factory( 
$this->getUserFirstLanguage( $user ) );
diff --git a/TranslationNotifications.i18n.php 
b/TranslationNotifications.i18n.php
index 463ac4f..1f9ebe8 100644
--- a/TranslationNotifications.i18n.php
+++ b/TranslationNotifications.i18n.php
@@ -10,6 +10,7 @@
  *
  * This shim maintains compatibility back to MediaWiki 1.17.
  */
+// @codingStandardsIgnoreFile
 $messages = array();
 if ( !function_exists( 'wfJsonI18nShim01e6b3b220993de8' ) ) {
        function wfJsonI18nShim01e6b3b220993de8( $cache, $code, &$cachedData ) {
diff --git a/TranslationNotifications.php b/TranslationNotifications.php
index 9d10ecb..24ac260 100644
--- a/TranslationNotifications.php
+++ b/TranslationNotifications.php
@@ -1,5 +1,8 @@
 <?php
-if ( !defined( 'MEDIAWIKI' ) ) die();
+if ( !defined( 'MEDIAWIKI' ) ) {
+       die();
+}
+
 /**
  * An extension to keep in touch with translators
  *
@@ -49,7 +52,7 @@
 $wgJobClasses['translationNotificationJob'] = 'TranslationNotificationJob';
 
 $resourcePaths = array(
-       'localBasePath' => dirname( __FILE__ ),
+       'localBasePath' => __DIR__,
        'remoteExtPath' => 'TranslationNotifications'
 );
 
diff --git a/composer.json b/composer.json
index 64bc1b7..e3d5ff5 100644
--- a/composer.json
+++ b/composer.json
@@ -9,11 +9,13 @@
                "mediawiki/translate": "dev-master"
        },
        "require-dev": {
-               "jakub-onderka/php-parallel-lint": "0.9"
+               "jakub-onderka/php-parallel-lint": "0.9",
+               "mediawiki/mediawiki-codesniffer": "0.5.0"
        },
        "scripts": {
                "test": [
-                       "parallel-lint . --exclude node_modules --exclude 
vendor --exclude extensions"
+                       "parallel-lint . --exclude node_modules --exclude 
vendor --exclude extensions",
+                       "phpcs -p -s"
                ]
        }
 }
diff --git a/maintenance/FixTranslationNotificationsEmptyLangPrefs.php 
b/maintenance/FixTranslationNotificationsEmptyLangPrefs.php
index 7a0d586..4e04877 100644
--- a/maintenance/FixTranslationNotificationsEmptyLangPrefs.php
+++ b/maintenance/FixTranslationNotificationsEmptyLangPrefs.php
@@ -16,8 +16,7 @@
 if ( getenv( 'MW_INSTALL_PATH' ) !== false ) {
        $IP = getenv( 'MW_INSTALL_PATH' );
 } else {
-       $dir = dirname( __FILE__ );
-       $IP = "$dir/../../..";
+       $IP = __DIR__ . "/../../..";
 }
 require_once "$IP/maintenance/Maintenance.php";
 
diff --git a/phpcs.xml b/phpcs.xml
new file mode 100644
index 0000000..7bd0ee2
--- /dev/null
+++ b/phpcs.xml
@@ -0,0 +1,10 @@
+<?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>extensions</exclude-pattern>
+       <exclude-pattern>node_modules</exclude-pattern>
+       <exclude-pattern>vendor</exclude-pattern>
+</ruleset>
diff --git a/scripts/DigestEmailer.php b/scripts/DigestEmailer.php
index efb2b0b..9766e3c 100644
--- a/scripts/DigestEmailer.php
+++ b/scripts/DigestEmailer.php
@@ -12,8 +12,7 @@
 if ( getenv( 'MW_INSTALL_PATH' ) !== false ) {
        $IP = getenv( 'MW_INSTALL_PATH' );
 } else {
-       $dir = dirname( __FILE__ );
-       $IP = "$dir/../../..";
+       $IP = __DIR__ . "/../../..";
 }
 require_once "$IP/maintenance/Maintenance.php";
 

-- 
To view, visit https://gerrit.wikimedia.org/r/254392
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I843d2a95ee638f80e83869e13ebb7ebe6381d1dd
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TranslationNotifications
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: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to