@@ -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 | } |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | /** @var string[] */ |
14 | 14 | private $users; |
15 | 15 | |
16 | - public function __construct(string $name) |
|
16 | + public function __construct (string $name) |
|
17 | 17 | { |
18 | 18 | $name = trim($name); |
19 | 19 | if (empty($name)) { |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | * |
33 | 33 | * @return string |
34 | 34 | */ |
35 | - public function getName(): string |
|
35 | + public function getName (): string |
|
36 | 36 | { |
37 | 37 | return $this->name; |
38 | 38 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | * |
43 | 43 | * @return null|string |
44 | 44 | */ |
45 | - public function getTopic() |
|
45 | + public function getTopic () |
|
46 | 46 | { |
47 | 47 | return $this->topic; |
48 | 48 | } |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | * |
53 | 53 | * @return string[] |
54 | 54 | */ |
55 | - public function getUsers(): array |
|
55 | + public function getUsers (): array |
|
56 | 56 | { |
57 | 57 | return $this->users; |
58 | 58 | } |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | * |
63 | 63 | * @param string $topic The topic |
64 | 64 | */ |
65 | - public function setTopic(string $topic): void |
|
65 | + public function setTopic (string $topic): void |
|
66 | 66 | { |
67 | 67 | $this->topic = $topic; |
68 | 68 | } |
@@ -73,9 +73,9 @@ discard block |
||
73 | 73 | * |
74 | 74 | * @param string[] $users An array of user names. |
75 | 75 | */ |
76 | - public function setUsers(array $users): void |
|
76 | + public function setUsers (array $users): void |
|
77 | 77 | { |
78 | - $this->users = array_map(function ($user) { |
|
78 | + $this->users = array_map(function($user) { |
|
79 | 79 | if (in_array($user[0], ['+', '@'])) { |
80 | 80 | $user = substr($user, 1); |
81 | 81 | } |