Failed Conditions
Push — newinternal ( b66232...216d62 )
by Simon
16:33 queued 06:35
created

includes/Pages/UserAuth/Login/PageOtpLogin.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
/******************************************************************************
3
 * Wikipedia Account Creation Assistance tool                                 *
4
 *                                                                            *
5
 * All code in this file is released into the public domain by the ACC        *
6
 * Development Team. Please see team.json for a list of contributors.         *
7
 ******************************************************************************/
8
9
namespace Waca\Pages\UserAuth\Login;
10
11
use Waca\Exceptions\ApplicationLogicException;
12
use Waca\WebRequest;
13
14
class PageOtpLogin extends LoginCredentialPageBase
15
{
16
    protected function providerSpecificSetup()
17
    {
18
        $this->setTemplate('login/otp.tpl');
19
    }
20
21 View Code Duplication
    protected function getProviderCredentials()
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
22
    {
23
        $otp = WebRequest::postString("otp");
24
        if ($otp === null || $otp === "") {
25
            throw new ApplicationLogicException("No one-time code specified");
26
        }
27
28
        return $otp;
29
    }
30
}