@@ -5,7 +5,7 @@ |
||
5 | 5 | * For the full copyright and license information, please view the LICENSE |
6 | 6 | * file that was distributed with this source code. |
7 | 7 | */ |
8 | -declare(strict_types=1); |
|
8 | +declare(strict_types = 1); |
|
9 | 9 | |
10 | 10 | namespace Karma\System\Gitter\Message; |
11 | 11 |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | * For the full copyright and license information, please view the LICENSE |
6 | 6 | * file that was distributed with this source code. |
7 | 7 | */ |
8 | -declare(strict_types=1); |
|
8 | +declare(strict_types = 1); |
|
9 | 9 | |
10 | 10 | namespace Karma\System\Gitter\Message; |
11 | 11 | |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | $html = mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8'); |
63 | 63 | |
64 | 64 | $dom = new \DOMDocument('1.0', 'UTF-8'); |
65 | - $dom->loadHTML('<html>' . $html . '</html>', LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD); |
|
65 | + $dom->loadHTML('<html>'.$html.'</html>', LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD); |
|
66 | 66 | |
67 | 67 | return $dom; |
68 | 68 | } |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | * For the full copyright and license information, please view the LICENSE |
6 | 6 | * file that was distributed with this source code. |
7 | 7 | */ |
8 | -declare(strict_types=1); |
|
8 | +declare(strict_types = 1); |
|
9 | 9 | |
10 | 10 | namespace Karma\System\Gitter; |
11 | 11 | |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public function __construct(string $token) |
51 | 51 | { |
52 | - if (! class_exists(Client::class)) { |
|
52 | + if (!class_exists(Client::class)) { |
|
53 | 53 | throw new \DomainException('"serafim/gitter-api": "~4.0" required'); |
54 | 54 | } |
55 | 55 | |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | * @param LoopInterface $loop |
70 | 70 | * @param null|LoggerInterface $logger |
71 | 71 | */ |
72 | - public function onRegister(LoopInterface $loop, ?LoggerInterface $logger): void |
|
72 | + public function onRegister(LoopInterface $loop, ? LoggerInterface $logger) : void |
|
73 | 73 | { |
74 | 74 | $this->client->loop($loop); |
75 | 75 | $this->client->logger($logger); |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | if ($this->auth === null) { |
99 | 99 | $data = $this->client->authUser(); |
100 | 100 | |
101 | - $this->auth = $this->getUser($data['id'], function () use ($data) { |
|
101 | + $this->auth = $this->getUser($data['id'], function() use ($data) { |
|
102 | 102 | return new GitterUser($this, $data); |
103 | 103 | }); |
104 | 104 | } |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | */ |
133 | 133 | public function channel(string $channelId): ChannelInterface |
134 | 134 | { |
135 | - return $this->getChannel($channelId, function () use ($channelId): ChannelInterface { |
|
135 | + return $this->getChannel($channelId, function() use ($channelId): ChannelInterface { |
|
136 | 136 | $data = $this->client->rooms->join($channelId); |
137 | 137 | |
138 | 138 | return new GitterChannel($this, $data); |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | * For the full copyright and license information, please view the LICENSE |
6 | 6 | * file that was distributed with this source code. |
7 | 7 | */ |
8 | -declare(strict_types=1); |
|
8 | +declare(strict_types = 1); |
|
9 | 9 | |
10 | 10 | namespace Karma\System\Gitter; |
11 | 11 | |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | /** |
45 | 45 | * @param null|string $avatar |
46 | 46 | */ |
47 | - public function setAvatar(?string $avatar): void |
|
47 | + public function setAvatar(? string $avatar) : void |
|
48 | 48 | { |
49 | 49 | $this->avatar = $avatar; |
50 | 50 | } |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | * For the full copyright and license information, please view the LICENSE |
6 | 6 | * file that was distributed with this source code. |
7 | 7 | */ |
8 | -declare(strict_types=1); |
|
8 | +declare(strict_types = 1); |
|
9 | 9 | |
10 | 10 | namespace Karma\System\Gitter; |
11 | 11 | |
@@ -36,11 +36,11 @@ discard block |
||
36 | 36 | { |
37 | 37 | /** @var GitterSystem|AbstractSystem $system */ |
38 | 38 | $system = $channel->getSystem(); |
39 | - $mentions = $this->parseMentions($system, (array)($data['mentions'] ?? [])); |
|
39 | + $mentions = $this->parseMentions($system, (array) ($data['mentions'] ?? [])); |
|
40 | 40 | $user = $this->getUserFromMessage($system, $data['fromUser']); |
41 | 41 | $body = $system->getTransformer()->parse($data['html'], $mentions); |
42 | 42 | |
43 | - $system->info($data['html'] . "\n" . ' -> ' . "\n" . $body); |
|
43 | + $system->info($data['html']."\n".' -> '."\n".$body); |
|
44 | 44 | |
45 | 45 | parent::__construct($channel, $user, $data['id'], $body); |
46 | 46 | |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | continue; |
63 | 63 | } |
64 | 64 | |
65 | - $mentions[] = $system->getUser($mention['userId'], function () use ($system, $mention) { |
|
65 | + $mentions[] = $system->getUser($mention['userId'], function() use ($system, $mention) { |
|
66 | 66 | return new GitterUser($system, $mention); |
67 | 67 | }); |
68 | 68 | } |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | private function getUserFromMessage(SystemInterface $system, array $data): UserInterface |
79 | 79 | { |
80 | 80 | /** @var GitterUser $user */ |
81 | - $user = $system->getUser($data['id'], function () use ($system, $data): UserInterface { |
|
81 | + $user = $system->getUser($data['id'], function() use ($system, $data): UserInterface { |
|
82 | 82 | return new GitterUser($system, $data); |
83 | 83 | }); |
84 | 84 |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | * For the full copyright and license information, please view the LICENSE |
6 | 6 | * file that was distributed with this source code. |
7 | 7 | */ |
8 | -declare(strict_types=1); |
|
8 | +declare(strict_types = 1); |
|
9 | 9 | |
10 | 10 | namespace Karma\System\Gitter; |
11 | 11 | |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | |
100 | 100 | $observer = $system->getClient()->rooms->messages($this->getId()); |
101 | 101 | |
102 | - $observer->subscribe(function (array $data) use ($then) { |
|
102 | + $observer->subscribe(function(array $data) use ($then) { |
|
103 | 103 | $then(new GitterMessage($this, $data)); |
104 | 104 | }); |
105 | 105 | } |