Passed
Push — master ( 43aca1...5a3864 )
by Maximilian
03:27
created
src/Response/Directives/APL/RenderDocumentDirective.php 1 patch
Switch Indentation   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -1,57 +1,57 @@
 block discarded – undo
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
-use MaxBeckers\AmazonAlexa\Response\Directives\APL\Document\APLDocument;
8
-use MaxBeckers\AmazonAlexa\Response\Directives\Directive;
7
+    use MaxBeckers\AmazonAlexa\Response\Directives\APL\Document\APLDocument;
8
+    use MaxBeckers\AmazonAlexa\Response\Directives\Directive;
9 9
 
10
-class RenderDocumentDirective extends Directive implements \JsonSerializable
11
-{
12
-    public const TYPE = 'Alexa.Presentation.APL.RenderDocument';
10
+    class RenderDocumentDirective extends Directive implements \JsonSerializable
11
+    {
12
+        public const TYPE = 'Alexa.Presentation.APL.RenderDocument';
13 13
 
14
-    /**
14
+        /**
15 15
      * @param APLDocument $document The APL document to render
16 16
      * @param string $token Unique token for this directive
17 17
      * @param array<string,array>|null $sources Map of additional documents or references to documents
18 18
      * @param array<string,array>|null $datasources Map of data source objects for data binding
19 19
      */
20
-    public function __construct(
21
-        public APLDocument $document,
22
-        public string $token,
23
-        public array $sources = [],
24
-        public array $datasources = [],
25
-    ) {
26
-        parent::__construct(self::TYPE);
27
-    }
28
-
29
-    public function setSource(string $name, array $data): void
30
-    {
31
-        $this->sources[$name] = $data;
32
-    }
33
-
34
-    public function setDatasource(string $name, array $data): void
35
-    {
36
-        $this->datasources[$name] = $data;
37
-    }
20
+        public function __construct(
21
+            public APLDocument $document,
22
+            public string $token,
23
+            public array $sources = [],
24
+            public array $datasources = [],
25
+        ) {
26
+            parent::__construct(self::TYPE);
27
+        }
38 28
 
39
-    public function jsonSerialize(): array
40
-    {
41
-        $data = [
42
-            'type' => self::TYPE,
43
-            'token' => $this->token,
44
-            'document' => $this->document,
45
-        ];
46
-
47
-        if ($this->sources !== null && $this->sources !== []) {
48
-            $data['sources'] = $this->sources;
29
+        public function setSource(string $name, array $data): void
30
+        {
31
+            $this->sources[$name] = $data;
49 32
         }
50 33
 
51
-        if ($this->datasources !== null && $this->datasources !== []) {
52
-            $data['datasources'] = $this->datasources;
34
+        public function setDatasource(string $name, array $data): void
35
+        {
36
+            $this->datasources[$name] = $data;
53 37
         }
54 38
 
55
-        return $data;
56
-    }
39
+        public function jsonSerialize(): array
40
+        {
41
+            $data = [
42
+                'type' => self::TYPE,
43
+                'token' => $this->token,
44
+                'document' => $this->document,
45
+            ];
46
+
47
+            if ($this->sources !== null && $this->sources !== []) {
48
+                $data['sources'] = $this->sources;
49
+            }
50
+
51
+            if ($this->datasources !== null && $this->datasources !== []) {
52
+                $data['datasources'] = $this->datasources;
53
+            }
54
+
55
+            return $data;
56
+        }
57 57
 }
Please login to merge, or discard this patch.
src/Response/ResponseBody.php 1 patch
Switch Indentation   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -1,52 +1,52 @@
 block discarded – undo
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
-    /** @param Directive[] $directives */
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
+        /** @param Directive[] $directives */
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
 }
Please login to merge, or discard this patch.
src/Response/Directives/Display/Image.php 1 patch
Switch Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -1,25 +1,25 @@
 block discarded – undo
1
-<?php
1
+    <?php
2 2
 
3
-declare(strict_types=1);
3
+    declare(strict_types=1);
4 4
 
5
-namespace MaxBeckers\AmazonAlexa\Response\Directives\Display;
5
+    namespace MaxBeckers\AmazonAlexa\Response\Directives\Display;
6 6
 
7
-class Image
8
-{
9
-    /** @param ImageSource[] $sources */
10
-    public function __construct(
11
-        public ?string $contentDescription = null,
12
-        public array $sources = []
13
-    ) {
14
-    }
15
-
16
-    public static function create(?string $contentDescription = null, array $imageSources = []): self
7
+    class Image
17 8
     {
18
-        return new self($contentDescription, $imageSources);
19
-    }
9
+        /** @param ImageSource[] $sources */
10
+        public function __construct(
11
+            public ?string $contentDescription = null,
12
+            public array $sources = []
13
+        ) {
14
+        }
20 15
 
21
-    public function addImageSource(ImageSource $imageSource): void
22
-    {
23
-        $this->sources[] = $imageSource;
24
-    }
16
+        public static function create(?string $contentDescription = null, array $imageSources = []): self
17
+        {
18
+            return new self($contentDescription, $imageSources);
19
+        }
20
+
21
+        public function addImageSource(ImageSource $imageSource): void
22
+        {
23
+            $this->sources[] = $imageSource;
24
+        }
25 25
 }
Please login to merge, or discard this patch.
src/Response/Directives/VideoApp/VideoLaunchDirective.php 1 patch
Switch Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -1,23 +1,23 @@
 block discarded – undo
1
-<?php
1
+    <?php
2 2
 
3
-declare(strict_types=1);
3
+    declare(strict_types=1);
4 4
 
5
-namespace MaxBeckers\AmazonAlexa\Response\Directives\VideoApp;
5
+    namespace MaxBeckers\AmazonAlexa\Response\Directives\VideoApp;
6 6
 
7
-use MaxBeckers\AmazonAlexa\Response\Directives\Directive;
7
+    use MaxBeckers\AmazonAlexa\Response\Directives\Directive;
8 8
 
9
-class VideoLaunchDirective extends Directive
10
-{
11
-    public const TYPE = 'VideoApp.Launch';
9
+    class VideoLaunchDirective extends Directive
10
+    {
11
+        public const TYPE = 'VideoApp.Launch';
12 12
 
13
-    public function __construct(
14
-        public ?VideoItem $videoItem = null
15
-    ) {
16
-        parent::__construct(self::TYPE);
17
-    }
13
+        public function __construct(
14
+            public ?VideoItem $videoItem = null
15
+        ) {
16
+            parent::__construct(self::TYPE);
17
+        }
18 18
 
19
-    public static function create(?VideoItem $videoItem = null): self
20
-    {
21
-        return new self($videoItem);
22
-    }
19
+        public static function create(?VideoItem $videoItem = null): self
20
+        {
21
+            return new self($videoItem);
22
+        }
23 23
 }
Please login to merge, or discard this patch.