Completed
Push — master ( 7abd40...aad03f )
by Guy
21s queued 11s
created

AvailableMethodDetails::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\State;
4
5
use SilverStripe\MFA\Method\MethodInterface;
6
7
class AvailableMethodDetails implements AvailableMethodDetailsInterface
8
{
9
    /**
10
     * @var MethodInterface
11
     */
12
    private $method;
13
14
    /**
15
     * @param MethodInterface $method
16
     */
17
    public function __construct(MethodInterface $method)
18
    {
19
        $this->method = $method;
20
    }
21
22
    public function jsonSerialize()
23
    {
24
        return [
25
            'urlSegment' => $this->method->getURLSegment(),
26
            'name' => $this->method->getRegisterHandler()->getName(),
27
            'description' => $this->method->getRegisterHandler()->getDescription(),
28
            'supportLink' => $this->method->getRegisterHandler()->getSupportLink(),
29
            'thumbnail' => $this->method->getThumbnail(),
30
            'component' => $this->method->getRegisterHandler()->getComponent(),
31
            'isAvailable' => $this->method->isAvailable(),
32
            'unavailableMessage' => $this->method->getUnavailableMessage(),
33
        ];
34
    }
35
}
36