RequestThreadControl   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

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