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

Change subject: build: Test phpcs via composer and make pass
......................................................................


build: Test phpcs via composer and make pass

Change-Id: I2fd6073000a561602d8db733525b5bf5aa0bd52f
---
M PronunciationRecording.alias.php
M PronunciationRecording.php
M SpecialPronunciationRecording.php
M composer.json
4 files changed, 60 insertions(+), 22 deletions(-)

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



diff --git a/PronunciationRecording.alias.php b/PronunciationRecording.alias.php
index 67611b4..1da567f 100644
--- a/PronunciationRecording.alias.php
+++ b/PronunciationRecording.alias.php
@@ -13,6 +13,6 @@
  * @author Rahul Maliakkal
  */
 $specialPageAliases[ 'en' ] = array(
-        'PronunciationRecording' => array( 'PronunciationRecording', 
'Pronunciation Recording' ),
+       'PronunciationRecording' => array( 'PronunciationRecording', 
'Pronunciation Recording' ),
 );
 
diff --git a/PronunciationRecording.php b/PronunciationRecording.php
index 05993b2..cce6134 100644
--- a/PronunciationRecording.php
+++ b/PronunciationRecording.php
@@ -16,10 +16,13 @@
 );
 
 $wgMessagesDirs['PronunciationRecording'] = __DIR__ . '/i18n';
-$wgExtensionMessagesFiles[ 'PronunciationRecording' ] = __DIR__ . 
'/PronunciationRecording.i18n.php';
-$wgExtensionMessagesFiles[ 'PronunciationRecordingAlias' ] = __DIR__ . 
'/PronunciationRecording.alias.php';
+$wgExtensionMessagesFiles[ 'PronunciationRecording' ] = __DIR__ .
+       '/PronunciationRecording.i18n.php';
+$wgExtensionMessagesFiles[ 'PronunciationRecordingAlias' ] = __DIR__ .
+       '/PronunciationRecording.alias.php';
 $wgSpecialPages[ 'PronunciationRecording' ] = 'SpecialPronunciationRecording';
