ts3phpframework
Loading...
Searching...
No Matches
Handler.php
Go to the documentation of this file.
1<?php
2
4
6
14{
20 protected string $signal;
21
27 protected mixed $callback;
28
36 public function __construct(string $signal, mixed $callback)
37 {
38 $this->signal = $signal;
39
40 if (!is_callable($callback)) {
41 throw new SignalException("invalid callback specified for signal '" . $signal . "'");
42 }
43
44 $this->callback = $callback;
45 }
46
53 public function call(array $args = []): mixed
54 {
55 return call_user_func_array($this->callback, $args);
56 }
57}
Enhanced exception class for PlanetTeamSpeak\TeamSpeak3Framework\Helper\Signal\Handler objects.
Helper class providing handler functions for signals.
Definition Handler.php:14