@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | * |
21 | 21 | * @return Generator|IrcMessage[] |
22 | 22 | */ |
23 | - public function parse(string $message) |
|
23 | + public function parse (string $message) |
|
24 | 24 | { |
25 | 25 | foreach (explode("\n", $message) as $msg) { |
26 | 26 | if (empty(trim($msg))) { |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | * |
39 | 39 | * @return IrcMessage |
40 | 40 | */ |
41 | - private function parseSingle(string $message): IrcMessage |
|
41 | + private function parseSingle (string $message): IrcMessage |
|
42 | 42 | { |
43 | 43 | switch ($this->getCommand($message)) { |
44 | 44 | case 'PING': |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | * |
82 | 82 | * @return string |
83 | 83 | */ |
84 | - private function getCommand(string $message): string |
|
84 | + private function getCommand (string $message): string |
|
85 | 85 | { |
86 | 86 | if ($message[0] === ':') { |
87 | 87 | $message = trim(strstr($message, ' ')); |
@@ -7,7 +7,7 @@ |
||
7 | 7 | /** @var string */ |
8 | 8 | public $nickname; |
9 | 9 | |
10 | - public function __construct(string $nickname) |
|
10 | + public function __construct (string $nickname) |
|
11 | 11 | { |
12 | 12 | $this->nickname = $nickname; |
13 | 13 | } |
@@ -7,7 +7,7 @@ |
||
7 | 7 | /** @var int */ |
8 | 8 | public $floodProtectionDelay; |
9 | 9 | |
10 | - public function __construct() |
|
10 | + public function __construct () |
|
11 | 11 | { |
12 | 12 | $this->floodProtectionDelay = 0; |
13 | 13 | } |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | * @param string $nickname The nickname used on the irc server. |
18 | 18 | * @param string|string[] $channels The channels to join on connection. |
19 | 19 | */ |
20 | - public function __construct(string $nickname = null, $channels = []) |
|
20 | + public function __construct (string $nickname = null, $channels = []) |
|
21 | 21 | { |
22 | 22 | $this->nickname = $nickname; |
23 | 23 | |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | * |
33 | 33 | * @return ConnectionOptions |
34 | 34 | */ |
35 | - public function connectionOptions(): ConnectionOptions |
|
35 | + public function connectionOptions (): ConnectionOptions |
|
36 | 36 | { |
37 | 37 | $options = new ConnectionOptions(); |
38 | 38 | $options->floodProtectionDelay = $this->floodProtectionDelay; |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | /** @var callable[][] */ |
8 | 8 | private $eventHandlers; |
9 | 9 | |
10 | - public function __construct() |
|
10 | + public function __construct () |
|
11 | 11 | { |
12 | 12 | $this->eventHandlers = []; |
13 | 13 | } |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | * @param callable|string $event The name of the event to listen for. Pass a callable to this parameter to catch all events. |
19 | 19 | * @param callable|null $function The callable that will be invoked on event |
20 | 20 | */ |
21 | - public function addHandler($event, ?callable $function): void |
|
21 | + public function addHandler ($event, ?callable $function): void |
|
22 | 22 | { |
23 | 23 | if (is_callable($event)) { |
24 | 24 | $function = $event; |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | * |
38 | 38 | * @param Event $event |
39 | 39 | */ |
40 | - public function invoke(Event $event): void |
|
40 | + public function invoke (Event $event): void |
|
41 | 41 | { |
42 | 42 | $handlers = array_merge($this->eventHandlers['*'] ?? [], $this->eventHandlers[$event->getEvent()] ?? []); |
43 | 43 | foreach ($handlers as $handler) { |
@@ -14,18 +14,18 @@ |
||
14 | 14 | * @param string $event The event that is being emitted. |
15 | 15 | * @param array $arguments The array of arguments to send to the event callback. |
16 | 16 | */ |
17 | - public function __construct(string $event, $arguments = []) |
|
17 | + public function __construct (string $event, $arguments = []) |
|
18 | 18 | { |
19 | 19 | $this->event = $event; |
20 | 20 | $this->arguments = $arguments; |
21 | 21 | } |
22 | 22 | |
23 | - public function getArguments(): array |
|
23 | + public function getArguments (): array |
|
24 | 24 | { |
25 | 25 | return $this->arguments; |
26 | 26 | } |
27 | 27 | |
28 | - public function getEvent(): string |
|
28 | + public function getEvent (): string |
|
29 | 29 | { |
30 | 30 | return $this->event; |
31 | 31 | } |