@@ -1,12 +1,12 @@ |
||
| 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\Document; |
|
| 5 | + namespace MaxBeckers\AmazonAlexa\Response\Directives\APL\Document; |
|
| 6 | 6 | |
| 7 | -enum Display: string |
|
| 8 | -{ |
|
| 9 | - case INVISIBLE = 'invisible'; |
|
| 10 | - case NONE = 'none'; |
|
| 11 | - case NORMAL = 'normal'; |
|
| 7 | + enum Display: string |
|
| 8 | + { |
|
| 9 | + case INVISIBLE = 'invisible'; |
|
| 10 | + case NONE = 'none'; |
|
| 11 | + case NORMAL = 'normal'; |
|
| 12 | 12 | } |
@@ -1,40 +1,40 @@ |
||
| 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\Document; |
|
| 5 | + namespace MaxBeckers\AmazonAlexa\Response\Directives\APL\Document; |
|
| 6 | 6 | |
| 7 | -class Gradient implements \JsonSerializable |
|
| 8 | -{ |
|
| 9 | - /** |
|
| 7 | + class Gradient implements \JsonSerializable |
|
| 8 | + { |
|
| 9 | + /** |
|
| 10 | 10 | * @param string[] $colorRange Array of colors for the gradient |
| 11 | 11 | * @param string $description Description of the gradient |
| 12 | 12 | * @param BackgroundType $type Type of gradient (linear or radial) |
| 13 | 13 | * @param float[]|null $inputRange Array of input range values |
| 14 | 14 | * @param int $angle Angle for linear gradients |
| 15 | 15 | */ |
| 16 | - public function __construct( |
|
| 17 | - public array $colorRange, |
|
| 18 | - public string $description = '', |
|
| 19 | - public BackgroundType $type = BackgroundType::LINEAR, |
|
| 20 | - public ?array $inputRange = [], |
|
| 21 | - public int $angle = 0, |
|
| 22 | - ) { |
|
| 23 | - } |
|
| 16 | + public function __construct( |
|
| 17 | + public array $colorRange, |
|
| 18 | + public string $description = '', |
|
| 19 | + public BackgroundType $type = BackgroundType::LINEAR, |
|
| 20 | + public ?array $inputRange = [], |
|
| 21 | + public int $angle = 0, |
|
| 22 | + ) { |
|
| 23 | + } |
|
| 24 | 24 | |
| 25 | - public function jsonSerialize(): array |
|
| 26 | - { |
|
| 27 | - $data = [ |
|
| 28 | - 'description' => $this->description, |
|
| 29 | - 'colorRange' => $this->colorRange, |
|
| 30 | - 'angle' => $this->angle, |
|
| 31 | - 'type' => $this->type, |
|
| 32 | - ]; |
|
| 25 | + public function jsonSerialize(): array |
|
| 26 | + { |
|
| 27 | + $data = [ |
|
| 28 | + 'description' => $this->description, |
|
| 29 | + 'colorRange' => $this->colorRange, |
|
| 30 | + 'angle' => $this->angle, |
|
| 31 | + 'type' => $this->type, |
|
| 32 | + ]; |
|
| 33 | 33 | |
| 34 | - if ($this->inputRange !== null && count($this->inputRange) > 0) { |
|
| 35 | - $data['inputRange'] = $this->inputRange; |
|
| 36 | - } |
|
| 34 | + if ($this->inputRange !== null && count($this->inputRange) > 0) { |
|
| 35 | + $data['inputRange'] = $this->inputRange; |
|
| 36 | + } |
|
| 37 | 37 | |
| 38 | - return $data; |
|
| 39 | - } |
|
| 38 | + return $data; |
|
| 39 | + } |
|
| 40 | 40 | } |
@@ -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\Document; |
|
| 5 | + namespace MaxBeckers\AmazonAlexa\Response\Directives\APL\Document; |
|
| 6 | 6 | |
| 7 | -enum LayoutParameterType: string |
|
| 8 | -{ |
|
| 9 | - case ANY = 'any'; |
|
| 10 | - case ARRAY = 'array'; |
|
| 11 | - case BOOLEAN = 'boolean'; |
|
| 12 | - case COLOR = 'color'; |
|
| 13 | - case COMPONENT = 'component'; |
|
| 14 | - case DIMENSION = 'dimension'; |
|
| 15 | - case INTEGER = 'integer'; |
|
| 16 | - case MAP = 'map'; |
|
| 17 | - case NUMBER = 'number'; |
|
| 18 | - case OBJECT = 'object'; |
|
| 19 | - case STRING = 'string'; |
|
| 7 | + enum LayoutParameterType: string |
|
| 8 | + { |
|
| 9 | + case ANY = 'any'; |
|
| 10 | + case ARRAY = 'array'; |
|
| 11 | + case BOOLEAN = 'boolean'; |
|
| 12 | + case COLOR = 'color'; |
|
| 13 | + case COMPONENT = 'component'; |
|
| 14 | + case DIMENSION = 'dimension'; |
|
| 15 | + case INTEGER = 'integer'; |
|
| 16 | + case MAP = 'map'; |
|
| 17 | + case NUMBER = 'number'; |
|
| 18 | + case OBJECT = 'object'; |
|
| 19 | + case STRING = 'string'; |
|
| 20 | 20 | } |
@@ -1,11 +1,11 @@ |
||
| 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\Document; |
|
| 5 | + namespace MaxBeckers\AmazonAlexa\Response\Directives\APL\Document; |
|
| 6 | 6 | |
| 7 | -enum BackgroundType: string |
|
| 8 | -{ |
|
| 9 | - case LINEAR = 'linear'; |
|
| 10 | - case RADIAL = 'radial'; |
|
| 7 | + enum BackgroundType: string |
|
| 8 | + { |
|
| 9 | + case LINEAR = 'linear'; |
|
| 10 | + case RADIAL = 'radial'; |
|
| 11 | 11 | } |
@@ -1,51 +1,51 @@ |
||
| 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\Document; |
|
| 5 | + namespace MaxBeckers\AmazonAlexa\Response\Directives\APL\Document; |
|
| 6 | 6 | |
| 7 | -use MaxBeckers\AmazonAlexa\Response\Directives\APL\StandardCommand\AbstractStandardCommand; |
|
| 7 | + use MaxBeckers\AmazonAlexa\Response\Directives\APL\StandardCommand\AbstractStandardCommand; |
|
| 8 | 8 | |
| 9 | -class TickHandler implements \JsonSerializable |
|
| 10 | -{ |
|
| 11 | - public const DEFAULT_MINIMUM_DELAY = 1000; |
|
| 9 | + class TickHandler implements \JsonSerializable |
|
| 10 | + { |
|
| 11 | + public const DEFAULT_MINIMUM_DELAY = 1000; |
|
| 12 | 12 | |
| 13 | - /** |
|
| 13 | + /** |
|
| 14 | 14 | * @param AbstractStandardCommand[] $commands Commands to run during tick events |
| 15 | 15 | * @param string|null $when APL boolean expression controlling whether the handler is active. Null means always active. |
| 16 | 16 | * @param string $description Optional description of this handler |
| 17 | 17 | * @param int $minimumDelay Minimum delay between tick events in milliseconds |
| 18 | 18 | */ |
| 19 | - public function __construct( |
|
| 20 | - public array $commands = [], |
|
| 21 | - public ?string $when = null, |
|
| 22 | - public string $description = '', |
|
| 23 | - public int $minimumDelay = self::DEFAULT_MINIMUM_DELAY, |
|
| 24 | - ) { |
|
| 25 | - // Filter and ensure valid commands |
|
| 26 | - $this->commands = array_values(array_filter( |
|
| 27 | - $this->commands, |
|
| 28 | - static fn ($c) => $c instanceof AbstractStandardCommand |
|
| 29 | - )); |
|
| 30 | - } |
|
| 31 | - |
|
| 32 | - public function jsonSerialize(): array |
|
| 33 | - { |
|
| 34 | - $data = []; |
|
| 35 | - |
|
| 36 | - if ($this->commands !== []) { |
|
| 37 | - $data['commands'] = $this->commands; |
|
| 38 | - } |
|
| 39 | - if ($this->description !== '') { |
|
| 40 | - $data['description'] = $this->description; |
|
| 41 | - } |
|
| 42 | - if ($this->minimumDelay !== self::DEFAULT_MINIMUM_DELAY) { |
|
| 43 | - $data['minimumDelay'] = $this->minimumDelay; |
|
| 44 | - } |
|
| 45 | - if ($this->when !== null && $this->when !== '') { |
|
| 46 | - $data['when'] = $this->when; |
|
| 19 | + public function __construct( |
|
| 20 | + public array $commands = [], |
|
| 21 | + public ?string $when = null, |
|
| 22 | + public string $description = '', |
|
| 23 | + public int $minimumDelay = self::DEFAULT_MINIMUM_DELAY, |
|
| 24 | + ) { |
|
| 25 | + // Filter and ensure valid commands |
|
| 26 | + $this->commands = array_values(array_filter( |
|
| 27 | + $this->commands, |
|
| 28 | + static fn ($c) => $c instanceof AbstractStandardCommand |
|
| 29 | + )); |
|
| 47 | 30 | } |
| 48 | 31 | |
| 49 | - return $data; |
|
| 50 | - } |
|
| 32 | + public function jsonSerialize(): array |
|
| 33 | + { |
|
| 34 | + $data = []; |
|
| 35 | + |
|
| 36 | + if ($this->commands !== []) { |
|
| 37 | + $data['commands'] = $this->commands; |
|
| 38 | + } |
|
| 39 | + if ($this->description !== '') { |
|
| 40 | + $data['description'] = $this->description; |
|
| 41 | + } |
|
| 42 | + if ($this->minimumDelay !== self::DEFAULT_MINIMUM_DELAY) { |
|
| 43 | + $data['minimumDelay'] = $this->minimumDelay; |
|
| 44 | + } |
|
| 45 | + if ($this->when !== null && $this->when !== '') { |
|
| 46 | + $data['when'] = $this->when; |
|
| 47 | + } |
|
| 48 | + |
|
| 49 | + return $data; |
|
| 50 | + } |
|
| 51 | 51 | } |
@@ -1,12 +1,12 @@ |
||
| 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\Document; |
|
| 5 | + namespace MaxBeckers\AmazonAlexa\Response\Directives\APL\Document; |
|
| 6 | 6 | |
| 7 | -enum SecureInputType: string |
|
| 8 | -{ |
|
| 9 | - case DECIMAL_PAD = 'decimalPad'; |
|
| 10 | - case NORMAL = 'normal'; |
|
| 11 | - case NUMBER_PAD = 'numberPad'; |
|
| 7 | + enum SecureInputType: string |
|
| 8 | + { |
|
| 9 | + case DECIMAL_PAD = 'decimalPad'; |
|
| 10 | + case NORMAL = 'normal'; |
|
| 11 | + case NUMBER_PAD = 'numberPad'; |
|
| 12 | 12 | } |
@@ -1,43 +1,43 @@ |
||
| 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\Document; |
|
| 5 | + namespace MaxBeckers\AmazonAlexa\Response\Directives\APL\Document; |
|
| 6 | 6 | |
| 7 | -use MaxBeckers\AmazonAlexa\Response\Directives\APL\StandardCommand\AbstractStandardCommand; |
|
| 7 | + use MaxBeckers\AmazonAlexa\Response\Directives\APL\StandardCommand\AbstractStandardCommand; |
|
| 8 | 8 | |
| 9 | -class VisibilityChangeHandler implements \JsonSerializable |
|
| 10 | -{ |
|
| 11 | - /** |
|
| 9 | + class VisibilityChangeHandler implements \JsonSerializable |
|
| 10 | + { |
|
| 11 | + /** |
|
| 12 | 12 | * @param AbstractStandardCommand[] $commands List of commands to run (evaluated in order). |
| 13 | 13 | * @param string|null $when APL boolean expression controlling whether this handler is considered. If null, treated as 'true'. |
| 14 | 14 | * @param string|null $description Optional description of this handler. |
| 15 | 15 | */ |
| 16 | - public function __construct( |
|
| 17 | - public array $commands = [], |
|
| 18 | - public ?string $when = null, |
|
| 19 | - public ?string $description = null, |
|
| 20 | - ) { |
|
| 21 | - // Filter and ensure valid commands |
|
| 22 | - $this->commands = array_values(array_filter( |
|
| 23 | - $this->commands, |
|
| 24 | - static fn ($c) => $c instanceof AbstractStandardCommand |
|
| 25 | - )); |
|
| 26 | - } |
|
| 27 | - |
|
| 28 | - public function jsonSerialize(): array |
|
| 29 | - { |
|
| 30 | - $data = []; |
|
| 31 | - if ($this->commands !== []) { |
|
| 32 | - $data['commands'] = $this->commands; |
|
| 33 | - } |
|
| 34 | - if ($this->description !== null && $this->description !== '') { |
|
| 35 | - $data['description'] = $this->description; |
|
| 36 | - } |
|
| 37 | - if ($this->when !== null && $this->when !== '') { |
|
| 38 | - $data['when'] = $this->when; |
|
| 16 | + public function __construct( |
|
| 17 | + public array $commands = [], |
|
| 18 | + public ?string $when = null, |
|
| 19 | + public ?string $description = null, |
|
| 20 | + ) { |
|
| 21 | + // Filter and ensure valid commands |
|
| 22 | + $this->commands = array_values(array_filter( |
|
| 23 | + $this->commands, |
|
| 24 | + static fn ($c) => $c instanceof AbstractStandardCommand |
|
| 25 | + )); |
|
| 39 | 26 | } |
| 40 | 27 | |
| 41 | - return $data; |
|
| 42 | - } |
|
| 28 | + public function jsonSerialize(): array |
|
| 29 | + { |
|
| 30 | + $data = []; |
|
| 31 | + if ($this->commands !== []) { |
|
| 32 | + $data['commands'] = $this->commands; |
|
| 33 | + } |
|
| 34 | + if ($this->description !== null && $this->description !== '') { |
|
| 35 | + $data['description'] = $this->description; |
|
| 36 | + } |
|
| 37 | + if ($this->when !== null && $this->when !== '') { |
|
| 38 | + $data['when'] = $this->when; |
|
| 39 | + } |
|
| 40 | + |
|
| 41 | + return $data; |
|
| 42 | + } |
|
| 43 | 43 | } |
@@ -1,13 +1,13 @@ |
||
| 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\Document; |
|
| 5 | + namespace MaxBeckers\AmazonAlexa\Response\Directives\APL\Document; |
|
| 6 | 6 | |
| 7 | -enum ScaleType: string |
|
| 8 | -{ |
|
| 9 | - case NONE = 'none'; |
|
| 10 | - case GROW = 'grow'; |
|
| 11 | - case SHRINK = 'shrink'; |
|
| 12 | - case STRETCH = 'stretch'; |
|
| 7 | + enum ScaleType: string |
|
| 8 | + { |
|
| 9 | + case NONE = 'none'; |
|
| 10 | + case GROW = 'grow'; |
|
| 11 | + case SHRINK = 'shrink'; |
|
| 12 | + case STRETCH = 'stretch'; |
|
| 13 | 13 | } |
@@ -1,47 +1,47 @@ |
||
| 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\Document; |
|
| 5 | + namespace MaxBeckers\AmazonAlexa\Response\Directives\APL\Document; |
|
| 6 | 6 | |
| 7 | -use MaxBeckers\AmazonAlexa\Response\Directives\APL\StandardCommand\AbstractStandardCommand; |
|
| 7 | + use MaxBeckers\AmazonAlexa\Response\Directives\APL\StandardCommand\AbstractStandardCommand; |
|
| 8 | 8 | |
| 9 | -class Command implements \JsonSerializable |
|
| 10 | -{ |
|
| 11 | - /** |
|
| 9 | + class Command implements \JsonSerializable |
|
| 10 | + { |
|
| 11 | + /** |
|
| 12 | 12 | * @param Parameter[]|null $parameters Array of parameter definitions |
| 13 | 13 | * @param AbstractStandardCommand|null $command Single command to run |
| 14 | 14 | * @param AbstractStandardCommand[]|null $commands Array of commands to run |
| 15 | 15 | * @param string|null $description Description of this command |
| 16 | 16 | */ |
| 17 | - public function __construct( |
|
| 18 | - public ?array $parameters = null, |
|
| 19 | - public ?AbstractStandardCommand $command = null, |
|
| 20 | - public ?array $commands = null, |
|
| 21 | - public ?string $description = null, |
|
| 22 | - ) { |
|
| 23 | - } |
|
| 24 | - |
|
| 25 | - public function jsonSerialize(): array |
|
| 26 | - { |
|
| 27 | - $data = []; |
|
| 28 | - |
|
| 29 | - if ($this->parameters !== null) { |
|
| 30 | - $data['parameters'] = $this->parameters; |
|
| 17 | + public function __construct( |
|
| 18 | + public ?array $parameters = null, |
|
| 19 | + public ?AbstractStandardCommand $command = null, |
|
| 20 | + public ?array $commands = null, |
|
| 21 | + public ?string $description = null, |
|
| 22 | + ) { |
|
| 31 | 23 | } |
| 32 | 24 | |
| 33 | - if ($this->command !== null) { |
|
| 34 | - $data['command'] = $this->command; |
|
| 35 | - } |
|
| 25 | + public function jsonSerialize(): array |
|
| 26 | + { |
|
| 27 | + $data = []; |
|
| 36 | 28 | |
| 37 | - if ($this->commands !== null) { |
|
| 38 | - $data['commands'] = $this->commands; |
|
| 39 | - } |
|
| 29 | + if ($this->parameters !== null) { |
|
| 30 | + $data['parameters'] = $this->parameters; |
|
| 31 | + } |
|
| 40 | 32 | |
| 41 | - if ($this->description !== null) { |
|
| 42 | - $data['description'] = $this->description; |
|
| 43 | - } |
|
| 33 | + if ($this->command !== null) { |
|
| 34 | + $data['command'] = $this->command; |
|
| 35 | + } |
|
| 36 | + |
|
| 37 | + if ($this->commands !== null) { |
|
| 38 | + $data['commands'] = $this->commands; |
|
| 39 | + } |
|
| 44 | 40 | |
| 45 | - return $data; |
|
| 46 | - } |
|
| 41 | + if ($this->description !== null) { |
|
| 42 | + $data['description'] = $this->description; |
|
| 43 | + } |
|
| 44 | + |
|
| 45 | + return $data; |
|
| 46 | + } |
|
| 47 | 47 | } |