5 use wcf\system\exception\SystemException
;
8 * Represents a callback
10 * @author Tim Duesterhus
11 * @copyright 2001-2019 WoltLab GmbH
12 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
13 * @deprecated since 3.0, use callables and `callable` type hint directly
18 * encapsulated callback
24 * Creates new instance of Callback.
26 * @param callback $callback
27 * @throws SystemException
29 public function __construct($callback)
31 if (!\
is_callable($callback)) {
32 throw new SystemException('Given callback is not callable.');
35 $this->callback
= $callback;
39 * Invokes our callback. All parameters are simply passed through.
43 public function __invoke()
45 return \
call_user_func_array($this->callback
, \func_get_args
());