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

Change subject: Fix CI errors + code review issues
......................................................................


Fix CI errors + code review issues

Change-Id: Ie20b8bf2de5cb6ee56099318212f036cfd7ac91c
---
D README.md
M includes/EmailAuthSecondaryAuthenticationProvider.php
M includes/Hooks.php
M tests/phpunit/EmailAuthSecondaryAuthenticationProviderTest.php
4 files changed, 7 insertions(+), 26 deletions(-)

Approvals:
  Gergő Tisza: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/README.md b/README.md
deleted file mode 100644
index c973562..0000000
--- a/README.md
+++ /dev/null
@@ -1,20 +0,0 @@
-This is a blank extension template. It doesn't really do anything on its own.
-It is intended to provide a boiler template for an actual MediaWiki extension.
-
-If you are checking this out from Git and intend to use it, you may use the
-following commands to make a clean directory of just this template without the
-Git meta-data and other examples.
-
-       cd extensions
-       git clone 
https://gerrit.wikimedia.org/r/p/mediawiki/extensions/BoilerPlate.git
-       cp -R BoilerPlate ./MyExtension
-
-This automates the recommended code checkers for PHP and JavaScript code in 
Wikimedia projects
-(see https://www.mediawiki.org/wiki/Continuous_integration/Entry_points).
-To take advantage of this automation.
-  # install nodejs, npm, and PHP composer
-  # change to the extension's directory
-  # npm install
-  # composer install
-
-Once set up, running `npm test` and `composer test` will run automated code 
checks.
diff --git a/includes/EmailAuthSecondaryAuthenticationProvider.php 
b/includes/EmailAuthSecondaryAuthenticationProvider.php
index 543266d..f3c55f1 100644
--- a/includes/EmailAuthSecondaryAuthenticationProvider.php
+++ b/includes/EmailAuthSecondaryAuthenticationProvider.php
@@ -54,7 +54,7 @@
                                'ip' => $user->getRequest()->getIP(),
                        ] );
                        return AuthenticationResponse::newPass();
-               } else if ( $req && $req->token ) {
+               } elseif ( $req && $req->token ) {
                        // do not log if the code is simply missing - 
accidental enter or confused bot
                        LoggerFactory::getInstance( 'EmailAuth' )->info( 
'Failed verification for {user}', [
                                'user' => $user->getName(),
diff --git a/includes/Hooks.php b/includes/Hooks.php
index 898075b..429d765 100644
--- a/includes/Hooks.php
+++ b/includes/Hooks.php
@@ -8,7 +8,9 @@
        public static function onAuthChangeFormFields(
                array $requests, array $fieldInfo, array &$formDescriptor, 
$action
        ) {
-               if ( AuthenticationRequest::getRequestByClass( $requests, 
EmailAuthAuthenticationRequest::class ) ) {
+               if ( AuthenticationRequest::getRequestByClass( $requests,
+                       EmailAuthAuthenticationRequest::class )
+               ) {
                        $formDescriptor['token'] += [
                                'size' => 6,
                                'autofocus' => true,
diff --git a/tests/phpunit/EmailAuthSecondaryAuthenticationProviderTest.php 
b/tests/phpunit/EmailAuthSecondaryAuthenticationProviderTest.php
index c687d1d..635376e 100644
--- a/tests/phpunit/EmailAuthSecondaryAuthenticationProviderTest.php
+++ b/tests/phpunit/EmailAuthSecondaryAuthenticationProviderTest.php
@@ -22,10 +22,11 @@
        /** @var LoggerInterface|PHPUnit_Framework_MockObject_MockObject */
        protected $logger;
 
-       public function setUp() {
+       protected function setUp() {
                parent::setUp();
 
-               $this->setTemporaryHook( 'EmailAuthRequireToken', function () 
{} );
+               $this->setTemporaryHook( 'EmailAuthRequireToken', function () {
+               } );
 
                $this->provider = new 
EmailAuthSecondaryAuthenticationProvider();
 
@@ -44,8 +45,6 @@
                                return $this->session->get( $key );
                        } );
                $this->provider->setManager( $this->manager );
-
-               return $this->provider;
        }
 
        public function testGetAuthenticationRequests() {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie20b8bf2de5cb6ee56099318212f036cfd7ac91c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/EmailAuth
Gerrit-Branch: master
Gerrit-Owner: Gergő Tisza <gti...@wikimedia.org>
Gerrit-Reviewer: Gergő Tisza <gti...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to