TwoFactorTrait   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 5
eloc 10
c 1
b 0
f 1
dl 0
loc 35
ccs 12
cts 12
cp 1
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getTwilioPhoneNumber() 0 3 1
A isTwilioAuthEnabled() 0 3 1
A getTwilioPreferredMethod() 0 3 1
A setTwilioPhoneNumber() 0 5 1
A setTwilioPreferredMethod() 0 5 1
1
<?php
2
3
namespace FlyingColours\TwilioTwoFactorBundle\Model\Twilio;
4
5
trait TwoFactorTrait
6
{
7
    /** @var string */
8
    protected $twilioPhoneNumber;
9
10
    /** @var string */
11
    protected $twilioPreferredMethod;
12
13 1
    public function getTwilioPhoneNumber(): ?string
14
    {
15 1
        return $this->twilioPhoneNumber;
16
    }
17
18 1
    public function setTwilioPhoneNumber(?string $twilioPhoneNumber)
19
    {
20 1
        $this->twilioPhoneNumber = $twilioPhoneNumber;
21
22 1
        return $this;
23
    }
24
25 1
    public function getTwilioPreferredMethod(): ?string
26
    {
27 1
        return $this->twilioPreferredMethod;
28
    }
29
30 1
    public function setTwilioPreferredMethod(?string $twilioPreferredMethod)
31
    {
32 1
        $this->twilioPreferredMethod = $twilioPreferredMethod;
33
34 1
        return $this;
35
    }
36
37 1
    public function isTwilioAuthEnabled(): bool
38
    {
39 1
        return $this->getTwilioPhoneNumber() !== null;
40
    }
41
}