@@ -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 | if ($name[0] !== '#') { |
| 19 | 19 | $name = "#$name"; |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | * |
| 28 | 28 | * @return string |
| 29 | 29 | */ |
| 30 | - public function getName(): string |
|
| 30 | + public function getName (): string |
|
| 31 | 31 | { |
| 32 | 32 | return $this->name; |
| 33 | 33 | } |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | * |
| 38 | 38 | * @return null|string |
| 39 | 39 | */ |
| 40 | - public function getTopic() |
|
| 40 | + public function getTopic () |
|
| 41 | 41 | { |
| 42 | 42 | return $this->topic; |
| 43 | 43 | } |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | * |
| 48 | 48 | * @return string[] |
| 49 | 49 | */ |
| 50 | - public function getUsers(): array |
|
| 50 | + public function getUsers (): array |
|
| 51 | 51 | { |
| 52 | 52 | return $this->users; |
| 53 | 53 | } |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | * |
| 58 | 58 | * @param string $topic The topic |
| 59 | 59 | */ |
| 60 | - public function setTopic(string $topic): void |
|
| 60 | + public function setTopic (string $topic): void |
|
| 61 | 61 | { |
| 62 | 62 | $this->topic = $topic; |
| 63 | 63 | } |
@@ -68,9 +68,9 @@ discard block |
||
| 68 | 68 | * |
| 69 | 69 | * @param string[] $users An array of user names. |
| 70 | 70 | */ |
| 71 | - public function setUsers(array $users): void |
|
| 71 | + public function setUsers (array $users): void |
|
| 72 | 72 | { |
| 73 | - $this->users = array_map(function ($user) { |
|
| 73 | + $this->users = array_map(function($user) { |
|
| 74 | 74 | if (in_array($user[0], ['+', '@'])) { |
| 75 | 75 | $user = substr($user, 1); |
| 76 | 76 | } |