Entity   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 5
c 1
b 0
f 1
dl 0
loc 20
ccs 7
cts 7
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A fromAmazonRequest() 0 6 1
A __construct() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace MaxBeckers\AmazonAlexa\Request;
6
7
class Entity
8
{
9
    /**
10
     * @param string|null $id Entity identifier
11
     * @param string|null $type Entity type
12
     * @param string|null $value Entity value
13
     */
14 3
    public function __construct(
15
        public ?string $id = null,
16
        public ?string $type = null,
17
        public ?string $value = null,
18
    ) {
19 3
    }
20
21 3
    public static function fromAmazonRequest(array $amazonRequest): self
22
    {
23 3
        return new self(
24 3
            id: $amazonRequest['id'] ?? null,
25 3
            type: $amazonRequest['type'] ?? null,
26 3
            value: $amazonRequest['value'] ?? null,
27 3
        );
28
    }
29
}
30