OtpGenerationEvent   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 68
Duplicated Lines 0 %

Test Coverage

Coverage 85.71%

Importance

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

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getAddress() 0 3 1
A __construct() 0 5 1
A setOtp() 0 7 1
A getOtp() 0 3 1
A isModified() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Prozorov\DataVerification\Events;
6
7
use Prozorov\DataVerification\Types\Address;
8
9
class OtpGenerationEvent extends AbstractEvent
10
{
11
    /**
12
     * @var string $otp
13
     */
14
    protected $otp = '';
15
16
    /**
17
     * @var bool $isModified
18
     */
19
    protected $isModified = false;
20
21
    /**
22
     * @var Address $address
23
     */
24
    protected $address;
25
26 5
    public function __construct(string $name, Address $address)
27
    {
28 5
        parent::__construct($name);
29
30 5
        $this->address = $address;
31 5
    }
32
33
    /**
34
     * Get $otp
35
     *
36
     * @return  string
37
     */ 
38 1
    public function getOtp(): string
39
    {
40 1
        return $this->otp;
41
    }
42
43
    /**
44
     * Set $otp
45
     *
46
     * @param  string  $otp
47
     *
48
     * @return  self
49
     */ 
50 1
    public function setOtp(string $otp): OtpGenerationEvent
51
    {
52 1
        $this->otp = $otp;
53
54 1
        $this->isModified = true;
55
56 1
        return $this;
57
    }
58
59
    /**
60
     * Get $isModified
61
     *
62
     * @return  bool
63
     */ 
64 5
    public function isModified(): bool
65
    {
66 5
        return $this->isModified;
67
    }
68
69
    /**
70
     * Get $address
71
     *
72
     * @return  Address
73
     */ 
74
    public function getAddress(): Address
75
    {
76
        return $this->address;
77
    }
78
}
79