Completed
Push — master ( 1773ec...17d687 )
by Robbie
19s
created

Method::getDetails()   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
namespace SilverStripe\MFA\Tests\Stub\BasicMath;
3
4
use SilverStripe\Dev\TestOnly;
5
use SilverStripe\MFA\Method\Handler\LoginHandlerInterface;
6
use SilverStripe\MFA\Method\Handler\RegisterHandlerInterface;
7
use SilverStripe\MFA\Method\MethodInterface;
8
use SilverStripe\MFA\State\AvailableMethodDetails;
9
10
class Method implements MethodInterface, TestOnly
11
{
12
    /**
13
     * Get a URL segment for this method. This will be used in URL paths for performing authentication by this method
14
     *
15
     * @return string
16
     */
17
    public function getURLSegment()
18
    {
19
        return 'basic-math';
20
    }
21
22
    /**
23
     * Return the LoginHandler that is used to start and verify login attempts with this method
24
     *
25
     * @return LoginHandlerInterface
26
     */
27
    public function getLoginHandler()
28
    {
29
        return new MethodLoginHandler();
30
    }
31
32
    /**
33
     * Return the RegisterHandler that is used to perform registrations with this method
34
     *
35
     * @return RegisterHandlerInterface
36
     */
37
    public function getRegisterHandler()
38
    {
39
        return new MethodRegisterHandler();
40
    }
41
42
    public function getDetails()
43
    {
44
        return new AvailableMethodDetails($this);
45
    }
46
}
47