Identity::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
c 1
b 0
f 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Pheature\Model\Toggle;
6
7
use Pheature\Core\Toggle\Read\ConsumerIdentity;
8
9
final class Identity implements ConsumerIdentity
10
{
11
    private string $id;
12
    /**
13
     * @var array<string, mixed>
14
     */
15
    private array $payload;
16
17
    /**
18
     * Identity constructor.
19
     *
20
     * @param string               $id
21
     * @param array<string, mixed> $payload
22
     */
23 10
    public function __construct(string $id, array $payload = [])
24
    {
25 10
        $this->id = $id;
26 10
        $this->payload = $payload;
27
    }
28
29 3
    public function id(): string
30
    {
31 3
        return $this->id;
32
    }
33
34
    /**
35
     * @return array<string, mixed>
36
     */
37 6
    public function payload(): array
38
    {
39 6
        return $this->payload;
40
    }
41
}
42