Extension::jsonSerialize()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 6
ccs 5
cts 5
cp 1
crap 1
rs 10
c 1
b 0
f 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace MaxBeckers\AmazonAlexa\Response\Directives\APL\Document;
6
7
class Extension implements \JsonSerializable
8
{
9 8
    public function __construct(
10
        public string $name,
11
        public string $uri,
12
        public bool $required = false,
13
    ) {
14 8
    }
15
16 4
    public function jsonSerialize(): array
17
    {
18 4
        return [
19 4
            'name' => $this->name,
20 4
            'uri' => $this->uri,
21 4
            'required' => $this->required,
22 4
        ];
23
    }
24
}
25