@@ -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 | } |
@@ -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 | |
@@ -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 @@ |
||
| 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 | |
@@ -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 | |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | * |
| 48 | 48 | * @return Keyboard|null |
| 49 | 49 | */ |
| 50 | - public function getKeyboard(): ?Keyboard |
|
| 50 | + public function getKeyboard(): ? Keyboard |
|
| 51 | 51 | { |
| 52 | 52 | return $this->keyboard; |
| 53 | 53 | } |
@@ -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; |
| 6 | 6 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | */ |
| 54 | 54 | private function validateParameters(Channel $channel, Driver $driver): void |
| 55 | 55 | { |
| 56 | - collect($driver->getConfig())->each(function (string $parameter) use ($channel) { |
|
| 56 | + collect($driver->getConfig())->each(function(string $parameter) use ($channel) { |
|
| 57 | 57 | if (!array_key_exists($parameter, $channel->getParameters())) { |
| 58 | 58 | throw new InvalidConfiguration('Invalid `'.$channel->getName().'` channel configuration.'); |
| 59 | 59 | } |
@@ -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\Traits; |
| 6 | 6 | |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | private function prepareContext(array $context): array |
| 35 | 35 | { |
| 36 | 36 | return collect($context) |
| 37 | - ->map(function ($item) { |
|
| 37 | + ->map(function($item) { |
|
| 38 | 38 | if ($item instanceof Arrayable || method_exists($item, 'toArray')) { |
| 39 | 39 | return $item->toArray(); |
| 40 | 40 | } |
@@ -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\Conversation\Traits; |
| 6 | 6 | |
@@ -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\Conversation\Traits; |
| 6 | 6 | |