Passed
Pull Request — master (#93)
by Romain
02:36
created

RequestThreadControl::getMetadata()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
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
    public function __construct(string $requestedOwnerAppId, string $metadata)
26
    {
27
        $this->requestedOwnerAppId = $requestedOwnerAppId;
28
        $this->metadata = $metadata;
29
    }
30
31
    /**
32
     * @return string
33
     */
34
    public function getRequestedOwnerAppId(): string
35
    {
36
        return $this->requestedOwnerAppId;
37
    }
38
39
    /**
40
     * @return string
41
     */
42
    public function getMetadata(): string
43
    {
44
        return $this->metadata;
45
    }
46
47
    /**
48
     * @param array $callbackData
49
     *
50
     * @return \Kerox\Messenger\Model\Callback\RequestThreadControl
51
     */
52
    public static function create(array $callbackData): self
53
    {
54
        return new self($callbackData['requested_owner_app_id'], $callbackData['metadata']);
55
    }
56
}
57