* @package com.woltlab.wcf * @subpackage system * @category Community Framework */ final class Callback { /** * encapsulated callback * @var callback */ private $callback = null; /** * Creates new instance of Callback. * * @param callback $callback */ public function __construct($callback) { if (!is_callable($callback)) { throw new SystemException('Given callback is not callable.'); } $this->callback = $callback; } /** * Invokes our callback. All parameters are simply passed through. * * @return mixed */ public function __invoke() { return call_user_func_array($this->callback, func_get_args()); } }