@@ -1,44 +1,44 @@ |
||
| 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\StandardCommand; |
|
| 5 | + namespace MaxBeckers\AmazonAlexa\Response\Directives\APL\StandardCommand; |
|
| 6 | 6 | |
| 7 | -use MaxBeckers\AmazonAlexa\Response\Directives\APL\Document\ControlMediaCommand as ControlMediaCommandType; |
|
| 7 | + use MaxBeckers\AmazonAlexa\Response\Directives\APL\Document\ControlMediaCommand as ControlMediaCommandType; |
|
| 8 | 8 | |
| 9 | -class ControlMediaCommand extends AbstractStandardCommand |
|
| 10 | -{ |
|
| 11 | - public const TYPE = 'ControlMedia'; |
|
| 9 | + class ControlMediaCommand extends AbstractStandardCommand |
|
| 10 | + { |
|
| 11 | + public const TYPE = 'ControlMedia'; |
|
| 12 | 12 | |
| 13 | - /** |
|
| 13 | + /** |
|
| 14 | 14 | * @param ControlMediaCommandType|null $command The media control command to execute |
| 15 | 15 | * @param string|null $componentId The ID of the component to control |
| 16 | 16 | * @param int|null $value Integer value for commands that require it |
| 17 | 17 | */ |
| 18 | - public function __construct( |
|
| 19 | - public ?ControlMediaCommandType $command = null, |
|
| 20 | - public ?string $componentId = null, |
|
| 21 | - public ?int $value = null, |
|
| 22 | - ) { |
|
| 23 | - parent::__construct(self::TYPE); |
|
| 24 | - } |
|
| 25 | - |
|
| 26 | - public function jsonSerialize(): array |
|
| 27 | - { |
|
| 28 | - $data = parent::jsonSerialize(); |
|
| 29 | - |
|
| 30 | - if ($this->command !== null) { |
|
| 31 | - $data['command'] = $this->command->value; |
|
| 18 | + public function __construct( |
|
| 19 | + public ?ControlMediaCommandType $command = null, |
|
| 20 | + public ?string $componentId = null, |
|
| 21 | + public ?int $value = null, |
|
| 22 | + ) { |
|
| 23 | + parent::__construct(self::TYPE); |
|
| 32 | 24 | } |
| 33 | 25 | |
| 34 | - if ($this->componentId !== null) { |
|
| 35 | - $data['componentId'] = $this->componentId; |
|
| 36 | - } |
|
| 26 | + public function jsonSerialize(): array |
|
| 27 | + { |
|
| 28 | + $data = parent::jsonSerialize(); |
|
| 37 | 29 | |
| 38 | - if ($this->value !== null) { |
|
| 39 | - $data['value'] = $this->value; |
|
| 40 | - } |
|
| 30 | + if ($this->command !== null) { |
|
| 31 | + $data['command'] = $this->command->value; |
|
| 32 | + } |
|
| 33 | + |
|
| 34 | + if ($this->componentId !== null) { |
|
| 35 | + $data['componentId'] = $this->componentId; |
|
| 36 | + } |
|
| 41 | 37 | |
| 42 | - return $data; |
|
| 43 | - } |
|
| 38 | + if ($this->value !== null) { |
|
| 39 | + $data['value'] = $this->value; |
|
| 40 | + } |
|
| 41 | + |
|
| 42 | + return $data; |
|
| 43 | + } |
|
| 44 | 44 | } |
@@ -1,36 +1,36 @@ |
||
| 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\StandardCommand; |
|
| 5 | + namespace MaxBeckers\AmazonAlexa\Response\Directives\APL\StandardCommand; |
|
| 6 | 6 | |
| 7 | -class ParallelCommand extends AbstractStandardCommand |
|
| 8 | -{ |
|
| 9 | - public const TYPE = 'Parallel'; |
|
| 7 | + class ParallelCommand extends AbstractStandardCommand |
|
| 8 | + { |
|
| 9 | + public const TYPE = 'Parallel'; |
|
| 10 | 10 | |
| 11 | - /** |
|
| 11 | + /** |
|
| 12 | 12 | * @param array|null $data Array of data to iterate over |
| 13 | 13 | * @param AbstractStandardCommand[]|null $commands Commands to run in parallel |
| 14 | 14 | */ |
| 15 | - public function __construct( |
|
| 16 | - public ?array $data = null, |
|
| 17 | - public ?array $commands = null, |
|
| 18 | - ) { |
|
| 19 | - parent::__construct(self::TYPE); |
|
| 20 | - } |
|
| 21 | - |
|
| 22 | - public function jsonSerialize(): array |
|
| 23 | - { |
|
| 24 | - $data = parent::jsonSerialize(); |
|
| 25 | - |
|
| 26 | - if ($this->data !== null && !empty($this->data)) { |
|
| 27 | - $data['data'] = $this->data; |
|
| 15 | + public function __construct( |
|
| 16 | + public ?array $data = null, |
|
| 17 | + public ?array $commands = null, |
|
| 18 | + ) { |
|
| 19 | + parent::__construct(self::TYPE); |
|
| 28 | 20 | } |
| 29 | 21 | |
| 30 | - if ($this->commands !== null && !empty($this->commands)) { |
|
| 31 | - $data['commands'] = $this->commands; |
|
| 32 | - } |
|
| 22 | + public function jsonSerialize(): array |
|
| 23 | + { |
|
| 24 | + $data = parent::jsonSerialize(); |
|
| 33 | 25 | |
| 34 | - return $data; |
|
| 35 | - } |
|
| 26 | + if ($this->data !== null && !empty($this->data)) { |
|
| 27 | + $data['data'] = $this->data; |
|
| 28 | + } |
|
| 29 | + |
|
| 30 | + if ($this->commands !== null && !empty($this->commands)) { |
|
| 31 | + $data['commands'] = $this->commands; |
|
| 32 | + } |
|
| 33 | + |
|
| 34 | + return $data; |
|
| 35 | + } |
|
| 36 | 36 | } |
@@ -1,42 +1,42 @@ |
||
| 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\StandardCommand; |
|
| 5 | + namespace MaxBeckers\AmazonAlexa\Response\Directives\APL\StandardCommand; |
|
| 6 | 6 | |
| 7 | -class SetValueCommand extends AbstractStandardCommand implements \JsonSerializable |
|
| 8 | -{ |
|
| 9 | - public const TYPE = 'SetValue'; |
|
| 7 | + class SetValueCommand extends AbstractStandardCommand implements \JsonSerializable |
|
| 8 | + { |
|
| 9 | + public const TYPE = 'SetValue'; |
|
| 10 | 10 | |
| 11 | - /** |
|
| 11 | + /** |
|
| 12 | 12 | * @param string|null $componentId ID of the component to set value on |
| 13 | 13 | * @param string|null $property Property to set |
| 14 | 14 | * @param mixed $value Value to set |
| 15 | 15 | */ |
| 16 | - public function __construct( |
|
| 17 | - public ?string $componentId = null, |
|
| 18 | - public ?string $property = null, |
|
| 19 | - public mixed $value = null, |
|
| 20 | - ) { |
|
| 21 | - parent::__construct(self::TYPE); |
|
| 22 | - } |
|
| 23 | - |
|
| 24 | - public function jsonSerialize(): array |
|
| 25 | - { |
|
| 26 | - $data = parent::jsonSerialize(); |
|
| 27 | - |
|
| 28 | - if ($this->componentId !== null) { |
|
| 29 | - $data['componentId'] = $this->componentId; |
|
| 16 | + public function __construct( |
|
| 17 | + public ?string $componentId = null, |
|
| 18 | + public ?string $property = null, |
|
| 19 | + public mixed $value = null, |
|
| 20 | + ) { |
|
| 21 | + parent::__construct(self::TYPE); |
|
| 30 | 22 | } |
| 31 | 23 | |
| 32 | - if ($this->property !== null) { |
|
| 33 | - $data['property'] = $this->property; |
|
| 34 | - } |
|
| 24 | + public function jsonSerialize(): array |
|
| 25 | + { |
|
| 26 | + $data = parent::jsonSerialize(); |
|
| 35 | 27 | |
| 36 | - if ($this->value !== null) { |
|
| 37 | - $data['value'] = $this->value; |
|
| 38 | - } |
|
| 28 | + if ($this->componentId !== null) { |
|
| 29 | + $data['componentId'] = $this->componentId; |
|
| 30 | + } |
|
| 31 | + |
|
| 32 | + if ($this->property !== null) { |
|
| 33 | + $data['property'] = $this->property; |
|
| 34 | + } |
|
| 39 | 35 | |
| 40 | - return $data; |
|
| 41 | - } |
|
| 36 | + if ($this->value !== null) { |
|
| 37 | + $data['value'] = $this->value; |
|
| 38 | + } |
|
| 39 | + |
|
| 40 | + return $data; |
|
| 41 | + } |
|
| 42 | 42 | } |
@@ -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\Directives\APL\StandardCommand; |
|
| 5 | + namespace MaxBeckers\AmazonAlexa\Response\Directives\APL\StandardCommand; |
|
| 6 | 6 | |
| 7 | -class IdleCommand extends AbstractStandardCommand |
|
| 8 | -{ |
|
| 9 | - public const TYPE = 'Idle'; |
|
| 10 | - |
|
| 11 | - public function __construct() |
|
| 7 | + class IdleCommand extends AbstractStandardCommand |
|
| 12 | 8 | { |
| 13 | - parent::__construct(self::TYPE); |
|
| 14 | - } |
|
| 9 | + public const TYPE = 'Idle'; |
|
| 15 | 10 | |
| 16 | - public function jsonSerialize(): array |
|
| 17 | - { |
|
| 18 | - return parent::jsonSerialize(); |
|
| 19 | - } |
|
| 11 | + public function __construct() |
|
| 12 | + { |
|
| 13 | + parent::__construct(self::TYPE); |
|
| 14 | + } |
|
| 15 | + |
|
| 16 | + public function jsonSerialize(): array |
|
| 17 | + { |
|
| 18 | + return parent::jsonSerialize(); |
|
| 19 | + } |
|
| 20 | 20 | } |
@@ -1,48 +1,48 @@ |
||
| 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\StandardCommand; |
|
| 5 | + namespace MaxBeckers\AmazonAlexa\Response\Directives\APL\StandardCommand; |
|
| 6 | 6 | |
| 7 | -class SelectCommand extends AbstractStandardCommand implements \JsonSerializable |
|
| 8 | -{ |
|
| 9 | - public const TYPE = 'Select'; |
|
| 7 | + class SelectCommand extends AbstractStandardCommand implements \JsonSerializable |
|
| 8 | + { |
|
| 9 | + public const TYPE = 'Select'; |
|
| 10 | 10 | |
| 11 | - /** |
|
| 11 | + /** |
|
| 12 | 12 | * @param string|null $componentId ID of the component to select |
| 13 | 13 | * @param AbstractStandardCommand[]|null $commands Commands to run when condition is true |
| 14 | 14 | * @param array|null $data Array of data to iterate over |
| 15 | 15 | * @param AbstractStandardCommand[]|null $otherwise Commands to run when condition is false |
| 16 | 16 | */ |
| 17 | - public function __construct( |
|
| 18 | - public ?string $componentId = null, |
|
| 19 | - public ?array $commands = null, |
|
| 20 | - public ?array $data = null, |
|
| 21 | - public ?array $otherwise = null, |
|
| 22 | - ) { |
|
| 23 | - parent::__construct(self::TYPE); |
|
| 24 | - } |
|
| 25 | - |
|
| 26 | - public function jsonSerialize(): array |
|
| 27 | - { |
|
| 28 | - $data = parent::jsonSerialize(); |
|
| 29 | - |
|
| 30 | - if ($this->componentId !== null) { |
|
| 31 | - $data['componentId'] = $this->componentId; |
|
| 17 | + public function __construct( |
|
| 18 | + public ?string $componentId = null, |
|
| 19 | + public ?array $commands = null, |
|
| 20 | + public ?array $data = null, |
|
| 21 | + public ?array $otherwise = null, |
|
| 22 | + ) { |
|
| 23 | + parent::__construct(self::TYPE); |
|
| 32 | 24 | } |
| 33 | 25 | |
| 34 | - if ($this->commands !== null && !empty($this->commands)) { |
|
| 35 | - $data['commands'] = $this->commands; |
|
| 36 | - } |
|
| 26 | + public function jsonSerialize(): array |
|
| 27 | + { |
|
| 28 | + $data = parent::jsonSerialize(); |
|
| 37 | 29 | |
| 38 | - if ($this->data !== null && !empty($this->data)) { |
|
| 39 | - $data['data'] = $this->data; |
|
| 40 | - } |
|
| 30 | + if ($this->componentId !== null) { |
|
| 31 | + $data['componentId'] = $this->componentId; |
|
| 32 | + } |
|
| 41 | 33 | |
| 42 | - if ($this->otherwise !== null && !empty($this->otherwise)) { |
|
| 43 | - $data['otherwise'] = $this->otherwise; |
|
| 44 | - } |
|
| 34 | + if ($this->commands !== null && !empty($this->commands)) { |
|
| 35 | + $data['commands'] = $this->commands; |
|
| 36 | + } |
|
| 37 | + |
|
| 38 | + if ($this->data !== null && !empty($this->data)) { |
|
| 39 | + $data['data'] = $this->data; |
|
| 40 | + } |
|
| 45 | 41 | |
| 46 | - return $data; |
|
| 47 | - } |
|
| 42 | + if ($this->otherwise !== null && !empty($this->otherwise)) { |
|
| 43 | + $data['otherwise'] = $this->otherwise; |
|
| 44 | + } |
|
| 45 | + |
|
| 46 | + return $data; |
|
| 47 | + } |
|
| 48 | 48 | } |
@@ -1,54 +1,54 @@ |
||
| 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\StandardCommand; |
|
| 5 | + namespace MaxBeckers\AmazonAlexa\Response\Directives\APL\StandardCommand; |
|
| 6 | 6 | |
| 7 | -class SequentialCommand extends AbstractStandardCommand implements \JsonSerializable |
|
| 8 | -{ |
|
| 9 | - public const TYPE = 'Sequential'; |
|
| 7 | + class SequentialCommand extends AbstractStandardCommand implements \JsonSerializable |
|
| 8 | + { |
|
| 9 | + public const TYPE = 'Sequential'; |
|
| 10 | 10 | |
| 11 | - /** |
|
| 11 | + /** |
|
| 12 | 12 | * @param AbstractStandardCommand[]|null $catch Commands to run if an error occurs |
| 13 | 13 | * @param AbstractStandardCommand[]|null $commands Commands to run sequentially |
| 14 | 14 | * @param array|null $data Array of data to iterate over |
| 15 | 15 | * @param int|null $repeatCount Number of times to repeat the sequence |
| 16 | 16 | * @param AbstractStandardCommand[]|null $finally Commands to run after completion |
| 17 | 17 | */ |
| 18 | - public function __construct( |
|
| 19 | - public ?array $catch = null, |
|
| 20 | - public ?array $commands = null, |
|
| 21 | - public ?array $data = null, |
|
| 22 | - public ?int $repeatCount = null, |
|
| 23 | - public ?array $finally = null, |
|
| 24 | - ) { |
|
| 25 | - parent::__construct(self::TYPE); |
|
| 26 | - } |
|
| 27 | - |
|
| 28 | - public function jsonSerialize(): array |
|
| 29 | - { |
|
| 30 | - $data = parent::jsonSerialize(); |
|
| 31 | - |
|
| 32 | - if ($this->catch !== null && !empty($this->catch)) { |
|
| 33 | - $data['catch'] = $this->catch; |
|
| 18 | + public function __construct( |
|
| 19 | + public ?array $catch = null, |
|
| 20 | + public ?array $commands = null, |
|
| 21 | + public ?array $data = null, |
|
| 22 | + public ?int $repeatCount = null, |
|
| 23 | + public ?array $finally = null, |
|
| 24 | + ) { |
|
| 25 | + parent::__construct(self::TYPE); |
|
| 34 | 26 | } |
| 35 | 27 | |
| 36 | - if ($this->commands !== null && !empty($this->commands)) { |
|
| 37 | - $data['commands'] = $this->commands; |
|
| 38 | - } |
|
| 28 | + public function jsonSerialize(): array |
|
| 29 | + { |
|
| 30 | + $data = parent::jsonSerialize(); |
|
| 39 | 31 | |
| 40 | - if ($this->data !== null && !empty($this->data)) { |
|
| 41 | - $data['data'] = $this->data; |
|
| 42 | - } |
|
| 32 | + if ($this->catch !== null && !empty($this->catch)) { |
|
| 33 | + $data['catch'] = $this->catch; |
|
| 34 | + } |
|
| 43 | 35 | |
| 44 | - if ($this->repeatCount !== null) { |
|
| 45 | - $data['repeatCount'] = $this->repeatCount; |
|
| 46 | - } |
|
| 36 | + if ($this->commands !== null && !empty($this->commands)) { |
|
| 37 | + $data['commands'] = $this->commands; |
|
| 38 | + } |
|
| 47 | 39 | |
| 48 | - if ($this->finally !== null && !empty($this->finally)) { |
|
| 49 | - $data['finally'] = $this->finally; |
|
| 50 | - } |
|
| 40 | + if ($this->data !== null && !empty($this->data)) { |
|
| 41 | + $data['data'] = $this->data; |
|
| 42 | + } |
|
| 43 | + |
|
| 44 | + if ($this->repeatCount !== null) { |
|
| 45 | + $data['repeatCount'] = $this->repeatCount; |
|
| 46 | + } |
|
| 51 | 47 | |
| 52 | - return $data; |
|
| 53 | - } |
|
| 48 | + if ($this->finally !== null && !empty($this->finally)) { |
|
| 49 | + $data['finally'] = $this->finally; |
|
| 50 | + } |
|
| 51 | + |
|
| 52 | + return $data; |
|
| 53 | + } |
|
| 54 | 54 | } |
@@ -1,48 +1,48 @@ |
||
| 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\StandardCommand; |
|
| 5 | + namespace MaxBeckers\AmazonAlexa\Response\Directives\APL\StandardCommand; |
|
| 6 | 6 | |
| 7 | -use MaxBeckers\AmazonAlexa\Response\Directives\APL\Document\SetPagePosition; |
|
| 7 | + use MaxBeckers\AmazonAlexa\Response\Directives\APL\Document\SetPagePosition; |
|
| 8 | 8 | |
| 9 | -class SetPageCommand extends AbstractStandardCommand implements \JsonSerializable |
|
| 10 | -{ |
|
| 11 | - public const TYPE = 'SetPage'; |
|
| 9 | + class SetPageCommand extends AbstractStandardCommand implements \JsonSerializable |
|
| 10 | + { |
|
| 11 | + public const TYPE = 'SetPage'; |
|
| 12 | 12 | |
| 13 | - /** |
|
| 13 | + /** |
|
| 14 | 14 | * @param string|null $componentId ID of the component to set page on |
| 15 | 15 | * @param SetPagePosition $position Position type for the page change |
| 16 | 16 | * @param int|null $transitionDuration Duration of the page transition in milliseconds |
| 17 | 17 | * @param int|null $value Page value to set |
| 18 | 18 | */ |
| 19 | - public function __construct( |
|
| 20 | - public ?string $componentId = null, |
|
| 21 | - public SetPagePosition $position = SetPagePosition::ABSOLUTE, |
|
| 22 | - public ?int $transitionDuration = null, |
|
| 23 | - public ?int $value = null, |
|
| 24 | - ) { |
|
| 25 | - parent::__construct(self::TYPE); |
|
| 26 | - } |
|
| 27 | - |
|
| 28 | - public function jsonSerialize(): array |
|
| 29 | - { |
|
| 30 | - $data = parent::jsonSerialize(); |
|
| 31 | - |
|
| 32 | - if ($this->componentId !== null) { |
|
| 33 | - $data['componentId'] = $this->componentId; |
|
| 19 | + public function __construct( |
|
| 20 | + public ?string $componentId = null, |
|
| 21 | + public SetPagePosition $position = SetPagePosition::ABSOLUTE, |
|
| 22 | + public ?int $transitionDuration = null, |
|
| 23 | + public ?int $value = null, |
|
| 24 | + ) { |
|
| 25 | + parent::__construct(self::TYPE); |
|
| 34 | 26 | } |
| 35 | 27 | |
| 36 | - $data['position'] = $this->position->value; |
|
| 28 | + public function jsonSerialize(): array |
|
| 29 | + { |
|
| 30 | + $data = parent::jsonSerialize(); |
|
| 37 | 31 | |
| 38 | - if ($this->transitionDuration !== null) { |
|
| 39 | - $data['transitionDuration'] = $this->transitionDuration; |
|
| 40 | - } |
|
| 32 | + if ($this->componentId !== null) { |
|
| 33 | + $data['componentId'] = $this->componentId; |
|
| 34 | + } |
|
| 41 | 35 | |
| 42 | - if ($this->value !== null) { |
|
| 43 | - $data['value'] = $this->value; |
|
| 44 | - } |
|
| 36 | + $data['position'] = $this->position->value; |
|
| 37 | + |
|
| 38 | + if ($this->transitionDuration !== null) { |
|
| 39 | + $data['transitionDuration'] = $this->transitionDuration; |
|
| 40 | + } |
|
| 45 | 41 | |
| 46 | - return $data; |
|
| 47 | - } |
|
| 42 | + if ($this->value !== null) { |
|
| 43 | + $data['value'] = $this->value; |
|
| 44 | + } |
|
| 45 | + |
|
| 46 | + return $data; |
|
| 47 | + } |
|
| 48 | 48 | } |
@@ -1,46 +1,46 @@ |
||
| 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\StandardCommand; |
|
| 5 | + namespace MaxBeckers\AmazonAlexa\Response\Directives\APL\StandardCommand; |
|
| 6 | 6 | |
| 7 | -use MaxBeckers\AmazonAlexa\Response\Directives\APL\Document\HighlightMode; |
|
| 8 | -use MaxBeckers\AmazonAlexa\Response\Directives\APL\Document\ScrollAlign; |
|
| 7 | + use MaxBeckers\AmazonAlexa\Response\Directives\APL\Document\HighlightMode; |
|
| 8 | + use MaxBeckers\AmazonAlexa\Response\Directives\APL\Document\ScrollAlign; |
|
| 9 | 9 | |
| 10 | -class SpeakItemCommand extends AbstractStandardCommand implements \JsonSerializable |
|
| 11 | -{ |
|
| 12 | - public const TYPE = 'SpeakItem'; |
|
| 10 | + class SpeakItemCommand extends AbstractStandardCommand implements \JsonSerializable |
|
| 11 | + { |
|
| 12 | + public const TYPE = 'SpeakItem'; |
|
| 13 | 13 | |
| 14 | - /** |
|
| 14 | + /** |
|
| 15 | 15 | * @param string|null $componentId ID of the component to speak |
| 16 | 16 | * @param ScrollAlign $align Alignment when scrolling to the item |
| 17 | 17 | * @param HighlightMode $highlightMode How to highlight the item being spoken |
| 18 | 18 | * @param int|null $minimumDwellTime Minimum time to dwell on each item in milliseconds |
| 19 | 19 | */ |
| 20 | - public function __construct( |
|
| 21 | - public ?string $componentId = null, |
|
| 22 | - public ScrollAlign $align = ScrollAlign::VISIBLE, |
|
| 23 | - public HighlightMode $highlightMode = HighlightMode::BLOCK, |
|
| 24 | - public ?int $minimumDwellTime = null, |
|
| 25 | - ) { |
|
| 26 | - parent::__construct(self::TYPE); |
|
| 27 | - } |
|
| 28 | - |
|
| 29 | - public function jsonSerialize(): array |
|
| 30 | - { |
|
| 31 | - $data = parent::jsonSerialize(); |
|
| 32 | - |
|
| 33 | - if ($this->componentId !== null) { |
|
| 34 | - $data['componentId'] = $this->componentId; |
|
| 20 | + public function __construct( |
|
| 21 | + public ?string $componentId = null, |
|
| 22 | + public ScrollAlign $align = ScrollAlign::VISIBLE, |
|
| 23 | + public HighlightMode $highlightMode = HighlightMode::BLOCK, |
|
| 24 | + public ?int $minimumDwellTime = null, |
|
| 25 | + ) { |
|
| 26 | + parent::__construct(self::TYPE); |
|
| 35 | 27 | } |
| 36 | 28 | |
| 37 | - $data['align'] = $this->align->value; |
|
| 38 | - $data['highlightMode'] = $this->highlightMode->value; |
|
| 29 | + public function jsonSerialize(): array |
|
| 30 | + { |
|
| 31 | + $data = parent::jsonSerialize(); |
|
| 39 | 32 | |
| 40 | - if ($this->minimumDwellTime !== null) { |
|
| 41 | - $data['minimumDwellTime'] = $this->minimumDwellTime; |
|
| 42 | - } |
|
| 33 | + if ($this->componentId !== null) { |
|
| 34 | + $data['componentId'] = $this->componentId; |
|
| 35 | + } |
|
| 43 | 36 | |
| 44 | - return $data; |
|
| 45 | - } |
|
| 37 | + $data['align'] = $this->align->value; |
|
| 38 | + $data['highlightMode'] = $this->highlightMode->value; |
|
| 39 | + |
|
| 40 | + if ($this->minimumDwellTime !== null) { |
|
| 41 | + $data['minimumDwellTime'] = $this->minimumDwellTime; |
|
| 42 | + } |
|
| 43 | + |
|
| 44 | + return $data; |
|
| 45 | + } |
|
| 46 | 46 | } |
@@ -1,30 +1,30 @@ |
||
| 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\StandardCommand; |
|
| 5 | + namespace MaxBeckers\AmazonAlexa\Response\Directives\APL\StandardCommand; |
|
| 6 | 6 | |
| 7 | -class ReinflateCommand extends AbstractStandardCommand |
|
| 8 | -{ |
|
| 9 | - public const TYPE = 'Reinflate'; |
|
| 7 | + class ReinflateCommand extends AbstractStandardCommand |
|
| 8 | + { |
|
| 9 | + public const TYPE = 'Reinflate'; |
|
| 10 | 10 | |
| 11 | - /** |
|
| 11 | + /** |
|
| 12 | 12 | * @param string[]|null $preservedSequencers Array of sequencer names to preserve |
| 13 | 13 | */ |
| 14 | - public function __construct( |
|
| 15 | - public ?array $preservedSequencers = null, |
|
| 16 | - ) { |
|
| 17 | - parent::__construct(self::TYPE); |
|
| 18 | - } |
|
| 14 | + public function __construct( |
|
| 15 | + public ?array $preservedSequencers = null, |
|
| 16 | + ) { |
|
| 17 | + parent::__construct(self::TYPE); |
|
| 18 | + } |
|
| 19 | 19 | |
| 20 | - public function jsonSerialize(): array |
|
| 21 | - { |
|
| 22 | - $data = parent::jsonSerialize(); |
|
| 20 | + public function jsonSerialize(): array |
|
| 21 | + { |
|
| 22 | + $data = parent::jsonSerialize(); |
|
| 23 | 23 | |
| 24 | - if ($this->preservedSequencers !== null && !empty($this->preservedSequencers)) { |
|
| 25 | - $data['preservedSequencers'] = $this->preservedSequencers; |
|
| 26 | - } |
|
| 24 | + if ($this->preservedSequencers !== null && !empty($this->preservedSequencers)) { |
|
| 25 | + $data['preservedSequencers'] = $this->preservedSequencers; |
|
| 26 | + } |
|
| 27 | 27 | |
| 28 | - return $data; |
|
| 29 | - } |
|
| 28 | + return $data; |
|
| 29 | + } |
|
| 30 | 30 | } |