| Total Complexity | 2 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class CanFulfillIntentResponse |
||
| 9 | { |
||
| 10 | const CAN_FULFILL_YES = 'YES'; |
||
| 11 | const CAN_FULFILL_MAYBE = 'MAYBE'; |
||
| 12 | const CAN_FULFILL_NO = 'NO'; |
||
| 13 | /** |
||
| 14 | * @var string|null |
||
| 15 | */ |
||
| 16 | public $canFulfill; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @var CanFulfillSlot[] |
||
| 20 | */ |
||
| 21 | public $slots = []; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @param string $canFulfill |
||
| 25 | * @param array $slots |
||
| 26 | * |
||
| 27 | * @return CanFulfillIntentResponse |
||
| 28 | */ |
||
| 29 | public static function create(string $canFulfill, array $slots = []): self |
||
| 30 | { |
||
| 31 | $canFulfillIntentResponse = new self(); |
||
| 32 | |||
| 33 | $canFulfillIntentResponse->canFulfill = $canFulfill; |
||
| 34 | $canFulfillIntentResponse->slots = $slots; |
||
| 35 | |||
| 36 | return $canFulfillIntentResponse; |
||
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @param string $slotName |
||
| 41 | * @param CanFulfillSlot $canFulfillSlot |
||
| 42 | */ |
||
| 43 | public function addSlot(string $slotName, CanFulfillSlot $canFulfillSlot) |
||
| 46 | } |
||
| 47 | } |
||
| 48 |