Passed
Push — master ( 8a7749...5c0d1f )
by Romain
39s queued 10s
created

RequestThreadControl   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
eloc 8
dl 0
loc 48
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0

4 Methods

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