FacebookAuthenticator::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
class FacebookAuthenticator 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...
4
{
5
    public static function get_name()
6
    {
7
        if (Member::currentUser()) {
8
            return 'Facebook';
9
        } else {
10
            return 'Facebook';
11
        }
12
    }
13
14
    public static function get_login_form(Controller $controller)
15
    {
16
        return new FacebookLoginForm(
17
            $controller,
18
            'LoginForm'
19
        );
20
    }
21
22
23
    /**
24
     * Method to authenticate an user
25
     *
26
     * @param array $RAW_data Raw data to authenticate the user
27
     * @param Form $form Optional: If passed, better error messages can be
0 ignored issues
show
Documentation introduced by
Should the type for parameter $form not be null|Form?

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...
28
     *                             produced by using
29
     *                             {@link Form::sessionMessage()}
30
     * @return bool|Member Returns FALSE if authentication fails, otherwise
31
     *                     the member object
32
     */
33
    public static function authenticate($RAW_data, Form $form = null)
34
    {
35
        return singleton('FacebookCallback')->loginUser();
36
    }
37
}
38