ConfirmSlotDirective::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 2
dl 0
loc 5
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace MaxBeckers\AmazonAlexa\Response\Directives\Dialog;
6
7
use MaxBeckers\AmazonAlexa\Intent\Intent;
8
use MaxBeckers\AmazonAlexa\Response\Directives\Directive;
9
10
class ConfirmSlotDirective extends Directive
11
{
12
    public const TYPE = 'Dialog.ConfirmSlot';
13
14 2
    public function __construct(
15
        public ?string $slotToConfirm = null,
16
        public ?Intent $updatedIntent = null
17
    ) {
18 2
        parent::__construct(self::TYPE);
19
    }
20
21 2
    public static function create(string $slotToConfirm, ?Intent $intent = null): self
22
    {
23 2
        return new self($slotToConfirm, $intent);
24
    }
25
}
26