@@ -1,53 +1,53 @@ |
||
| 1 | -<?php |
|
| 1 | + <?php |
|
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | + declare(strict_types=1); |
|
| 4 | 4 | |
| 5 | -namespace MaxBeckers\AmazonAlexa\Response\Directives\APL\Component; |
|
| 5 | + namespace MaxBeckers\AmazonAlexa\Response\Directives\APL\Component; |
|
| 6 | 6 | |
| 7 | -use MaxBeckers\AmazonAlexa\Response\Directives\APL\StandardCommand\AbstractStandardCommand; |
|
| 7 | + use MaxBeckers\AmazonAlexa\Response\Directives\APL\StandardCommand\AbstractStandardCommand; |
|
| 8 | 8 | |
| 9 | -class Action implements \JsonSerializable |
|
| 10 | -{ |
|
| 11 | - /** |
|
| 9 | + class Action implements \JsonSerializable |
|
| 10 | + { |
|
| 11 | + /** |
|
| 12 | 12 | * @param AbstractStandardCommand|null $command Single command to run |
| 13 | 13 | * @param AbstractStandardCommand[]|null $commands Array of commands to run |
| 14 | 14 | * @param bool $enabled Whether the action is enabled |
| 15 | 15 | * @param string|null $label Label for the action |
| 16 | 16 | * @param string|null $name Name of the action |
| 17 | 17 | */ |
| 18 | - public function __construct( |
|
| 19 | - public ?AbstractStandardCommand $command = null, |
|
| 20 | - public ?array $commands = null, |
|
| 21 | - public bool $enabled = true, |
|
| 22 | - public ?string $label = null, |
|
| 23 | - public ?string $name = null, |
|
| 24 | - ) { |
|
| 25 | - } |
|
| 26 | - |
|
| 27 | - public function jsonSerialize(): array |
|
| 28 | - { |
|
| 29 | - $data = []; |
|
| 30 | - |
|
| 31 | - if ($this->command !== null) { |
|
| 32 | - $data['command'] = $this->command; |
|
| 18 | + public function __construct( |
|
| 19 | + public ?AbstractStandardCommand $command = null, |
|
| 20 | + public ?array $commands = null, |
|
| 21 | + public bool $enabled = true, |
|
| 22 | + public ?string $label = null, |
|
| 23 | + public ?string $name = null, |
|
| 24 | + ) { |
|
| 33 | 25 | } |
| 34 | 26 | |
| 35 | - if ($this->commands !== null && !empty($this->commands)) { |
|
| 36 | - $data['commands'] = $this->commands; |
|
| 37 | - } |
|
| 27 | + public function jsonSerialize(): array |
|
| 28 | + { |
|
| 29 | + $data = []; |
|
| 38 | 30 | |
| 39 | - if (!$this->enabled) { |
|
| 40 | - $data['enabled'] = $this->enabled; |
|
| 41 | - } |
|
| 31 | + if ($this->command !== null) { |
|
| 32 | + $data['command'] = $this->command; |
|
| 33 | + } |
|
| 42 | 34 | |
| 43 | - if ($this->label !== null) { |
|
| 44 | - $data['label'] = $this->label; |
|
| 45 | - } |
|
| 35 | + if ($this->commands !== null && !empty($this->commands)) { |
|
| 36 | + $data['commands'] = $this->commands; |
|
| 37 | + } |
|
| 46 | 38 | |
| 47 | - if ($this->name !== null) { |
|
| 48 | - $data['name'] = $this->name; |
|
| 49 | - } |
|
| 39 | + if (!$this->enabled) { |
|
| 40 | + $data['enabled'] = $this->enabled; |
|
| 41 | + } |
|
| 42 | + |
|
| 43 | + if ($this->label !== null) { |
|
| 44 | + $data['label'] = $this->label; |
|
| 45 | + } |
|
| 50 | 46 | |
| 51 | - return $data; |
|
| 52 | - } |
|
| 47 | + if ($this->name !== null) { |
|
| 48 | + $data['name'] = $this->name; |
|
| 49 | + } |
|
| 50 | + |
|
| 51 | + return $data; |
|
| 52 | + } |
|
| 53 | 53 | } |
@@ -1,26 +1,26 @@ |
||
| 1 | -<?php |
|
| 1 | + <?php |
|
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | + declare(strict_types=1); |
|
| 4 | 4 | |
| 5 | -namespace MaxBeckers\AmazonAlexa\Response\Directives\APL\Component; |
|
| 5 | + namespace MaxBeckers\AmazonAlexa\Response\Directives\APL\Component; |
|
| 6 | 6 | |
| 7 | -use MaxBeckers\AmazonAlexa\Response\Directives\APL\Component\Traits\ActionableComponentTrait; |
|
| 8 | -use MaxBeckers\AmazonAlexa\Response\Directives\APL\Document\APLComponentType; |
|
| 7 | + use MaxBeckers\AmazonAlexa\Response\Directives\APL\Component\Traits\ActionableComponentTrait; |
|
| 8 | + use MaxBeckers\AmazonAlexa\Response\Directives\APL\Document\APLComponentType; |
|
| 9 | 9 | |
| 10 | -abstract class ActionableComponent extends APLBaseComponent implements \JsonSerializable |
|
| 11 | -{ |
|
| 12 | - use ActionableComponentTrait; |
|
| 13 | - |
|
| 14 | - public function __construct(APLComponentType $type, ?array $preserve = null) |
|
| 10 | + abstract class ActionableComponent extends APLBaseComponent implements \JsonSerializable |
|
| 15 | 11 | { |
| 16 | - parent::__construct(type: $type, preserve: $preserve); |
|
| 17 | - } |
|
| 12 | + use ActionableComponentTrait; |
|
| 18 | 13 | |
| 19 | - public function jsonSerialize(): array |
|
| 20 | - { |
|
| 21 | - return array_merge( |
|
| 22 | - parent::jsonSerialize(), |
|
| 23 | - $this->serializeActionableProperties() |
|
| 24 | - ); |
|
| 25 | - } |
|
| 14 | + public function __construct(APLComponentType $type, ?array $preserve = null) |
|
| 15 | + { |
|
| 16 | + parent::__construct(type: $type, preserve: $preserve); |
|
| 17 | + } |
|
| 18 | + |
|
| 19 | + public function jsonSerialize(): array |
|
| 20 | + { |
|
| 21 | + return array_merge( |
|
| 22 | + parent::jsonSerialize(), |
|
| 23 | + $this->serializeActionableProperties() |
|
| 24 | + ); |
|
| 25 | + } |
|
| 26 | 26 | } |
@@ -1,14 +1,14 @@ |
||
| 1 | -<?php |
|
| 1 | + <?php |
|
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | + declare(strict_types=1); |
|
| 4 | 4 | |
| 5 | -namespace MaxBeckers\AmazonAlexa\Response\Directives\APL; |
|
| 5 | + namespace MaxBeckers\AmazonAlexa\Response\Directives\APL; |
|
| 6 | 6 | |
| 7 | -enum UpdateIndexListDataOperationType: string |
|
| 8 | -{ |
|
| 9 | - case INSERT_ITEM = 'InsertItem'; |
|
| 10 | - case INSERT_MULTIPLE_ITEMS = 'InsertMultipleItems'; |
|
| 11 | - case SET_ITEM = 'SetItem'; |
|
| 12 | - case DELETE_ITEM = 'DeleteItem'; |
|
| 13 | - case DELETE_MULTIPLE_ITEMS = 'DeleteMultipleItems'; |
|
| 7 | + enum UpdateIndexListDataOperationType: string |
|
| 8 | + { |
|
| 9 | + case INSERT_ITEM = 'InsertItem'; |
|
| 10 | + case INSERT_MULTIPLE_ITEMS = 'InsertMultipleItems'; |
|
| 11 | + case SET_ITEM = 'SetItem'; |
|
| 12 | + case DELETE_ITEM = 'DeleteItem'; |
|
| 13 | + case DELETE_MULTIPLE_ITEMS = 'DeleteMultipleItems'; |
|
| 14 | 14 | } |
@@ -1,93 +1,93 @@ |
||
| 1 | -<?php |
|
| 2 | - |
|
| 3 | -declare(strict_types=1); |
|
| 4 | - |
|
| 5 | -namespace MaxBeckers\AmazonAlexa\Response; |
|
| 6 | - |
|
| 7 | -use MaxBeckers\AmazonAlexa\Exception\InvalidCardPermissionsException; |
|
| 8 | -use MaxBeckers\AmazonAlexa\Helper\SerializeValueMapper; |
|
| 9 | - |
|
| 10 | -class Card implements \JsonSerializable |
|
| 11 | -{ |
|
| 12 | - use SerializeValueMapper; |
|
| 13 | - |
|
| 14 | - public const TYPE_SIMPLE = 'Simple'; |
|
| 15 | - public const TYPE_STANDARD = 'Standard'; |
|
| 16 | - public const TYPE_LINK_ACCOUNT = 'LinkAccount'; |
|
| 17 | - public const TYPE_ASK_FOR_PERMISSIONS_CONSENT = 'AskForPermissionsConsent'; |
|
| 18 | - |
|
| 19 | - public const PERMISSION_FULL_ADDRESS = 'read::alexa:device:all:address'; |
|
| 20 | - public const PERMISSION_COUNTRY_REGION_AND_POSTAL_CODE = 'read::alexa:device:all:address:country_and_postal_code'; |
|
| 21 | - public const PERMISSION_GEOLOCATION = 'alexa::devices:all:geolocation:read'; |
|
| 22 | - public const PERMISSIONS = [ |
|
| 23 | - self::PERMISSION_FULL_ADDRESS, |
|
| 24 | - self::PERMISSION_COUNTRY_REGION_AND_POSTAL_CODE, |
|
| 25 | - self::PERMISSION_GEOLOCATION, |
|
| 26 | - ]; |
|
| 27 | - |
|
| 28 | - public function __construct( |
|
| 29 | - public string $type = self::TYPE_STANDARD, |
|
| 30 | - public ?string $title = null, |
|
| 31 | - public ?string $content = null, |
|
| 32 | - public ?string $text = null, |
|
| 33 | - public ?CardImage $image = null, |
|
| 34 | - public array $permissions = [] |
|
| 35 | - ) { |
|
| 36 | - } |
|
| 37 | - |
|
| 38 | - public static function createSimple(string $title, string $content): self |
|
| 39 | - { |
|
| 40 | - $card = new self(self::TYPE_SIMPLE); |
|
| 1 | + <?php |
|
| 41 | 2 | |
| 42 | - $card->title = $title; |
|
| 43 | - $card->content = $content; |
|
| 3 | + declare(strict_types=1); |
|
| 44 | 4 | |
| 45 | - return $card; |
|
| 46 | - } |
|
| 5 | + namespace MaxBeckers\AmazonAlexa\Response; |
|
| 47 | 6 | |
| 48 | - public static function createStandard(string $title, string $text, ?CardImage $cardImage = null): self |
|
| 49 | - { |
|
| 50 | - $card = new self(); |
|
| 7 | + use MaxBeckers\AmazonAlexa\Exception\InvalidCardPermissionsException; |
|
| 8 | + use MaxBeckers\AmazonAlexa\Helper\SerializeValueMapper; |
|
| 51 | 9 | |
| 52 | - $card->title = $title; |
|
| 53 | - $card->text = $text; |
|
| 54 | - $card->image = $cardImage; |
|
| 10 | + class Card implements \JsonSerializable |
|
| 11 | + { |
|
| 12 | + use SerializeValueMapper; |
|
| 13 | + |
|
| 14 | + public const TYPE_SIMPLE = 'Simple'; |
|
| 15 | + public const TYPE_STANDARD = 'Standard'; |
|
| 16 | + public const TYPE_LINK_ACCOUNT = 'LinkAccount'; |
|
| 17 | + public const TYPE_ASK_FOR_PERMISSIONS_CONSENT = 'AskForPermissionsConsent'; |
|
| 18 | + |
|
| 19 | + public const PERMISSION_FULL_ADDRESS = 'read::alexa:device:all:address'; |
|
| 20 | + public const PERMISSION_COUNTRY_REGION_AND_POSTAL_CODE = 'read::alexa:device:all:address:country_and_postal_code'; |
|
| 21 | + public const PERMISSION_GEOLOCATION = 'alexa::devices:all:geolocation:read'; |
|
| 22 | + public const PERMISSIONS = [ |
|
| 23 | + self::PERMISSION_FULL_ADDRESS, |
|
| 24 | + self::PERMISSION_COUNTRY_REGION_AND_POSTAL_CODE, |
|
| 25 | + self::PERMISSION_GEOLOCATION, |
|
| 26 | + ]; |
|
| 27 | + |
|
| 28 | + public function __construct( |
|
| 29 | + public string $type = self::TYPE_STANDARD, |
|
| 30 | + public ?string $title = null, |
|
| 31 | + public ?string $content = null, |
|
| 32 | + public ?string $text = null, |
|
| 33 | + public ?CardImage $image = null, |
|
| 34 | + public array $permissions = [] |
|
| 35 | + ) { |
|
| 36 | + } |
|
| 55 | 37 | |
| 56 | - return $card; |
|
| 57 | - } |
|
| 38 | + public static function createSimple(string $title, string $content): self |
|
| 39 | + { |
|
| 40 | + $card = new self(self::TYPE_SIMPLE); |
|
| 58 | 41 | |
| 59 | - public static function createLinkAccount(): self |
|
| 60 | - { |
|
| 61 | - return new self(self::TYPE_LINK_ACCOUNT); |
|
| 62 | - } |
|
| 42 | + $card->title = $title; |
|
| 43 | + $card->content = $content; |
|
| 63 | 44 | |
| 64 | - public static function createAskForPermissionsConsent(array $permissions): self |
|
| 65 | - { |
|
| 66 | - if (empty($permissions) || !empty(array_diff($permissions, self::PERMISSIONS))) { |
|
| 67 | - throw new InvalidCardPermissionsException(); |
|
| 45 | + return $card; |
|
| 68 | 46 | } |
| 69 | 47 | |
| 70 | - $card = new self(self::TYPE_ASK_FOR_PERMISSIONS_CONSENT); |
|
| 48 | + public static function createStandard(string $title, string $text, ?CardImage $cardImage = null): self |
|
| 49 | + { |
|
| 50 | + $card = new self(); |
|
| 71 | 51 | |
| 72 | - $card->permissions = $permissions; |
|
| 52 | + $card->title = $title; |
|
| 53 | + $card->text = $text; |
|
| 54 | + $card->image = $cardImage; |
|
| 73 | 55 | |
| 74 | - return $card; |
|
| 75 | - } |
|
| 56 | + return $card; |
|
| 57 | + } |
|
| 76 | 58 | |
| 77 | - public function jsonSerialize(): \ArrayObject |
|
| 78 | - { |
|
| 79 | - $data = new \ArrayObject(); |
|
| 59 | + public static function createLinkAccount(): self |
|
| 60 | + { |
|
| 61 | + return new self(self::TYPE_LINK_ACCOUNT); |
|
| 62 | + } |
|
| 63 | + |
|
| 64 | + public static function createAskForPermissionsConsent(array $permissions): self |
|
| 65 | + { |
|
| 66 | + if (empty($permissions) || !empty(array_diff($permissions, self::PERMISSIONS))) { |
|
| 67 | + throw new InvalidCardPermissionsException(); |
|
| 68 | + } |
|
| 80 | 69 | |
| 81 | - $this->valueToArrayIfSet($data, 'type'); |
|
| 82 | - $this->valueToArrayIfSet($data, 'title'); |
|
| 83 | - $this->valueToArrayIfSet($data, 'content'); |
|
| 84 | - $this->valueToArrayIfSet($data, 'text'); |
|
| 85 | - $this->valueToArrayIfSet($data, 'image'); |
|
| 70 | + $card = new self(self::TYPE_ASK_FOR_PERMISSIONS_CONSENT); |
|
| 86 | 71 | |
| 87 | - if (!empty($this->permissions)) { |
|
| 88 | - $data['permissions'] = $this->permissions; |
|
| 72 | + $card->permissions = $permissions; |
|
| 73 | + |
|
| 74 | + return $card; |
|
| 89 | 75 | } |
| 90 | 76 | |
| 91 | - return $data; |
|
| 92 | - } |
|
| 77 | + public function jsonSerialize(): \ArrayObject |
|
| 78 | + { |
|
| 79 | + $data = new \ArrayObject(); |
|
| 80 | + |
|
| 81 | + $this->valueToArrayIfSet($data, 'type'); |
|
| 82 | + $this->valueToArrayIfSet($data, 'title'); |
|
| 83 | + $this->valueToArrayIfSet($data, 'content'); |
|
| 84 | + $this->valueToArrayIfSet($data, 'text'); |
|
| 85 | + $this->valueToArrayIfSet($data, 'image'); |
|
| 86 | + |
|
| 87 | + if (!empty($this->permissions)) { |
|
| 88 | + $data['permissions'] = $this->permissions; |
|
| 89 | + } |
|
| 90 | + |
|
| 91 | + return $data; |
|
| 92 | + } |
|
| 93 | 93 | } |
@@ -1,52 +1,52 @@ |
||
| 1 | -<?php |
|
| 1 | + <?php |
|
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | + declare(strict_types=1); |
|
| 4 | 4 | |
| 5 | -namespace MaxBeckers\AmazonAlexa\Response; |
|
| 5 | + namespace MaxBeckers\AmazonAlexa\Response; |
|
| 6 | 6 | |
| 7 | -use MaxBeckers\AmazonAlexa\Helper\SerializeValueMapper; |
|
| 8 | -use MaxBeckers\AmazonAlexa\Response\Directives\Directive; |
|
| 7 | + use MaxBeckers\AmazonAlexa\Helper\SerializeValueMapper; |
|
| 8 | + use MaxBeckers\AmazonAlexa\Response\Directives\Directive; |
|
| 9 | 9 | |
| 10 | -class ResponseBody implements ResponseBodyInterface, \JsonSerializable |
|
| 11 | -{ |
|
| 12 | - use SerializeValueMapper; |
|
| 13 | - |
|
| 14 | - /** @var Directive[] */ |
|
| 15 | - public function __construct( |
|
| 16 | - public OutputSpeech|string|null $outputSpeech = null, |
|
| 17 | - public ?Card $card = null, |
|
| 18 | - public ?Reprompt $reprompt = null, |
|
| 19 | - public ?bool $shouldEndSession = null, |
|
| 20 | - public array $directives = [] |
|
| 21 | - ) { |
|
| 22 | - } |
|
| 10 | + class ResponseBody implements ResponseBodyInterface, \JsonSerializable |
|
| 11 | + { |
|
| 12 | + use SerializeValueMapper; |
|
| 13 | + |
|
| 14 | + /** @var Directive[] */ |
|
| 15 | + public function __construct( |
|
| 16 | + public OutputSpeech|string|null $outputSpeech = null, |
|
| 17 | + public ?Card $card = null, |
|
| 18 | + public ?Reprompt $reprompt = null, |
|
| 19 | + public ?bool $shouldEndSession = null, |
|
| 20 | + public array $directives = [] |
|
| 21 | + ) { |
|
| 22 | + } |
|
| 23 | 23 | |
| 24 | - /** |
|
| 24 | + /** |
|
| 25 | 25 | * Add a directive to response body. |
| 26 | 26 | * |
| 27 | 27 | * @param Directive $directive |
| 28 | 28 | */ |
| 29 | - public function addDirective(Directive $directive): void |
|
| 30 | - { |
|
| 31 | - $this->directives[] = $directive; |
|
| 32 | - } |
|
| 29 | + public function addDirective(Directive $directive): void |
|
| 30 | + { |
|
| 31 | + $this->directives[] = $directive; |
|
| 32 | + } |
|
| 33 | 33 | |
| 34 | - /** |
|
| 34 | + /** |
|
| 35 | 35 | * {@inheritdoc} |
| 36 | 36 | */ |
| 37 | - public function jsonSerialize(): \ArrayObject |
|
| 38 | - { |
|
| 39 | - $data = new \ArrayObject(); |
|
| 37 | + public function jsonSerialize(): \ArrayObject |
|
| 38 | + { |
|
| 39 | + $data = new \ArrayObject(); |
|
| 40 | 40 | |
| 41 | - $this->valueToArrayIfSet($data, 'outputSpeech'); |
|
| 42 | - $this->valueToArrayIfSet($data, 'card'); |
|
| 43 | - $this->valueToArrayIfSet($data, 'reprompt'); |
|
| 44 | - $this->valueToArrayIfSet($data, 'shouldEndSession'); |
|
| 41 | + $this->valueToArrayIfSet($data, 'outputSpeech'); |
|
| 42 | + $this->valueToArrayIfSet($data, 'card'); |
|
| 43 | + $this->valueToArrayIfSet($data, 'reprompt'); |
|
| 44 | + $this->valueToArrayIfSet($data, 'shouldEndSession'); |
|
| 45 | 45 | |
| 46 | - if (!empty($this->directives)) { |
|
| 47 | - $data['directives'] = $this->directives; |
|
| 48 | - } |
|
| 46 | + if (!empty($this->directives)) { |
|
| 47 | + $data['directives'] = $this->directives; |
|
| 48 | + } |
|
| 49 | 49 | |
| 50 | - return $data; |
|
| 51 | - } |
|
| 50 | + return $data; |
|
| 51 | + } |
|
| 52 | 52 | } |
@@ -1,19 +1,19 @@ |
||
| 1 | -<?php |
|
| 1 | + <?php |
|
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | + declare(strict_types=1); |
|
| 4 | 4 | |
| 5 | -namespace MaxBeckers\AmazonAlexa\Response; |
|
| 5 | + namespace MaxBeckers\AmazonAlexa\Response; |
|
| 6 | 6 | |
| 7 | -class CardImage |
|
| 8 | -{ |
|
| 9 | - public function __construct( |
|
| 10 | - public ?string $smallImageUrl = null, |
|
| 11 | - public ?string $largeImageUrl = null |
|
| 12 | - ) { |
|
| 13 | - } |
|
| 14 | - |
|
| 15 | - public static function fromUrls(string $smallImageUrl, string $largeImageUrl): self |
|
| 7 | + class CardImage |
|
| 16 | 8 | { |
| 17 | - return new self($smallImageUrl, $largeImageUrl); |
|
| 18 | - } |
|
| 9 | + public function __construct( |
|
| 10 | + public ?string $smallImageUrl = null, |
|
| 11 | + public ?string $largeImageUrl = null |
|
| 12 | + ) { |
|
| 13 | + } |
|
| 14 | + |
|
| 15 | + public static function fromUrls(string $smallImageUrl, string $largeImageUrl): self |
|
| 16 | + { |
|
| 17 | + return new self($smallImageUrl, $largeImageUrl); |
|
| 18 | + } |
|
| 19 | 19 | } |
@@ -1,20 +1,20 @@ |
||
| 1 | -<?php |
|
| 1 | + <?php |
|
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | + declare(strict_types=1); |
|
| 4 | 4 | |
| 5 | -namespace MaxBeckers\AmazonAlexa\Response\CanFulfill; |
|
| 5 | + namespace MaxBeckers\AmazonAlexa\Response\CanFulfill; |
|
| 6 | 6 | |
| 7 | -use MaxBeckers\AmazonAlexa\Response\ResponseBodyInterface; |
|
| 7 | + use MaxBeckers\AmazonAlexa\Response\ResponseBodyInterface; |
|
| 8 | 8 | |
| 9 | -class CanFulfillResponseBody implements ResponseBodyInterface |
|
| 10 | -{ |
|
| 11 | - public function __construct( |
|
| 12 | - public ?CanFulfillIntentResponse $canFulfillIntent = null |
|
| 13 | - ) { |
|
| 14 | - } |
|
| 15 | - |
|
| 16 | - public static function create(CanFulfillIntentResponse $canFulfillIntent): self |
|
| 9 | + class CanFulfillResponseBody implements ResponseBodyInterface |
|
| 17 | 10 | { |
| 18 | - return new self($canFulfillIntent); |
|
| 19 | - } |
|
| 11 | + public function __construct( |
|
| 12 | + public ?CanFulfillIntentResponse $canFulfillIntent = null |
|
| 13 | + ) { |
|
| 14 | + } |
|
| 15 | + |
|
| 16 | + public static function create(CanFulfillIntentResponse $canFulfillIntent): self |
|
| 17 | + { |
|
| 18 | + return new self($canFulfillIntent); |
|
| 19 | + } |
|
| 20 | 20 | } |
@@ -1,25 +1,25 @@ |
||
| 1 | -<?php |
|
| 1 | + <?php |
|
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | + declare(strict_types=1); |
|
| 4 | 4 | |
| 5 | -namespace MaxBeckers\AmazonAlexa\Response\CanFulfill; |
|
| 5 | + namespace MaxBeckers\AmazonAlexa\Response\CanFulfill; |
|
| 6 | 6 | |
| 7 | -class CanFulfillSlot |
|
| 8 | -{ |
|
| 9 | - public const CAN_UNDERSTAND_YES = 'YES'; |
|
| 10 | - public const CAN_UNDERSTAND_MAYBE = 'MAYBE'; |
|
| 11 | - public const CAN_UNDERSTAND_NO = 'NO'; |
|
| 12 | - public const CAN_FULFILL_YES = 'YES'; |
|
| 13 | - public const CAN_FULFILL_NO = 'NO'; |
|
| 7 | + class CanFulfillSlot |
|
| 8 | + { |
|
| 9 | + public const CAN_UNDERSTAND_YES = 'YES'; |
|
| 10 | + public const CAN_UNDERSTAND_MAYBE = 'MAYBE'; |
|
| 11 | + public const CAN_UNDERSTAND_NO = 'NO'; |
|
| 12 | + public const CAN_FULFILL_YES = 'YES'; |
|
| 13 | + public const CAN_FULFILL_NO = 'NO'; |
|
| 14 | 14 | |
| 15 | - public function __construct( |
|
| 16 | - public ?string $canUnderstand = null, |
|
| 17 | - public ?string $canFulfill = null |
|
| 18 | - ) { |
|
| 19 | - } |
|
| 15 | + public function __construct( |
|
| 16 | + public ?string $canUnderstand = null, |
|
| 17 | + public ?string $canFulfill = null |
|
| 18 | + ) { |
|
| 19 | + } |
|
| 20 | 20 | |
| 21 | - public static function create(string $canUnderstand, string $canFulfill): self |
|
| 22 | - { |
|
| 23 | - return new self($canUnderstand, $canFulfill); |
|
| 24 | - } |
|
| 21 | + public static function create(string $canUnderstand, string $canFulfill): self |
|
| 22 | + { |
|
| 23 | + return new self($canUnderstand, $canFulfill); |
|
| 24 | + } |
|
| 25 | 25 | } |
@@ -1,29 +1,29 @@ |
||
| 1 | -<?php |
|
| 1 | + <?php |
|
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | + declare(strict_types=1); |
|
| 4 | 4 | |
| 5 | -namespace MaxBeckers\AmazonAlexa\Response\CanFulfill; |
|
| 5 | + namespace MaxBeckers\AmazonAlexa\Response\CanFulfill; |
|
| 6 | 6 | |
| 7 | -class CanFulfillIntentResponse |
|
| 8 | -{ |
|
| 9 | - public const CAN_FULFILL_YES = 'YES'; |
|
| 10 | - public const CAN_FULFILL_MAYBE = 'MAYBE'; |
|
| 11 | - public const CAN_FULFILL_NO = 'NO'; |
|
| 7 | + class CanFulfillIntentResponse |
|
| 8 | + { |
|
| 9 | + public const CAN_FULFILL_YES = 'YES'; |
|
| 10 | + public const CAN_FULFILL_MAYBE = 'MAYBE'; |
|
| 11 | + public const CAN_FULFILL_NO = 'NO'; |
|
| 12 | 12 | |
| 13 | - /** @var CanFulfillSlot[] */ |
|
| 14 | - public function __construct( |
|
| 15 | - public ?string $canFulfill = null, |
|
| 16 | - public array $slots = [] |
|
| 17 | - ) { |
|
| 18 | - } |
|
| 13 | + /** @var CanFulfillSlot[] */ |
|
| 14 | + public function __construct( |
|
| 15 | + public ?string $canFulfill = null, |
|
| 16 | + public array $slots = [] |
|
| 17 | + ) { |
|
| 18 | + } |
|
| 19 | 19 | |
| 20 | - public static function create(string $canFulfill, array $slots = []): self |
|
| 21 | - { |
|
| 22 | - return new self($canFulfill, $slots); |
|
| 23 | - } |
|
| 20 | + public static function create(string $canFulfill, array $slots = []): self |
|
| 21 | + { |
|
| 22 | + return new self($canFulfill, $slots); |
|
| 23 | + } |
|
| 24 | 24 | |
| 25 | - public function addSlot(string $slotName, CanFulfillSlot $canFulfillSlot): void |
|
| 26 | - { |
|
| 27 | - $this->slots[$slotName] = $canFulfillSlot; |
|
| 28 | - } |
|
| 25 | + public function addSlot(string $slotName, CanFulfillSlot $canFulfillSlot): void |
|
| 26 | + { |
|
| 27 | + $this->slots[$slotName] = $canFulfillSlot; |
|
| 28 | + } |
|
| 29 | 29 | } |