Passed
Pull Request — master (#3)
by Garion
01:42
created

MethodRegistrationHandler::getSupportLink()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace SilverStripe\MFA;
4
5
use SilverStripe\Control\HTTPRequest;
6
use SilverStripe\MFA\AuthenticationMethod\RegistrationHandlerInterface;
7
8
class MethodRegistrationHandler implements RegistrationHandlerInterface
9
{
10
    /**
11
     * Prepare to register this authentication method against a member by initialising state in session and generating
12
     * details to provide to a frontend React component
13
     *
14
     * @param SessionStore $store An object that hold session data (and the Member) that can be mutated
15
     * @return array Props to be passed to a front-end React component
16
     */
17
    public function start(SessionStore $store)
18
    {
19
        // stub
20
        return [];
21
    }
22
23
    /**
24
     * Confirm that the provided details are valid, and create a new AuthenticationMethod against the member.
25
     *
26
     * @param HTTPRequest $request
27
     * @param SessionStore $store
28
     * @return bool
29
     */
30
    public function register(HTTPRequest $request, SessionStore $store)
31
    {
32
        // stub
33
        return true;
34
    }
35
36
    /**
37
     * Provide a string (possibly passed through i18n) that names this registration method.
38
     *
39
     * eg. "Authenticator app"
40
     *
41
     * @return string
42
     */
43
    public function getName()
44
    {
45
        return 'Basic math test';
46
    }
47
48
    /**
49
     * Provide a string (possibly passed through i18n) that describes this method.
50
     *
51
     * eg. "Verification codes are created by an app on your phone"
52
     *
53
     * @return string
54
     */
55
    public function getDescription()
56
    {
57
        return 'Asks you to add numbers together';
58
    }
59
60
    /**
61
     * Provide a URL to a support article about this registration method.
62
     *
63
     * @return string
64
     */
65
    public function getSupportLink()
66
    {
67
        return 'https://google.com';
68
    }
69
}
70