@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace FondBot\Channels\Exceptions; |
| 6 | 6 | |
@@ -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 | } |
@@ -1,6 +1,6 @@ |
||
| 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 | |
@@ -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 | |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | * |
| 31 | 31 | * @return string|null |
| 32 | 32 | */ |
| 33 | - public function getName(): ?string |
|
| 33 | + public function getName(): ? string |
|
| 34 | 34 | { |
| 35 | 35 | return $this->payload['first_name'].' '.$this->payload['last_name']; |
| 36 | 36 | } |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | * |
| 41 | 41 | * @return string|null |
| 42 | 42 | */ |
| 43 | - public function getUsername(): ?string |
|
| 43 | + public function getUsername(): ? string |
|
| 44 | 44 | { |
| 45 | 45 | return null; |
| 46 | 46 | } |
@@ -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 | |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | * |
| 47 | 47 | * @return Keyboard|null |
| 48 | 48 | */ |
| 49 | - public function getKeyboard(): ?Keyboard |
|
| 49 | + public function getKeyboard(): ? Keyboard |
|
| 50 | 50 | { |
| 51 | 51 | return $this->keyboard; |
| 52 | 52 | } |
@@ -1,6 +1,6 @@ |
||
| 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 | |
@@ -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 | |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | * |
| 28 | 28 | * @return string|null |
| 29 | 29 | */ |
| 30 | - public function getText(): ?string |
|
| 30 | + public function getText(): ? string |
|
| 31 | 31 | { |
| 32 | 32 | return $this->payload['text'] ?? null; |
| 33 | 33 | } |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | * |
| 38 | 38 | * @return Location|null |
| 39 | 39 | */ |
| 40 | - public function getLocation(): ?Location |
|
| 40 | + public function getLocation(): ? Location |
|
| 41 | 41 | { |
| 42 | 42 | if (!isset($this->payload['location'])) { |
| 43 | 43 | return null; |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | * |
| 75 | 75 | * @return Attachment|null |
| 76 | 76 | */ |
| 77 | - public function getAttachment(): ?Attachment |
|
| 77 | + public function getAttachment(): ? Attachment |
|
| 78 | 78 | { |
| 79 | 79 | return |
| 80 | 80 | $this->getAudio() ?? |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | * |
| 91 | 91 | * @return Attachment|null |
| 92 | 92 | */ |
| 93 | - public function getAudio(): ?Attachment |
|
| 93 | + public function getAudio(): ? Attachment |
|
| 94 | 94 | { |
| 95 | 95 | if (!isset($this->payload['audio'])) { |
| 96 | 96 | return null; |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | * |
| 109 | 109 | * @return Attachment|null |
| 110 | 110 | */ |
| 111 | - public function getDocument(): ?Attachment |
|
| 111 | + public function getDocument(): ? Attachment |
|
| 112 | 112 | { |
| 113 | 113 | if (!isset($this->payload['document'])) { |
| 114 | 114 | return null; |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | * |
| 127 | 127 | * @return Attachment|null |
| 128 | 128 | */ |
| 129 | - public function getPhoto(): ?Attachment |
|
| 129 | + public function getPhoto(): ? Attachment |
|
| 130 | 130 | { |
| 131 | 131 | if (!isset($this->payload['photo'])) { |
| 132 | 132 | return null; |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | * |
| 148 | 148 | * @return Attachment|null |
| 149 | 149 | */ |
| 150 | - public function getSticker(): ?Attachment |
|
| 150 | + public function getSticker(): ? Attachment |
|
| 151 | 151 | { |
| 152 | 152 | if (!isset($this->payload['sticker'])) { |
| 153 | 153 | return null; |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | * |
| 166 | 166 | * @return Attachment|null |
| 167 | 167 | */ |
| 168 | - public function getVideo(): ?Attachment |
|
| 168 | + public function getVideo(): ? Attachment |
|
| 169 | 169 | { |
| 170 | 170 | if (!isset($this->payload['video'])) { |
| 171 | 171 | return null; |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | * |
| 184 | 184 | * @return Attachment|null |
| 185 | 185 | */ |
| 186 | - public function getVoice(): ?Attachment |
|
| 186 | + public function getVoice(): ? Attachment |
|
| 187 | 187 | { |
| 188 | 188 | if (!isset($this->payload['voice'])) { |
| 189 | 189 | return null; |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | * |
| 202 | 202 | * @return array|null |
| 203 | 203 | */ |
| 204 | - public function getContact(): ?array |
|
| 204 | + public function getContact(): ? array |
|
| 205 | 205 | { |
| 206 | 206 | if (!isset($this->payload['contact'])) { |
| 207 | 207 | return null; |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | * |
| 228 | 228 | * @return array|null |
| 229 | 229 | */ |
| 230 | - public function getVenue(): ?array |
|
| 230 | + public function getVenue(): ? array |
|
| 231 | 231 | { |
| 232 | 232 | if (!isset($this->payload['venue'])) { |
| 233 | 233 | 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\Telegram; |
| 6 | 6 | |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | * |
| 31 | 31 | * @return string|null |
| 32 | 32 | */ |
| 33 | - public function getName(): ?string |
|
| 33 | + public function getName(): ? string |
|
| 34 | 34 | { |
| 35 | 35 | return $this->payload['first_name'].' '.$this->payload['last_name']; |
| 36 | 36 | } |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | * |
| 41 | 41 | * @return string|null |
| 42 | 42 | */ |
| 43 | - public function getUsername(): ?string |
|
| 43 | + public function getUsername(): ? string |
|
| 44 | 44 | { |
| 45 | 45 | return $this->payload['username']; |
| 46 | 46 | } |
@@ -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() |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | * |
| 75 | 75 | * @return Attachment|null |
| 76 | 76 | */ |
| 77 | - public function getImage(): ?Attachment |
|
| 77 | + public function getImage(): ? Attachment |
|
| 78 | 78 | { |
| 79 | 79 | if ($image = $this->getAttachmentPayload('image')) { |
| 80 | 80 | return new Attachment(Attachment::TYPE_IMAGE, $image['url']); |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | * |
| 89 | 89 | * @return Attachment|null |
| 90 | 90 | */ |
| 91 | - public function getAudio(): ?Attachment |
|
| 91 | + public function getAudio(): ? Attachment |
|
| 92 | 92 | { |
| 93 | 93 | if ($audio = $this->getAttachmentPayload('audio')) { |
| 94 | 94 | return new Attachment(Attachment::TYPE_AUDIO, $audio['url']); |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | * |
| 103 | 103 | * @return Attachment|null |
| 104 | 104 | */ |
| 105 | - public function getVideo(): ?Attachment |
|
| 105 | + public function getVideo(): ? Attachment |
|
| 106 | 106 | { |
| 107 | 107 | if ($video = $this->getAttachmentPayload('video')) { |
| 108 | 108 | return new Attachment(Attachment::TYPE_VIDEO, $video['url']); |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | * |
| 117 | 117 | * @return Attachment|null |
| 118 | 118 | */ |
| 119 | - public function getFile(): ?Attachment |
|
| 119 | + public function getFile(): ? Attachment |
|
| 120 | 120 | { |
| 121 | 121 | if ($file = $this->getAttachmentPayload('file')) { |
| 122 | 122 | return new Attachment(Attachment::TYPE_FILE, $file['url']); |
@@ -125,14 +125,14 @@ discard block |
||
| 125 | 125 | return null; |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | - private function getAttachmentPayload(string $type): ?array |
|
| 128 | + private function getAttachmentPayload(string $type): ? array |
|
| 129 | 129 | { |
| 130 | 130 | if (!$attachments = $this->payload['attachments'] ?? null) { |
| 131 | 131 | return null; |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | // Is it real to send many locations or something in one request? |
| 135 | - return collect($attachments)->first(function ($attachment) use ($type) { |
|
| 135 | + return collect($attachments)->first(function($attachment) use ($type) { |
|
| 136 | 136 | return $attachment['type'] === $type; |
| 137 | 137 | })['payload'] ?? null; |
| 138 | 138 | } |