Completed
Pull Request — master (#3)
by Romain
01:47
created

Optin::getRef()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
namespace Kerox\Messenger\Model\Callback;
3
4
class Optin
5
{
6
7
    /**
8
     * @var string
9
     */
10
    protected $ref;
11
12
    /**
13
     * Optin constructor.
14
     *
15
     * @param string $ref
16
     */
17
    public function __construct(string $ref)
18
    {
19
        $this->ref = $ref;
20
    }
21
22
    /**
23
     * @return string
24
     */
25
    public function getRef(): string
26
    {
27
        return $this->ref;
28
    }
29
30
    /**
31
     * @param array $payload
32
     * @return static
33
     */
34
    public static function create(array $payload)
35
    {
36
        return new static($payload['ref']);
37
    }
38
}
39