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

Optin   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 35
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getRef() 0 4 1
A create() 0 4 1
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