MemberAuthenticatorWithSignup::get_name()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 0
1
<?php
2
/**
3
 * Authenticator for the default "member" method
4
 *
5
 * @author Markus Lanthaler <[email protected]>
6
 * @package sapphire
7
 * @subpackage security
8
 */
9
class MemberAuthenticatorWithSignup extends Authenticator
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
10
{
11
12
13
  /**
14
   * Method that creates the login form for this authentication method
15
   *
16
   * @param Controller The parent controller, necessary to create the
0 ignored issues
show
Documentation introduced by
Should the type for parameter $controller not be Controller?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
17
   *                   appropriate form action tag
18
   * @return Form Returns the login form to use with this authentication
19
   *              method
20
   */
21
  public static function get_login_form(Controller $controller)
22
  {
23
      return Object::create("MemberLoginFormWithSignup", $controller, "LoginForm");
24
  }
25
26
27
28
    /**
29
     * Get the name of the authentication method
30
     *
31
     * @return string Returns the name of the authentication method.
32
     */
33
    public static function get_name()
34
    {
35
        if (Member::currentUser()) {
36
            return _t('MemberAuthenticator.UPDATE', "Update your account details");
37
        } else {
38
            return _t('MemberAuthenticator.SIGNUP', "Signup with Email");
39
        }
40
    }
41
42
43
    public static function authenticate($RAW_data, Form $form = null)
44
    {
45
        return true;
46
    }
47
}
48