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

RequestThreadControl::getRequestedOwnerAppId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 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