Completed
Branch develop (656ecc)
by Janusz
10:43 queued 06:18
created

TwoFactorTrait   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 5
dl 0
loc 35
rs 10
c 0
b 0
f 0

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
    public function getTwilioPhoneNumber(): ?string
14
    {
15
        return $this->twilioPhoneNumber;
16
    }
17
18
    public function setTwilioPhoneNumber(?string $twilioPhoneNumber)
19
    {
20
        $this->twilioPhoneNumber = $twilioPhoneNumber;
21
22
        return $this;
23
    }
24
25
    public function getTwilioPreferredMethod(): ?string
26
    {
27
        return $this->twilioPreferredMethod;
28
    }
29
30
    public function setTwilioPreferredMethod(?string $twilioPreferredMethod)
31
    {
32
        $this->twilioPreferredMethod = $twilioPreferredMethod;
33
34
        return $this;
35
    }
36
37
    public function isTwilioAuthEnabled(): bool
38
    {
39
        return $this->getTwilioPhoneNumber() !== null;
40
    }
41
}