@@ -1,39 +1,39 @@ |
||
| 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 Bind implements \JsonSerializable |
|
| 10 | -{ |
|
| 11 | - /** |
|
| 9 | + class Bind implements \JsonSerializable |
|
| 10 | + { |
|
| 11 | + /** |
|
| 12 | 12 | * @param string $name Name of the binding |
| 13 | 13 | * @param mixed $value Value to bind |
| 14 | 14 | * @param BindType $type Type of the binding |
| 15 | 15 | * @param AbstractStandardCommand[] $onChange Commands to run when value changes |
| 16 | 16 | */ |
| 17 | - public function __construct( |
|
| 18 | - public string $name, |
|
| 19 | - public mixed $value, |
|
| 20 | - public BindType $type = BindType::ANY, |
|
| 21 | - public array $onChange = [], |
|
| 22 | - ) { |
|
| 23 | - } |
|
| 17 | + public function __construct( |
|
| 18 | + public string $name, |
|
| 19 | + public mixed $value, |
|
| 20 | + public BindType $type = BindType::ANY, |
|
| 21 | + public array $onChange = [], |
|
| 22 | + ) { |
|
| 23 | + } |
|
| 24 | 24 | |
| 25 | - public function jsonSerialize(): array |
|
| 26 | - { |
|
| 27 | - $data = [ |
|
| 28 | - 'name' => $this->name, |
|
| 29 | - 'value' => $this->value, |
|
| 30 | - 'type' => $this->type->value, |
|
| 31 | - ]; |
|
| 25 | + public function jsonSerialize(): array |
|
| 26 | + { |
|
| 27 | + $data = [ |
|
| 28 | + 'name' => $this->name, |
|
| 29 | + 'value' => $this->value, |
|
| 30 | + 'type' => $this->type->value, |
|
| 31 | + ]; |
|
| 32 | 32 | |
| 33 | - if (!empty($this->onChange)) { |
|
| 34 | - $data['onChange'] = $this->onChange; |
|
| 35 | - } |
|
| 33 | + if (!empty($this->onChange)) { |
|
| 34 | + $data['onChange'] = $this->onChange; |
|
| 35 | + } |
|
| 36 | 36 | |
| 37 | - return $data; |
|
| 38 | - } |
|
| 37 | + return $data; |
|
| 38 | + } |
|
| 39 | 39 | } |
@@ -1,31 +1,31 @@ |
||
| 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 KeyHandler implements \JsonSerializable |
|
| 10 | -{ |
|
| 11 | - /** |
|
| 9 | + class KeyHandler implements \JsonSerializable |
|
| 10 | + { |
|
| 11 | + /** |
|
| 12 | 12 | * @param AbstractStandardCommand[] $commands Commands to run when handler applies |
| 13 | 13 | * @param bool $propagate Whether to propagate the event after handling |
| 14 | 14 | * @param string|null $when APL boolean expression controlling whether this handler is considered |
| 15 | 15 | */ |
| 16 | - public function __construct( |
|
| 17 | - public array $commands = [], |
|
| 18 | - public bool $propagate = false, |
|
| 19 | - public ?string $when = null, |
|
| 20 | - ) { |
|
| 21 | - } |
|
| 16 | + public function __construct( |
|
| 17 | + public array $commands = [], |
|
| 18 | + public bool $propagate = false, |
|
| 19 | + public ?string $when = null, |
|
| 20 | + ) { |
|
| 21 | + } |
|
| 22 | 22 | |
| 23 | - public function jsonSerialize(): array |
|
| 24 | - { |
|
| 25 | - return array_filter([ |
|
| 26 | - 'commands' => $this->commands, |
|
| 27 | - 'propagate' => $this->propagate, |
|
| 28 | - 'when' => $this->when, |
|
| 29 | - ], fn ($value) => $value !== null); |
|
| 30 | - } |
|
| 23 | + public function jsonSerialize(): array |
|
| 24 | + { |
|
| 25 | + return array_filter([ |
|
| 26 | + 'commands' => $this->commands, |
|
| 27 | + 'propagate' => $this->propagate, |
|
| 28 | + 'when' => $this->when, |
|
| 29 | + ], fn ($value) => $value !== null); |
|
| 30 | + } |
|
| 31 | 31 | } |
@@ -1,17 +1,17 @@ |
||
| 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 ControlMediaCommand: string |
|
| 8 | -{ |
|
| 9 | - case PLAY = 'play'; |
|
| 10 | - case PAUSE = 'pause'; |
|
| 11 | - case NEXT = 'next'; |
|
| 12 | - case PREVIOUS = 'previous'; |
|
| 13 | - case REWIND = 'rewind'; |
|
| 14 | - case SEEK = 'seek'; |
|
| 15 | - case SEEK_TO = 'seekTo'; |
|
| 16 | - case SET_TRACK = 'setTrack'; |
|
| 7 | + enum ControlMediaCommand: string |
|
| 8 | + { |
|
| 9 | + case PLAY = 'play'; |
|
| 10 | + case PAUSE = 'pause'; |
|
| 11 | + case NEXT = 'next'; |
|
| 12 | + case PREVIOUS = 'previous'; |
|
| 13 | + case REWIND = 'rewind'; |
|
| 14 | + case SEEK = 'seek'; |
|
| 15 | + case SEEK_TO = 'seekTo'; |
|
| 16 | + case SET_TRACK = 'setTrack'; |
|
| 17 | 17 | } |
@@ -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 Navigation: string |
|
| 8 | -{ |
|
| 9 | - case NORMAL = 'normal'; |
|
| 10 | - case NONE = 'none'; |
|
| 11 | - case WRAP = 'wrap'; |
|
| 12 | - case FORWARD_ONLY = 'forward-only'; |
|
| 7 | + enum Navigation: string |
|
| 8 | + { |
|
| 9 | + case NORMAL = 'normal'; |
|
| 10 | + case NONE = 'none'; |
|
| 11 | + case WRAP = 'wrap'; |
|
| 12 | + case FORWARD_ONLY = 'forward-only'; |
|
| 13 | 13 | } |
@@ -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 AudioTrack: string |
|
| 8 | -{ |
|
| 9 | - case FOREGROUND = 'foreground'; |
|
| 10 | - case BACKGROUND = 'background'; |
|
| 11 | - case NONE = 'none'; |
|
| 7 | + enum AudioTrack: string |
|
| 8 | + { |
|
| 9 | + case FOREGROUND = 'foreground'; |
|
| 10 | + case BACKGROUND = 'background'; |
|
| 11 | + case NONE = 'none'; |
|
| 12 | 12 | } |
@@ -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\Document; |
|
| 5 | + namespace MaxBeckers\AmazonAlexa\Response\Directives\APL\Document; |
|
| 6 | 6 | |
| 7 | -enum JustifyContent: string |
|
| 8 | -{ |
|
| 9 | - case START = 'start'; |
|
| 10 | - case END = 'end'; |
|
| 11 | - case CENTER = 'center'; |
|
| 12 | - case SPACE_BETWEEN = 'spaceBetween'; |
|
| 13 | - case SPACE_AROUND = 'spaceAround'; |
|
| 7 | + enum JustifyContent: string |
|
| 8 | + { |
|
| 9 | + case START = 'start'; |
|
| 10 | + case END = 'end'; |
|
| 11 | + case CENTER = 'center'; |
|
| 12 | + case SPACE_BETWEEN = 'spaceBetween'; |
|
| 13 | + case SPACE_AROUND = 'spaceAround'; |
|
| 14 | 14 | } |
@@ -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 InteractionMode: string |
|
| 8 | -{ |
|
| 9 | - case INLINE = 'INLINE'; |
|
| 10 | - case STANDARD = 'STANDARD'; |
|
| 7 | + enum InteractionMode: string |
|
| 8 | + { |
|
| 9 | + case INLINE = 'INLINE'; |
|
| 10 | + case STANDARD = 'STANDARD'; |
|
| 11 | 11 | } |
@@ -1,14 +1,14 @@ discard block |
||
| 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\AVGItem\AVGItem; |
|
| 7 | + use MaxBeckers\AmazonAlexa\Response\Directives\APL\AVGItem\AVGItem; |
|
| 8 | 8 | |
| 9 | -class Graphic implements \JsonSerializable |
|
| 10 | -{ |
|
| 11 | - /** |
|
| 9 | + class Graphic implements \JsonSerializable |
|
| 10 | + { |
|
| 11 | + /** |
|
| 12 | 12 | * @param int $height Height of the graphic |
| 13 | 13 | * @param int $width Width of the graphic |
| 14 | 14 | * @param array|null $data Array of arbitrary data for inflation |
@@ -27,47 +27,47 @@ discard block |
||
| 27 | 27 | * @param int|null $viewportHeight Viewport height |
| 28 | 28 | * @param int|null $viewportWidth Viewport width |
| 29 | 29 | */ |
| 30 | - public function __construct( |
|
| 31 | - public int $height, |
|
| 32 | - public int $width, |
|
| 33 | - public ?array $data = null, |
|
| 34 | - public string $description = '', |
|
| 35 | - public ?AVGItem $item = null, |
|
| 36 | - public ?array $items = null, |
|
| 37 | - public ?string $lang = null, |
|
| 38 | - public LayoutDirection $layoutDirection = LayoutDirection::LTR, |
|
| 39 | - public array $parameters = [], |
|
| 40 | - public array $resources = [], |
|
| 41 | - public ScaleType $scaleTypeHeight = ScaleType::NONE, |
|
| 42 | - public ScaleType $scaleTypeWidth = ScaleType::NONE, |
|
| 43 | - public array $styles = [], |
|
| 44 | - public string $type = 'AVG', |
|
| 45 | - public string $version = '1.2', |
|
| 46 | - public ?int $viewportHeight = null, |
|
| 47 | - public ?int $viewportWidth = null, |
|
| 48 | - ) { |
|
| 49 | - } |
|
| 30 | + public function __construct( |
|
| 31 | + public int $height, |
|
| 32 | + public int $width, |
|
| 33 | + public ?array $data = null, |
|
| 34 | + public string $description = '', |
|
| 35 | + public ?AVGItem $item = null, |
|
| 36 | + public ?array $items = null, |
|
| 37 | + public ?string $lang = null, |
|
| 38 | + public LayoutDirection $layoutDirection = LayoutDirection::LTR, |
|
| 39 | + public array $parameters = [], |
|
| 40 | + public array $resources = [], |
|
| 41 | + public ScaleType $scaleTypeHeight = ScaleType::NONE, |
|
| 42 | + public ScaleType $scaleTypeWidth = ScaleType::NONE, |
|
| 43 | + public array $styles = [], |
|
| 44 | + public string $type = 'AVG', |
|
| 45 | + public string $version = '1.2', |
|
| 46 | + public ?int $viewportHeight = null, |
|
| 47 | + public ?int $viewportWidth = null, |
|
| 48 | + ) { |
|
| 49 | + } |
|
| 50 | 50 | |
| 51 | - public function jsonSerialize(): array |
|
| 52 | - { |
|
| 53 | - return array_filter([ |
|
| 54 | - 'data' => $this->data, |
|
| 55 | - 'description' => $this->description, |
|
| 56 | - 'height' => $this->height, |
|
| 57 | - 'item' => $this->item, |
|
| 58 | - 'items' => $this->items, |
|
| 59 | - 'lang' => $this->lang, |
|
| 60 | - 'layoutDirection' => $this->layoutDirection, |
|
| 61 | - 'parameters' => $this->parameters, |
|
| 62 | - 'resources' => $this->resources, |
|
| 63 | - 'scaleTypeHeight' => $this->scaleTypeHeight, |
|
| 64 | - 'scaleTypeWidth' => $this->scaleTypeWidth, |
|
| 65 | - 'styles' => $this->styles, |
|
| 66 | - 'type' => $this->type, |
|
| 67 | - 'version' => $this->version, |
|
| 68 | - 'viewportHeight' => $this->viewportHeight, |
|
| 69 | - 'viewportWidth' => $this->viewportWidth, |
|
| 70 | - 'width' => $this->width, |
|
| 71 | - ], fn ($value) => $value !== null && $value !== []); |
|
| 72 | - } |
|
| 51 | + public function jsonSerialize(): array |
|
| 52 | + { |
|
| 53 | + return array_filter([ |
|
| 54 | + 'data' => $this->data, |
|
| 55 | + 'description' => $this->description, |
|
| 56 | + 'height' => $this->height, |
|
| 57 | + 'item' => $this->item, |
|
| 58 | + 'items' => $this->items, |
|
| 59 | + 'lang' => $this->lang, |
|
| 60 | + 'layoutDirection' => $this->layoutDirection, |
|
| 61 | + 'parameters' => $this->parameters, |
|
| 62 | + 'resources' => $this->resources, |
|
| 63 | + 'scaleTypeHeight' => $this->scaleTypeHeight, |
|
| 64 | + 'scaleTypeWidth' => $this->scaleTypeWidth, |
|
| 65 | + 'styles' => $this->styles, |
|
| 66 | + 'type' => $this->type, |
|
| 67 | + 'version' => $this->version, |
|
| 68 | + 'viewportHeight' => $this->viewportHeight, |
|
| 69 | + 'viewportWidth' => $this->viewportWidth, |
|
| 70 | + 'width' => $this->width, |
|
| 71 | + ], fn ($value) => $value !== null && $value !== []); |
|
| 72 | + } |
|
| 73 | 73 | } |
@@ -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 RepeatMode: string |
|
| 8 | -{ |
|
| 9 | - case RESTART = 'restart'; |
|
| 10 | - case REVERSE = 'reverse'; |
|
| 7 | + enum RepeatMode: string |
|
| 8 | + { |
|
| 9 | + case RESTART = 'restart'; |
|
| 10 | + case REVERSE = 'reverse'; |
|
| 11 | 11 | } |