-$wgAutoloadClasses[ 'SpecialPronunciationRecording' ] = __DIR__ . 
'/SpecialPronunciationRecording.php';
+$wgAutoloadClasses[ 'SpecialPronunciationRecording' ] = __DIR__ .
+       '/SpecialPronunciationRecording.php';
 
 $pronunciationRecordingModuleInfo = array(
        'localBasePath' => __DIR__ . '/resources',
@@ -30,7 +33,7 @@
 
 //"mediawiki.libs.recorderjs" is loaded as WebWorker.
 $wgResourceModules['mediawiki.libs.recorderjs'] = array(
-        'scripts' => '/mediawiki.libs.recorderjs/recorder.js',
+       'scripts' => '/mediawiki.libs.recorderjs/recorder.js',
 ) + $pronunciationRecordingModuleInfo;
 
 $wgResourceModules['ext.pronunciationRecording.pronunciationRecorder'] = array(
diff --git a/SpecialPronunciationRecording.php 
b/SpecialPronunciationRecording.php
index 456dfab..3eb6778 100644
--- a/SpecialPronunciationRecording.php
+++ b/SpecialPronunciationRecording.php
@@ -23,24 +23,49 @@
                        $output->addModules( 
'ext.pronunciationRecording.specialPage' );
                        $output->addHTML( '<div 
class="mw-pronunciationrecording-message" ></div>' );
                        $output->addHTML( '<div 
class="mw-pronunciationrecording-toolbar" >' );
-                       $output->addHTML( '<button 
class="mw-pronunciationrecording-record" disabled >' .wfMessage( 
'pronunciationrecording-toolbar-record-label' )->escaped().'</button>' );
-                       $output->addHTML( '<button 
class="mw-pronunciationrecording-stop" disabled >' .wfMessage( 
'pronunciationrecording-toolbar-stop-label' )->escaped().'</button>' );
-                       $output->addHTML( '<button 
class="mw-pronunciationrecording-clear" disabled >' .wfMessage( 
'pronunciationrecording-toolbar-clear-label' )->escaped().'</button>' );
+                       $output->addHTML( '<button 
class="mw-pronunciationrecording-record" disabled >' .
+                               wfMessage( 
'pronunciationrecording-toolbar-record-label' )->escaped()
+                               . '</button>' );
+                       $output->addHTML( '<button 
class="mw-pronunciationrecording-stop" disabled >' .
+                               wfMessage( 
'pronunciationrecording-toolbar-stop-label' )->escaped()
+                               . '</button>' );
+                       $output->addHTML( '<button 
class="mw-pronunciationrecording-clear" disabled >'
+                               . wfMessage( 
'pronunciationrecording-toolbar-clear-label' )->escaped()
+                               . '</button>' );
                        $output->addHTML( '<div 
class="mw-pronunciationrecording-preview-div" ></div>' );
                        $output->addHTML( '</div>' );
                        $output->addHTML( '<form>' );
                        $output->addHTML( '<fieldset>' );
-                       $output->addHTML( '<legend>'.wfMessage( 
'pronunciationrecording-information-label' )->escaped().'</legend>' );
-                       $output->addHTML( '<b>'.wfMessage( 
'pronunciationrecording-information-word-label' )->escaped().'</b><input 
type="text" class="mw-pronunciationrecording-information-word"><br><br>' );
+                       $output->addHTML( '<legend>'
+                               . wfMessage( 
'pronunciationrecording-information-label' )->escaped()
+                               . '</legend>' );
+                       $output->addHTML( '<b>'
+                               . wfMessage( 
'pronunciationrecording-information-word-label' )->escaped()
+                               . '</b><input type="text" 
class="mw-pronunciationrecording-information-word"><br><br>' );
                        $languages = Language::fetchLanguageNames( null, 'mw' );
-                       $output->addHTML( '<b>'.wfMessage( 
'pronunciationrecording-information-language-label' )->escaped().'</b><select 
class="mw-pronunciationrecording-information-language">' );
-                       foreach( $languages as $lang_code => $lang_name) {
-                               $output->addHTML( Html::element( 'option', 
array( 'value' => $lang_code ) , $lang_code.' - '.$lang_name ) );
+                       $output->addHTML( '<b>'
+                               . wfMessage( 
'pronunciationrecording-information-language-label' )->escaped()
+                               . '</b><select 
class="mw-pronunciationrecording-information-language">' );
+                       foreach ( $languages as $lang_code => $lang_name ) {
+                               $output->addHTML( Html::element(
+                                       'option',
+                                       array( 'value' => $lang_code ),
+                                       $lang_code.' - '.$lang_name )
+                               );
                        }
                        $output->addHTML( '</select>' );
-                       $output->addHTML( '<br><br>'.wfMessage( 
'pronunciationrecording-information-license-prompt', $user )->escaped() );
-                       $output->addHTML( '<div 
class="mw-pronunciationrecording-information-license-cc-by-sa" >'.wfMessage( 
'mwe-upwiz-source-ownwork-assert-cc-by-sa-3.0', 1, $user, 
'http://creativecommons.org/licenses/by-sa/3.0/deed.en'  )->parse().'<br>' );
-                       $output->addHTML( wfMessage( 
'mwe-upwiz-source-ownwork-cc-by-sa-3.0-explain', 1 )->escaped().'<br></div>' );
+                       $output->addHTML( '<br><br>'
+                               . wfMessage( 
'pronunciationrecording-information-license-prompt', $user )->escaped() );
+                       $output->addHTML( '<div 
class="mw-pronunciationrecording-information-license-cc-by-sa" >'
+                               . wfMessage(
+                                       
'mwe-upwiz-source-ownwork-assert-cc-by-sa-3.0',
+                                       1,
+                                       $user,
+                                       
'http://creativecommons.org/licenses/by-sa/3.0/deed.en'
+                               )->parse() . '<br>' );
+                       $output->addHTML(
+                               wfMessage( 
'mwe-upwiz-source-ownwork-cc-by-sa-3.0-explain', 1 )->escaped()
+                               . '<br></div>' );
                        $output->addHTML( '</fieldset>' );
                        $output->addHTML( '</form>' );
                }
@@ -80,17 +105,26 @@
                        $output = $this->getOutput();
 
                        if ( !$user->isAllowed( 'upload' ) ) {
-                               if ( !$user->isLoggedIn() && ( 
$wgGroupPermissions['user']['upload']|| 
$wgGroupPermissions['autoconfirmed']['upload'] ) ) {
+                               if (
+                                       !$user->isLoggedIn() &&
+                                       (
+                                               
$wgGroupPermissions['user']['upload'] ||
+                                               
$wgGroupPermissions['autoconfirmed']['upload']
+                                       )
+                               ) {
                                        // Custom message if logged-in users 
without any special rights can     upload
                                        $pronunciationRecordingPageName = 
$this->getPageTitle()->getPrefixedDBkey();
                                        $returnTo = array( 'returnto' => 
$pronunciationRecordingPageName );
                                        $loginTitle = SpecialPage::getTitleFor( 
'UserLogin' );
                                        $loginURL = $loginTitle->getFullURL( 
$returnTo );
-                                       $anonMsgHtml = $this->msg( 
'pronunciationrecording-specialpage-error-nologin', $loginURL )->parse();
+                                       $anonMsgHtml = $this->msg(
+                                                       
'pronunciationrecording-specialpage-error-nologin',
+                                                       $loginURL
+                                               )->parse();
                                        $output->addHTML( Html::rawElement( 
'span', array( 'class' => 'plainlinks' ), $anonMsgHtml ) );
                                        return;
                                } else {
-                                       throw new  PermissionsError( 'upload' );
+                                       throw new PermissionsError( 'upload' );
                                }
                                return false;
                        }
@@ -104,4 +138,3 @@
                        return true;
                }
        }
-
diff --git a/composer.json b/composer.json
index f2883f7..263ca10 100644
--- a/composer.json
+++ b/composer.json
@@ -1,10 +1,12 @@
 {
        "require-dev": {
-               "jakub-onderka/php-parallel-lint": "0.9"
+               "jakub-onderka/php-parallel-lint": "0.9",
+               "mediawiki/mediawiki-codesniffer": "0.3.0"
        },
        "scripts": {
                "test": [
-                       "parallel-lint . --exclude vendor"
+                       "parallel-lint . --exclude vendor",
+                       "phpcs 
--standard=vendor/mediawiki/mediawiki-codesniffer/MediaWiki 
--extensions=php,php5,inc --ignore=vendor -p ."
                ]
        }
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2fd6073000a561602d8db733525b5bf5aa0bd52f
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/PronunciationRecording
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: Mattflaschen <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to