@@ -10,8 +10,7 @@ |
||
10 | 10 | use MaxBeckers\AmazonAlexa\RequestHandler\AbstractRequestHandler; |
11 | 11 | use MaxBeckers\AmazonAlexa\Response\Response; |
12 | 12 | |
13 | -class FallbackRequestHandler extends AbstractRequestHandler |
|
14 | -{ |
|
13 | +class FallbackRequestHandler extends AbstractRequestHandler { |
|
15 | 14 | public function __construct( |
16 | 15 | private readonly ResponseHelper $responseHelper, |
17 | 16 | private readonly string $output, |
@@ -1,34 +1,34 @@ |
||
1 | -<?php |
|
1 | + <?php |
|
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | + declare(strict_types=1); |
|
4 | 4 | |
5 | -namespace MaxBeckers\AmazonAlexa\RequestHandler\Basic; |
|
5 | + namespace MaxBeckers\AmazonAlexa\RequestHandler\Basic; |
|
6 | 6 | |
7 | -use MaxBeckers\AmazonAlexa\Helper\ResponseHelper; |
|
8 | -use MaxBeckers\AmazonAlexa\Request\Request; |
|
9 | -use MaxBeckers\AmazonAlexa\Request\Request\Standard\IntentRequest; |
|
10 | -use MaxBeckers\AmazonAlexa\RequestHandler\AbstractRequestHandler; |
|
11 | -use MaxBeckers\AmazonAlexa\Response\Response; |
|
7 | + use MaxBeckers\AmazonAlexa\Helper\ResponseHelper; |
|
8 | + use MaxBeckers\AmazonAlexa\Request\Request; |
|
9 | + use MaxBeckers\AmazonAlexa\Request\Request\Standard\IntentRequest; |
|
10 | + use MaxBeckers\AmazonAlexa\RequestHandler\AbstractRequestHandler; |
|
11 | + use MaxBeckers\AmazonAlexa\Response\Response; |
|
12 | 12 | |
13 | -class FallbackRequestHandler extends AbstractRequestHandler |
|
14 | -{ |
|
15 | - public function __construct( |
|
16 | - private readonly ResponseHelper $responseHelper, |
|
17 | - private readonly string $output, |
|
18 | - array $supportedApplicationIds |
|
19 | - ) { |
|
20 | - parent::__construct(); |
|
21 | - $this->supportedApplicationIds = $supportedApplicationIds; |
|
22 | - } |
|
23 | - |
|
24 | - public function supportsRequest(Request $request): bool |
|
13 | + class FallbackRequestHandler extends AbstractRequestHandler |
|
25 | 14 | { |
26 | - // support amazon fallback request, amazon default intents are prefixed with "AMAZON." |
|
27 | - return $request->request instanceof IntentRequest && 'AMAZON.FallbackIntent' === $request->request->intent->name; |
|
28 | - } |
|
15 | + public function __construct( |
|
16 | + private readonly ResponseHelper $responseHelper, |
|
17 | + private readonly string $output, |
|
18 | + array $supportedApplicationIds |
|
19 | + ) { |
|
20 | + parent::__construct(); |
|
21 | + $this->supportedApplicationIds = $supportedApplicationIds; |
|
22 | + } |
|
29 | 23 | |
30 | - public function handleRequest(Request $request): Response |
|
31 | - { |
|
32 | - return $this->responseHelper->respond($this->output, true); |
|
33 | - } |
|
24 | + public function supportsRequest(Request $request): bool |
|
25 | + { |
|
26 | + // support amazon fallback request, amazon default intents are prefixed with "AMAZON." |
|
27 | + return $request->request instanceof IntentRequest && 'AMAZON.FallbackIntent' === $request->request->intent->name; |
|
28 | + } |
|
29 | + |
|
30 | + public function handleRequest(Request $request): Response |
|
31 | + { |
|
32 | + return $this->responseHelper->respond($this->output, true); |
|
33 | + } |
|
34 | 34 | } |
@@ -10,8 +10,7 @@ |
||
10 | 10 | use MaxBeckers\AmazonAlexa\RequestHandler\AbstractRequestHandler; |
11 | 11 | use MaxBeckers\AmazonAlexa\Response\Response; |
12 | 12 | |
13 | -class CancelRequestHandler extends AbstractRequestHandler |
|
14 | -{ |
|
13 | +class CancelRequestHandler extends AbstractRequestHandler { |
|
15 | 14 | public function __construct( |
16 | 15 | private readonly ResponseHelper $responseHelper, |
17 | 16 | private readonly string $output, |
@@ -1,34 +1,34 @@ |
||
1 | -<?php |
|
1 | + <?php |
|
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | + declare(strict_types=1); |
|
4 | 4 | |
5 | -namespace MaxBeckers\AmazonAlexa\RequestHandler\Basic; |
|
5 | + namespace MaxBeckers\AmazonAlexa\RequestHandler\Basic; |
|
6 | 6 | |
7 | -use MaxBeckers\AmazonAlexa\Helper\ResponseHelper; |
|
8 | -use MaxBeckers\AmazonAlexa\Request\Request; |
|
9 | -use MaxBeckers\AmazonAlexa\Request\Request\Standard\IntentRequest; |
|
10 | -use MaxBeckers\AmazonAlexa\RequestHandler\AbstractRequestHandler; |
|
11 | -use MaxBeckers\AmazonAlexa\Response\Response; |
|
7 | + use MaxBeckers\AmazonAlexa\Helper\ResponseHelper; |
|
8 | + use MaxBeckers\AmazonAlexa\Request\Request; |
|
9 | + use MaxBeckers\AmazonAlexa\Request\Request\Standard\IntentRequest; |
|
10 | + use MaxBeckers\AmazonAlexa\RequestHandler\AbstractRequestHandler; |
|
11 | + use MaxBeckers\AmazonAlexa\Response\Response; |
|
12 | 12 | |
13 | -class CancelRequestHandler extends AbstractRequestHandler |
|
14 | -{ |
|
15 | - public function __construct( |
|
16 | - private readonly ResponseHelper $responseHelper, |
|
17 | - private readonly string $output, |
|
18 | - array $supportedApplicationIds |
|
19 | - ) { |
|
20 | - parent::__construct(); |
|
21 | - $this->supportedApplicationIds = $supportedApplicationIds; |
|
22 | - } |
|
23 | - |
|
24 | - public function supportsRequest(Request $request): bool |
|
13 | + class CancelRequestHandler extends AbstractRequestHandler |
|
25 | 14 | { |
26 | - // support amazon cancel request, amazon default intents are prefixed with "AMAZON." |
|
27 | - return $request->request instanceof IntentRequest && 'AMAZON.CancelIntent' === $request->request->intent->name; |
|
28 | - } |
|
15 | + public function __construct( |
|
16 | + private readonly ResponseHelper $responseHelper, |
|
17 | + private readonly string $output, |
|
18 | + array $supportedApplicationIds |
|
19 | + ) { |
|
20 | + parent::__construct(); |
|
21 | + $this->supportedApplicationIds = $supportedApplicationIds; |
|
22 | + } |
|
29 | 23 | |
30 | - public function handleRequest(Request $request): Response |
|
31 | - { |
|
32 | - return $this->responseHelper->respond($this->output, true); |
|
33 | - } |
|
24 | + public function supportsRequest(Request $request): bool |
|
25 | + { |
|
26 | + // support amazon cancel request, amazon default intents are prefixed with "AMAZON." |
|
27 | + return $request->request instanceof IntentRequest && 'AMAZON.CancelIntent' === $request->request->intent->name; |
|
28 | + } |
|
29 | + |
|
30 | + public function handleRequest(Request $request): Response |
|
31 | + { |
|
32 | + return $this->responseHelper->respond($this->output, true); |
|
33 | + } |
|
34 | 34 | } |
@@ -4,8 +4,7 @@ |
||
4 | 4 | |
5 | 5 | namespace MaxBeckers\AmazonAlexa\Response\Directives\System; |
6 | 6 | |
7 | -class Error |
|
8 | -{ |
|
7 | +class Error { |
|
9 | 8 | public const MEDIA_ERROR_UNKNOWN = 'MEDIA_ERROR_UNKNOWN'; |
10 | 9 | public const MEDIA_ERROR_INVALID_REQUEST = 'MEDIA_ERROR_INVALID_REQUEST'; |
11 | 10 | public const MEDIA_ERROR_SERVICE_UNAVAILABLE = 'MEDIA_ERROR_SERVICE_UNAVAILABLE'; |
@@ -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\Directives\System; |
|
5 | + namespace MaxBeckers\AmazonAlexa\Response\Directives\System; |
|
6 | 6 | |
7 | -class Error |
|
8 | -{ |
|
9 | - public const MEDIA_ERROR_UNKNOWN = 'MEDIA_ERROR_UNKNOWN'; |
|
10 | - public const MEDIA_ERROR_INVALID_REQUEST = 'MEDIA_ERROR_INVALID_REQUEST'; |
|
11 | - public const MEDIA_ERROR_SERVICE_UNAVAILABLE = 'MEDIA_ERROR_SERVICE_UNAVAILABLE'; |
|
12 | - public const MEDIA_ERROR_INTERNAL_SERVER_ERROR = 'MEDIA_ERROR_INTERNAL_SERVER_ERROR'; |
|
13 | - public const MEDIA_ERROR_INTERNAL_DEVICE_ERROR = 'MEDIA_ERROR_INTERNAL_DEVICE_ERROR'; |
|
7 | + class Error |
|
8 | + { |
|
9 | + public const MEDIA_ERROR_UNKNOWN = 'MEDIA_ERROR_UNKNOWN'; |
|
10 | + public const MEDIA_ERROR_INVALID_REQUEST = 'MEDIA_ERROR_INVALID_REQUEST'; |
|
11 | + public const MEDIA_ERROR_SERVICE_UNAVAILABLE = 'MEDIA_ERROR_SERVICE_UNAVAILABLE'; |
|
12 | + public const MEDIA_ERROR_INTERNAL_SERVER_ERROR = 'MEDIA_ERROR_INTERNAL_SERVER_ERROR'; |
|
13 | + public const MEDIA_ERROR_INTERNAL_DEVICE_ERROR = 'MEDIA_ERROR_INTERNAL_DEVICE_ERROR'; |
|
14 | 14 | |
15 | - public function __construct( |
|
16 | - public string $type = '', |
|
17 | - public string $message = '' |
|
18 | - ) { |
|
19 | - } |
|
15 | + public function __construct( |
|
16 | + public string $type = '', |
|
17 | + public string $message = '' |
|
18 | + ) { |
|
19 | + } |
|
20 | 20 | |
21 | - public static function create(string $type, string $message): self |
|
22 | - { |
|
23 | - return new self($type, $message); |
|
24 | - } |
|
21 | + public static function create(string $type, string $message): self |
|
22 | + { |
|
23 | + return new self($type, $message); |
|
24 | + } |
|
25 | 25 | } |
@@ -6,8 +6,7 @@ |
||
6 | 6 | |
7 | 7 | use MaxBeckers\AmazonAlexa\Response\Directives\Directive; |
8 | 8 | |
9 | -class ClearDirective extends Directive |
|
10 | -{ |
|
9 | +class ClearDirective extends Directive { |
|
11 | 10 | public const TYPE = 'AudioPlayer.ClearQueue'; |
12 | 11 | |
13 | 12 | public const CLEAR_BEHAVIOR_CLEAR_ENQUEUED = 'CLEAR_ENQUEUED'; |
@@ -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\AudioPlayer; |
|
5 | + namespace MaxBeckers\AmazonAlexa\Response\Directives\AudioPlayer; |
|
6 | 6 | |
7 | -use MaxBeckers\AmazonAlexa\Response\Directives\Directive; |
|
7 | + use MaxBeckers\AmazonAlexa\Response\Directives\Directive; |
|
8 | 8 | |
9 | -class ClearDirective extends Directive |
|
10 | -{ |
|
11 | - public const TYPE = 'AudioPlayer.ClearQueue'; |
|
9 | + class ClearDirective extends Directive |
|
10 | + { |
|
11 | + public const TYPE = 'AudioPlayer.ClearQueue'; |
|
12 | 12 | |
13 | - public const CLEAR_BEHAVIOR_CLEAR_ENQUEUED = 'CLEAR_ENQUEUED'; |
|
14 | - public const CLEAR_BEHAVIOR_CLEAR_ALL = 'CLEAR_ALL'; |
|
13 | + public const CLEAR_BEHAVIOR_CLEAR_ENQUEUED = 'CLEAR_ENQUEUED'; |
|
14 | + public const CLEAR_BEHAVIOR_CLEAR_ALL = 'CLEAR_ALL'; |
|
15 | 15 | |
16 | - public function __construct( |
|
17 | - public ?string $clearBehavior = null |
|
18 | - ) { |
|
19 | - parent::__construct(self::TYPE); |
|
20 | - } |
|
16 | + public function __construct( |
|
17 | + public ?string $clearBehavior = null |
|
18 | + ) { |
|
19 | + parent::__construct(self::TYPE); |
|
20 | + } |
|
21 | 21 | |
22 | - public static function create(string $behavior): self |
|
23 | - { |
|
24 | - return new self($behavior); |
|
25 | - } |
|
22 | + public static function create(string $behavior): self |
|
23 | + { |
|
24 | + return new self($behavior); |
|
25 | + } |
|
26 | 26 | } |
@@ -4,8 +4,7 @@ |
||
4 | 4 | |
5 | 5 | namespace MaxBeckers\AmazonAlexa\Response\Directives\AudioPlayer; |
6 | 6 | |
7 | -class CurrentPlaybackState |
|
8 | -{ |
|
7 | +class CurrentPlaybackState { |
|
9 | 8 | public const PLAYER_ACTIVITY_PLAYING = 'PLAYING'; |
10 | 9 | public const PLAYER_ACTIVITY_PAUSED = 'PAUSED'; |
11 | 10 | public const PLAYER_ACTIVITY_FINISHED = 'FINISHED'; |
@@ -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\AudioPlayer; |
|
5 | + namespace MaxBeckers\AmazonAlexa\Response\Directives\AudioPlayer; |
|
6 | 6 | |
7 | -class CurrentPlaybackState |
|
8 | -{ |
|
9 | - public const PLAYER_ACTIVITY_PLAYING = 'PLAYING'; |
|
10 | - public const PLAYER_ACTIVITY_PAUSED = 'PAUSED'; |
|
11 | - public const PLAYER_ACTIVITY_FINISHED = 'FINISHED'; |
|
12 | - public const PLAYER_ACTIVITY_BUFFER_UNDERRUN = 'BUFFER_UNDERRUN'; |
|
13 | - public const PLAYER_ACTIVITY_IDLE = 'IDLE'; |
|
7 | + class CurrentPlaybackState |
|
8 | + { |
|
9 | + public const PLAYER_ACTIVITY_PLAYING = 'PLAYING'; |
|
10 | + public const PLAYER_ACTIVITY_PAUSED = 'PAUSED'; |
|
11 | + public const PLAYER_ACTIVITY_FINISHED = 'FINISHED'; |
|
12 | + public const PLAYER_ACTIVITY_BUFFER_UNDERRUN = 'BUFFER_UNDERRUN'; |
|
13 | + public const PLAYER_ACTIVITY_IDLE = 'IDLE'; |
|
14 | 14 | |
15 | - public function __construct( |
|
16 | - public string $token = '', |
|
17 | - public int $offsetInMilliseconds = 0, |
|
18 | - public string $playerActivity = '' |
|
19 | - ) { |
|
20 | - } |
|
15 | + public function __construct( |
|
16 | + public string $token = '', |
|
17 | + public int $offsetInMilliseconds = 0, |
|
18 | + public string $playerActivity = '' |
|
19 | + ) { |
|
20 | + } |
|
21 | 21 | |
22 | - public static function create(string $token, int $offsetInMilliseconds, string $playerActivity): self |
|
23 | - { |
|
24 | - return new self($token, $offsetInMilliseconds, $playerActivity); |
|
25 | - } |
|
22 | + public static function create(string $token, int $offsetInMilliseconds, string $playerActivity): self |
|
23 | + { |
|
24 | + return new self($token, $offsetInMilliseconds, $playerActivity); |
|
25 | + } |
|
26 | 26 | } |
@@ -6,8 +6,7 @@ |
||
6 | 6 | |
7 | 7 | use MaxBeckers\AmazonAlexa\Response\Directives\Directive; |
8 | 8 | |
9 | -class PlayDirective extends Directive |
|
10 | -{ |
|
9 | +class PlayDirective extends Directive { |
|
11 | 10 | public const TYPE = 'AudioPlayer.Play'; |
12 | 11 | |
13 | 12 | public const PLAY_BEHAVIOR_REPLACE_ALL = 'REPLACE_ALL'; |
@@ -1,28 +1,28 @@ |
||
1 | -<?php |
|
1 | + <?php |
|
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | + declare(strict_types=1); |
|
4 | 4 | |
5 | -namespace MaxBeckers\AmazonAlexa\Response\Directives\AudioPlayer; |
|
5 | + namespace MaxBeckers\AmazonAlexa\Response\Directives\AudioPlayer; |
|
6 | 6 | |
7 | -use MaxBeckers\AmazonAlexa\Response\Directives\Directive; |
|
7 | + use MaxBeckers\AmazonAlexa\Response\Directives\Directive; |
|
8 | 8 | |
9 | -class PlayDirective extends Directive |
|
10 | -{ |
|
11 | - public const TYPE = 'AudioPlayer.Play'; |
|
9 | + class PlayDirective extends Directive |
|
10 | + { |
|
11 | + public const TYPE = 'AudioPlayer.Play'; |
|
12 | 12 | |
13 | - public const PLAY_BEHAVIOR_REPLACE_ALL = 'REPLACE_ALL'; |
|
14 | - public const PLAY_BEHAVIOR_ENQUEUE = 'ENQUEUE'; |
|
15 | - public const PLAY_BEHAVIOR_REPLACE_ENQUEUED = 'REPLACE_ENQUEUED'; |
|
13 | + public const PLAY_BEHAVIOR_REPLACE_ALL = 'REPLACE_ALL'; |
|
14 | + public const PLAY_BEHAVIOR_ENQUEUE = 'ENQUEUE'; |
|
15 | + public const PLAY_BEHAVIOR_REPLACE_ENQUEUED = 'REPLACE_ENQUEUED'; |
|
16 | 16 | |
17 | - public function __construct( |
|
18 | - public ?string $playBehavior = null, |
|
19 | - public ?AudioItem $audioItem = null |
|
20 | - ) { |
|
21 | - parent::__construct(self::TYPE); |
|
22 | - } |
|
17 | + public function __construct( |
|
18 | + public ?string $playBehavior = null, |
|
19 | + public ?AudioItem $audioItem = null |
|
20 | + ) { |
|
21 | + parent::__construct(self::TYPE); |
|
22 | + } |
|
23 | 23 | |
24 | - public static function create(AudioItem $audioItem, string $playBehavior = self::PLAY_BEHAVIOR_REPLACE_ALL): self |
|
25 | - { |
|
26 | - return new self($playBehavior, $audioItem); |
|
27 | - } |
|
24 | + public static function create(AudioItem $audioItem, string $playBehavior = self::PLAY_BEHAVIOR_REPLACE_ALL): self |
|
25 | + { |
|
26 | + return new self($playBehavior, $audioItem); |
|
27 | + } |
|
28 | 28 | } |
@@ -4,8 +4,7 @@ |
||
4 | 4 | |
5 | 5 | namespace MaxBeckers\AmazonAlexa\Response\Directives\GameEngine; |
6 | 6 | |
7 | -class Event |
|
8 | -{ |
|
7 | +class Event { |
|
9 | 8 | public const REPORTS_HISTORY = 'history'; |
10 | 9 | public const REPORTS_MATCHES = 'matches'; |
11 | 10 | public const REPORTS_NOTHING = 'nothing'; |
@@ -1,27 +1,27 @@ |
||
1 | -<?php |
|
1 | + <?php |
|
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | + declare(strict_types=1); |
|
4 | 4 | |
5 | -namespace MaxBeckers\AmazonAlexa\Response\Directives\GameEngine; |
|
5 | + namespace MaxBeckers\AmazonAlexa\Response\Directives\GameEngine; |
|
6 | 6 | |
7 | -class Event |
|
8 | -{ |
|
9 | - public const REPORTS_HISTORY = 'history'; |
|
10 | - public const REPORTS_MATCHES = 'matches'; |
|
11 | - public const REPORTS_NOTHING = 'nothing'; |
|
7 | + class Event |
|
8 | + { |
|
9 | + public const REPORTS_HISTORY = 'history'; |
|
10 | + public const REPORTS_MATCHES = 'matches'; |
|
11 | + public const REPORTS_NOTHING = 'nothing'; |
|
12 | 12 | |
13 | - public function __construct( |
|
14 | - public array $meets = [], |
|
15 | - public ?array $fails = null, |
|
16 | - public ?string $reports = null, |
|
17 | - public ?bool $shouldEndInputHandler = null, |
|
18 | - public ?int $maximumInvocations = null, |
|
19 | - public ?int $triggerTimeMilliseconds = null |
|
20 | - ) { |
|
21 | - } |
|
13 | + public function __construct( |
|
14 | + public array $meets = [], |
|
15 | + public ?array $fails = null, |
|
16 | + public ?string $reports = null, |
|
17 | + public ?bool $shouldEndInputHandler = null, |
|
18 | + public ?int $maximumInvocations = null, |
|
19 | + public ?int $triggerTimeMilliseconds = null |
|
20 | + ) { |
|
21 | + } |
|
22 | 22 | |
23 | - public static function create(array $meets, bool $shouldEndInputHandler, ?array $fails = null, ?string $reports = null, ?int $maximumInvocations = null, ?int $triggerTimeMilliseconds = null): self |
|
24 | - { |
|
25 | - return new self($meets, $fails, $reports, $shouldEndInputHandler, $maximumInvocations, $triggerTimeMilliseconds); |
|
26 | - } |
|
23 | + public static function create(array $meets, bool $shouldEndInputHandler, ?array $fails = null, ?string $reports = null, ?int $maximumInvocations = null, ?int $triggerTimeMilliseconds = null): self |
|
24 | + { |
|
25 | + return new self($meets, $fails, $reports, $shouldEndInputHandler, $maximumInvocations, $triggerTimeMilliseconds); |
|
26 | + } |
|
27 | 27 | } |
@@ -4,8 +4,7 @@ |
||
4 | 4 | |
5 | 5 | namespace MaxBeckers\AmazonAlexa\Response\Directives\GameEngine; |
6 | 6 | |
7 | -class Pattern |
|
8 | -{ |
|
7 | +class Pattern { |
|
9 | 8 | public const ACTION_DOWN = 'down'; |
10 | 9 | public const ACTION_UP = 'up'; |
11 | 10 | public const ACTION_SILENCE = 'silence'; |
@@ -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\Directives\GameEngine; |
|
5 | + namespace MaxBeckers\AmazonAlexa\Response\Directives\GameEngine; |
|
6 | 6 | |
7 | -class Pattern |
|
8 | -{ |
|
9 | - public const ACTION_DOWN = 'down'; |
|
10 | - public const ACTION_UP = 'up'; |
|
11 | - public const ACTION_SILENCE = 'silence'; |
|
7 | + class Pattern |
|
8 | + { |
|
9 | + public const ACTION_DOWN = 'down'; |
|
10 | + public const ACTION_UP = 'up'; |
|
11 | + public const ACTION_SILENCE = 'silence'; |
|
12 | 12 | |
13 | - public function __construct( |
|
14 | - public ?array $gadgetIds = null, |
|
15 | - public ?array $colors = null, |
|
16 | - public ?string $action = null, |
|
17 | - public ?int $repeat = null |
|
18 | - ) { |
|
19 | - } |
|
13 | + public function __construct( |
|
14 | + public ?array $gadgetIds = null, |
|
15 | + public ?array $colors = null, |
|
16 | + public ?string $action = null, |
|
17 | + public ?int $repeat = null |
|
18 | + ) { |
|
19 | + } |
|
20 | 20 | |
21 | - public static function create(?string $action = null, ?array $gadgetIds = null, ?array $colors = null, ?int $repeat = null): self |
|
22 | - { |
|
23 | - return new self($gadgetIds, $colors, $action, $repeat); |
|
24 | - } |
|
21 | + public static function create(?string $action = null, ?array $gadgetIds = null, ?array $colors = null, ?int $repeat = null): self |
|
22 | + { |
|
23 | + return new self($gadgetIds, $colors, $action, $repeat); |
|
24 | + } |
|
25 | 25 | } |
@@ -4,8 +4,7 @@ |
||
4 | 4 | |
5 | 5 | namespace MaxBeckers\AmazonAlexa\Response\Directives\GameEngine; |
6 | 6 | |
7 | -class RecognizerMatch extends Recognizer |
|
8 | -{ |
|
7 | +class RecognizerMatch extends Recognizer { |
|
9 | 8 | public const TYPE = 'match'; |
10 | 9 | public const ANCHOR_START = 'start'; |
11 | 10 | public const ANCHOR_END = 'end'; |
@@ -1,28 +1,28 @@ 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\GameEngine; |
|
5 | + namespace MaxBeckers\AmazonAlexa\Response\Directives\GameEngine; |
|
6 | 6 | |
7 | -class RecognizerMatch extends Recognizer |
|
8 | -{ |
|
9 | - public const TYPE = 'match'; |
|
10 | - public const ANCHOR_START = 'start'; |
|
11 | - public const ANCHOR_END = 'end'; |
|
12 | - public const ANCHOR_ANYWHERE = 'anywhere'; |
|
7 | + class RecognizerMatch extends Recognizer |
|
8 | + { |
|
9 | + public const TYPE = 'match'; |
|
10 | + public const ANCHOR_START = 'start'; |
|
11 | + public const ANCHOR_END = 'end'; |
|
12 | + public const ANCHOR_ANYWHERE = 'anywhere'; |
|
13 | 13 | |
14 | - /** @param Pattern[] $pattern */ |
|
15 | - public function __construct( |
|
16 | - public ?string $anchor = null, |
|
17 | - public ?bool $fuzzy = null, |
|
18 | - public ?array $gadgetIds = null, |
|
19 | - public ?array $actions = null, |
|
20 | - public array $pattern = [] |
|
21 | - ) { |
|
22 | - parent::__construct(self::TYPE); |
|
23 | - } |
|
14 | + /** @param Pattern[] $pattern */ |
|
15 | + public function __construct( |
|
16 | + public ?string $anchor = null, |
|
17 | + public ?bool $fuzzy = null, |
|
18 | + public ?array $gadgetIds = null, |
|
19 | + public ?array $actions = null, |
|
20 | + public array $pattern = [] |
|
21 | + ) { |
|
22 | + parent::__construct(self::TYPE); |
|
23 | + } |
|
24 | 24 | |
25 | - /** |
|
25 | + /** |
|
26 | 26 | * @param Pattern[] $pattern |
27 | 27 | * @param string $anchor |
28 | 28 | * @param bool $fuzzy |
@@ -31,8 +31,8 @@ discard block |
||
31 | 31 | * |
32 | 32 | * @return RecognizerMatch |
33 | 33 | */ |
34 | - public static function create(array $pattern, string $anchor = self::ANCHOR_START, bool $fuzzy = false, ?array $gadgetIds = null, ?array $actions = null): self |
|
35 | - { |
|
36 | - return new self($anchor, $fuzzy, $gadgetIds, $actions, $pattern); |
|
37 | - } |
|
34 | + public static function create(array $pattern, string $anchor = self::ANCHOR_START, bool $fuzzy = false, ?array $gadgetIds = null, ?array $actions = null): self |
|
35 | + { |
|
36 | + return new self($anchor, $fuzzy, $gadgetIds, $actions, $pattern); |
|
37 | + } |
|
38 | 38 | } |