| @@ 20-38 (lines=19) @@ | ||
| 17 | * |
|
| 18 | * @author Artem Henvald <[email protected]> |
|
| 19 | */ |
|
| 20 | final class HistoryRemoveCommand extends AbstractCommand |
|
| 21 | { |
|
| 22 | use ChannelCommandTrait; |
|
| 23 | ||
| 24 | /** |
|
| 25 | * @param string $channel |
|
| 26 | */ |
|
| 27 | public function __construct(string $channel) |
|
| 28 | { |
|
| 29 | $this->channel = $channel; |
|
| 30 | ||
| 31 | parent::__construct( |
|
| 32 | Method::HISTORY_REMOVE, |
|
| 33 | [ |
|
| 34 | 'channel' => $channel, |
|
| 35 | ] |
|
| 36 | ); |
|
| 37 | } |
|
| 38 | } |
|
| 39 | ||
| @@ 20-40 (lines=21) @@ | ||
| 17 | * |
|
| 18 | * @author Artem Henvald <[email protected]> |
|
| 19 | */ |
|
| 20 | final class PublishCommand extends AbstractCommand |
|
| 21 | { |
|
| 22 | use ChannelCommandTrait; |
|
| 23 | ||
| 24 | /** |
|
| 25 | * @param array $data |
|
| 26 | * @param string $channel |
|
| 27 | */ |
|
| 28 | public function __construct(array $data, string $channel) |
|
| 29 | { |
|
| 30 | $this->channel = $channel; |
|
| 31 | ||
| 32 | parent::__construct( |
|
| 33 | Method::PUBLISH, |
|
| 34 | [ |
|
| 35 | 'channel' => $channel, |
|
| 36 | 'data' => $data, |
|
| 37 | ] |
|
| 38 | ); |
|
| 39 | } |
|
| 40 | } |
|
| 41 | ||
| @@ 20-40 (lines=21) @@ | ||
| 17 | * |
|
| 18 | * @author Artem Henvald <[email protected]> |
|
| 19 | */ |
|
| 20 | final class UnsubscribeCommand extends AbstractCommand |
|
| 21 | { |
|
| 22 | use ChannelCommandTrait; |
|
| 23 | ||
| 24 | /** |
|
| 25 | * @param string $user |
|
| 26 | * @param string $channel |
|
| 27 | */ |
|
| 28 | public function __construct(string $user, string $channel) |
|
| 29 | { |
|
| 30 | $this->channel = $channel; |
|
| 31 | ||
| 32 | parent::__construct( |
|
| 33 | Method::UNSUBSCRIBE, |
|
| 34 | [ |
|
| 35 | 'channel' => $channel, |
|
| 36 | 'user' => $user, |
|
| 37 | ] |
|
| 38 | ); |
|
| 39 | } |
|
| 40 | } |
|
| 41 | ||