Passed
Pull Request — master (#62)
by Romain
02:05
created

PassThreadControl   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 50
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getNewOwnerAppId() 0 4 1
A getMetadata() 0 4 1
A create() 0 4 1
1
<?php
2
3
namespace Kerox\Messenger\Model\Callback;
4
5
class PassThreadControl
6
{
7
    /**
8
     * @var string
9
     */
10
    protected $newOwnerAppId;
11
12
    /**
13
     * @var string
14
     */
15
    protected $metadata;
16
17
    /**
18
     * TakeThreadControl constructor.
19
     *
20
     * @param string $newOwnerAppId
21
     * @param string $metadata
22
     */
23 2
    public function __construct(string $newOwnerAppId, string $metadata)
24
    {
25 2
        $this->newOwnerAppId = $newOwnerAppId;
26 2
        $this->metadata = $metadata;
27 2
    }
28
29
    /**
30
     * @return string
31
     */
32 1
    public function getNewOwnerAppId(): string
33
    {
34 1
        return $this->newOwnerAppId;
35
    }
36
37
    /**
38
     * @return string
39
     */
40 1
    public function getMetadata(): string
41
    {
42 1
        return $this->metadata;
43
    }
44
45
    /**
46
     * @param array $payload
47
     *
48
     * @return \Kerox\Messenger\Model\Callback\PassThreadControl
49
     */
50 2
    public static function create(array $payload): PassThreadControl
51
    {
52 2
        return new static($payload['new_owner_app_id'], $payload['metadata']);
53
    }
54
}
55