@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace FondBot\Channels\Telegram; |
| 6 | 6 | |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | * |
| 29 | 29 | * @return string|null |
| 30 | 30 | */ |
| 31 | - public function getText(): ?string |
|
| 31 | + public function getText(): ? string |
|
| 32 | 32 | { |
| 33 | 33 | if (Arr::has($this->payload, ['callback_query'])) { |
| 34 | 34 | return Arr::get($this->payload, 'callback_query.message.text'); |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | * |
| 43 | 43 | * @return Location|null |
| 44 | 44 | */ |
| 45 | - public function getLocation(): ?Location |
|
| 45 | + public function getLocation(): ? Location |
|
| 46 | 46 | { |
| 47 | 47 | if (!isset($this->payload['message']['location'])) { |
| 48 | 48 | return null; |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | * |
| 80 | 80 | * @return Attachment|null |
| 81 | 81 | */ |
| 82 | - public function getAttachment(): ?Attachment |
|
| 82 | + public function getAttachment(): ? Attachment |
|
| 83 | 83 | { |
| 84 | 84 | return |
| 85 | 85 | $this->getAudio() ?? |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | * |
| 106 | 106 | * @return string|null |
| 107 | 107 | */ |
| 108 | - public function getData(): ?string |
|
| 108 | + public function getData(): ? string |
|
| 109 | 109 | { |
| 110 | 110 | return $this->hasData() ? Arr::get($this->payload, 'callback_query.data') : null; |
| 111 | 111 | } |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | * |
| 116 | 116 | * @return Attachment|null |
| 117 | 117 | */ |
| 118 | - public function getAudio(): ?Attachment |
|
| 118 | + public function getAudio(): ? Attachment |
|
| 119 | 119 | { |
| 120 | 120 | if (!isset($this->payload['message']['audio'])) { |
| 121 | 121 | return null; |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | * |
| 134 | 134 | * @return Attachment|null |
| 135 | 135 | */ |
| 136 | - public function getDocument(): ?Attachment |
|
| 136 | + public function getDocument(): ? Attachment |
|
| 137 | 137 | { |
| 138 | 138 | if (!isset($this->payload['message']['document'])) { |
| 139 | 139 | return null; |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | * |
| 152 | 152 | * @return Attachment|null |
| 153 | 153 | */ |
| 154 | - public function getPhoto(): ?Attachment |
|
| 154 | + public function getPhoto(): ? Attachment |
|
| 155 | 155 | { |
| 156 | 156 | if (!isset($this->payload['message']['photo'])) { |
| 157 | 157 | return null; |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | * |
| 173 | 173 | * @return Attachment|null |
| 174 | 174 | */ |
| 175 | - public function getSticker(): ?Attachment |
|
| 175 | + public function getSticker(): ? Attachment |
|
| 176 | 176 | { |
| 177 | 177 | if (!isset($this->payload['message']['sticker'])) { |
| 178 | 178 | return null; |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | * |
| 191 | 191 | * @return Attachment|null |
| 192 | 192 | */ |
| 193 | - public function getVideo(): ?Attachment |
|
| 193 | + public function getVideo(): ? Attachment |
|
| 194 | 194 | { |
| 195 | 195 | if (!isset($this->payload['message']['video'])) { |
| 196 | 196 | return null; |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | * |
| 209 | 209 | * @return Attachment|null |
| 210 | 210 | */ |
| 211 | - public function getVoice(): ?Attachment |
|
| 211 | + public function getVoice(): ? Attachment |
|
| 212 | 212 | { |
| 213 | 213 | if (!isset($this->payload['message']['voice'])) { |
| 214 | 214 | return null; |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | * |
| 227 | 227 | * @return array|null |
| 228 | 228 | */ |
| 229 | - public function getContact(): ?array |
|
| 229 | + public function getContact(): ? array |
|
| 230 | 230 | { |
| 231 | 231 | if (!isset($this->payload['message']['contact'])) { |
| 232 | 232 | return null; |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | * |
| 253 | 253 | * @return array|null |
| 254 | 254 | */ |
| 255 | - public function getVenue(): ?array |
|
| 255 | + public function getVenue(): ? array |
|
| 256 | 256 | { |
| 257 | 257 | if (!isset($this->payload['message']['venue'])) { |
| 258 | 258 | return null; |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace FondBot\Channels\VkCommunity; |
| 6 | 6 | |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | * |
| 23 | 23 | * @return string|null |
| 24 | 24 | */ |
| 25 | - public function getText(): ?string |
|
| 25 | + public function getText(): ? string |
|
| 26 | 26 | { |
| 27 | 27 | return $this->payload['body'] ?? null; |
| 28 | 28 | } |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | * |
| 33 | 33 | * @return Location|null |
| 34 | 34 | */ |
| 35 | - public function getLocation(): ?Location |
|
| 35 | + public function getLocation(): ? Location |
|
| 36 | 36 | { |
| 37 | 37 | return null; |
| 38 | 38 | } |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | * |
| 53 | 53 | * @return Attachment|null |
| 54 | 54 | */ |
| 55 | - public function getAttachment(): ?Attachment |
|
| 55 | + public function getAttachment(): ? Attachment |
|
| 56 | 56 | { |
| 57 | 57 | return null; |
| 58 | 58 | } |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | * |
| 73 | 73 | * @return string|null |
| 74 | 74 | */ |
| 75 | - public function getData(): ?string |
|
| 75 | + public function getData(): ? string |
|
| 76 | 76 | { |
| 77 | 77 | return null; |
| 78 | 78 | } |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace FondBot\Channels\Facebook; |
| 6 | 6 | |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | * |
| 23 | 23 | * @return string|null |
| 24 | 24 | */ |
| 25 | - public function getText(): ?string |
|
| 25 | + public function getText(): ? string |
|
| 26 | 26 | { |
| 27 | 27 | return $this->payload['text'] ?? null; |
| 28 | 28 | } |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | * |
| 33 | 33 | * @return Location|null |
| 34 | 34 | */ |
| 35 | - public function getLocation(): ?Location |
|
| 35 | + public function getLocation(): ? Location |
|
| 36 | 36 | { |
| 37 | 37 | if ($location = $this->getAttachmentPayload('location')) { |
| 38 | 38 | return new Location( |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | * |
| 62 | 62 | * @return Attachment|null |
| 63 | 63 | */ |
| 64 | - public function getAttachment(): ?Attachment |
|
| 64 | + public function getAttachment(): ? Attachment |
|
| 65 | 65 | { |
| 66 | 66 | return $this->getImage() |
| 67 | 67 | ?? $this->getAudio() |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | * |
| 85 | 85 | * @return string|null |
| 86 | 86 | */ |
| 87 | - public function getData(): ?string |
|
| 87 | + public function getData(): ? string |
|
| 88 | 88 | { |
| 89 | 89 | return null; |
| 90 | 90 | } |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | * |
| 95 | 95 | * @return Attachment|null |
| 96 | 96 | */ |
| 97 | - public function getImage(): ?Attachment |
|
| 97 | + public function getImage(): ? Attachment |
|
| 98 | 98 | { |
| 99 | 99 | if ($image = $this->getAttachmentPayload('image')) { |
| 100 | 100 | return new Attachment(Attachment::TYPE_IMAGE, $image['url']); |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | * |
| 109 | 109 | * @return Attachment|null |
| 110 | 110 | */ |
| 111 | - public function getAudio(): ?Attachment |
|
| 111 | + public function getAudio(): ? Attachment |
|
| 112 | 112 | { |
| 113 | 113 | if ($audio = $this->getAttachmentPayload('audio')) { |
| 114 | 114 | return new Attachment(Attachment::TYPE_AUDIO, $audio['url']); |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | * |
| 123 | 123 | * @return Attachment|null |
| 124 | 124 | */ |
| 125 | - public function getVideo(): ?Attachment |
|
| 125 | + public function getVideo(): ? Attachment |
|
| 126 | 126 | { |
| 127 | 127 | if ($video = $this->getAttachmentPayload('video')) { |
| 128 | 128 | return new Attachment(Attachment::TYPE_VIDEO, $video['url']); |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | * |
| 137 | 137 | * @return Attachment|null |
| 138 | 138 | */ |
| 139 | - public function getFile(): ?Attachment |
|
| 139 | + public function getFile(): ? Attachment |
|
| 140 | 140 | { |
| 141 | 141 | if ($file = $this->getAttachmentPayload('file')) { |
| 142 | 142 | return new Attachment(Attachment::TYPE_FILE, $file['url']); |
@@ -145,14 +145,14 @@ discard block |
||
| 145 | 145 | return null; |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | - private function getAttachmentPayload(string $type): ?array |
|
| 148 | + private function getAttachmentPayload(string $type): ? array |
|
| 149 | 149 | { |
| 150 | 150 | if (!$attachments = $this->payload['attachments'] ?? null) { |
| 151 | 151 | return null; |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | // Is it real to send many locations or something in one request? |
| 155 | - return collect($attachments)->first(function ($attachment) use ($type) { |
|
| 155 | + return collect($attachments)->first(function($attachment) use ($type) { |
|
| 156 | 156 | return $attachment['type'] === $type; |
| 157 | 157 | })['payload'] ?? null; |
| 158 | 158 | } |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace FondBot\Contracts\Channels; |
| 6 | 6 | |
@@ -14,14 +14,14 @@ discard block |
||
| 14 | 14 | * |
| 15 | 15 | * @return string|null |
| 16 | 16 | */ |
| 17 | - public function getText(): ?string; |
|
| 17 | + public function getText(): ? string; |
|
| 18 | 18 | |
| 19 | 19 | /** |
| 20 | 20 | * Get location. |
| 21 | 21 | * |
| 22 | 22 | * @return Location|null |
| 23 | 23 | */ |
| 24 | - public function getLocation(): ?Location; |
|
| 24 | + public function getLocation(): ? Location; |
|
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | 27 | * Determine if message has attachment. |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | * |
| 36 | 36 | * @return Attachment|null |
| 37 | 37 | */ |
| 38 | - public function getAttachment(): ?Attachment; |
|
| 38 | + public function getAttachment(): ? Attachment; |
|
| 39 | 39 | |
| 40 | 40 | /** |
| 41 | 41 | * Determine if message has payload. |
@@ -49,5 +49,5 @@ discard block |
||
| 49 | 49 | * |
| 50 | 50 | * @return string|null |
| 51 | 51 | */ |
| 52 | - public function getData(): ?string; |
|
| 52 | + public function getData(): ? string; |
|
| 53 | 53 | } |