OutputSpeech   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A createByText() 0 3 1
A createBySsml() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace MaxBeckers\AmazonAlexa\Response;
6
7
class OutputSpeech
8
{
9
    public const TYPE_PLAINTEXT = 'PlainText';
10
    public const TYPE_SSML = 'SSML';
11
12 7
    public function __construct(
13
        public string $type = self::TYPE_PLAINTEXT,
14
        public ?string $text = null,
15
        public ?string $ssml = null
16
    ) {
17 7
    }
18
19 3
    public static function createByText(string $text): self
20
    {
21 3
        return new self(text: $text);
22
    }
23
24 3
    public static function createBySsml(string $ssml): self
25
    {
26 3
        return new self(self::TYPE_SSML, ssml: $ssml);
27
    }
28
}
29