Passed
Pull Request — master (#69)
by Guy
03:20
created

Method::applyRequirements()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 0
nc 1
nop 0
dl 0
loc 2
rs 10
c 0
b 0
f 0
1
<?php
2
namespace SilverStripe\MFA\Tests\Stub\BasicMath;
3
4
use SilverStripe\Core\Manifest\ModuleLoader;
5
use SilverStripe\Dev\TestOnly;
6
use SilverStripe\MFA\Method\Handler\LoginHandlerInterface;
7
use SilverStripe\MFA\Method\Handler\RegisterHandlerInterface;
8
use SilverStripe\MFA\Method\MethodInterface;
9
use SilverStripe\MFA\State\AvailableMethodDetails;
10
11
class Method implements MethodInterface, TestOnly
12
{
13
    /**
14
     * Get a URL segment for this method. This will be used in URL paths for performing authentication by this method
15
     *
16
     * @return string
17
     */
18
    public function getURLSegment()
19
    {
20
        return 'basic-math';
21
    }
22
23
    /**
24
     * Return the LoginHandler that is used to start and verify login attempts with this method
25
     *
26
     * @return LoginHandlerInterface
27
     */
28
    public function getLoginHandler()
29
    {
30
        return new MethodLoginHandler();
31
    }
32
33
    /**
34
     * Return the RegisterHandler that is used to perform registrations with this method
35
     *
36
     * @return RegisterHandlerInterface
37
     */
38
    public function getRegisterHandler()
39
    {
40
        return new MethodRegisterHandler();
41
    }
42
43
    public function getThumbnail()
44
    {
45
        return ModuleLoader::getModule('silverstripe/mfa')->getResource('client/dist/images/totp.svg')->getURL();
46
    }
47
48
    public function getDetails()
49
    {
50
        return new AvailableMethodDetails($this);
51
    }
52
53
    public function applyRequirements()
54
    {
55
        // This authenticator bundles client requirements in the main bundle.
56
    }
57
}
58