Add a new callback event to the schedule.

@param  string  $callback
@param  array   $parameters
@return \Nova\Console\Scheduling\Event
322590
public function call($callback, array $parameters = array())
    {
        $this->events[] = $event = new CallbackEvent($this->mutex, $callback, $parameters);

        return $event;
    }
279715
public function addListener($name, callable $callback) {
        if(!array_key_exists($name, $this->registered_events)) {
            $this->registered_events[$name] = [];
        }

        $this->registered_events[$name][] = $callback;
    }
750076
public function setCallback($callback)
    {
        // If the provided $value is not a closure, make it one now for easy resolution.
        if (!is_callable($callback)) {
            $callback = function () use ($callback) {
                return $callback;
            };
        }

        if ($this->protected) {
            return $this;
        }

        $this->callback = $callback;

        return $this;
    }
871793
public function registerCallback(callable $callback)
    {
        $this->pipeline
            ->pipe($callback)
            ->process($this->config);

        return $this;
    }
18288
public function calls(callable ...$callbacks): Stub
    {
        foreach ($callbacks as $callback) {
            $this->callsWith($callback);
        }

        return $this;
    }
539535
public function addMiddleware($callback)
    {
        $this->middlewares[] = function (Callable $next, Request $request, Response $response) use ($callback) {
            $container = Container::getInstance();
            $parameters = array_merge([
                "request"   => $request,
                "response"  => $response,
                "next"      => $next
            ], $request->getData());

            $container->call($callback, $parameters);
        };
    }
1216230
protected function add($smOrCallback, $event, $callable = null, array $specs = array())
    {
        if ($smOrCallback instanceof Callback) {
            $this->dispatcher->addListener($event, $smOrCallback);

            return $this;
        }

        trigger_error(
            'Use of CallbackHandler::add without a Callback instance is deprecated and will be removed in 2.0',
            E_USER_DEPRECATED
        );

        $specs = $this->specResolver->resolve($specs);
        $callback = CallbackBuilder::create($smOrCallback, $specs['from'], $specs['to'], $specs['on'], $callable)->getCallback();

        $this->dispatcher->addListener($event, $callback);

        return $this;
    }
304951
public function addCallback(string $name, $callback)
    {
        if (!is_object($callback)) {
            throw new \InvalidArgumentException('Given callback must be an object');
        }

        $this->callbacks[$name] = $callback;
    }
1146579
public function call($callback, $arguments = [])
    {
        $dependencies = $this->getMethodDependencies($callback, $arguments);

        return call_user_func_array($callback, $dependencies);
    }
1374571
public function doTheJob($callback, $params = array()) {
        if (!$callback instanceof CallbackHandler) {
            $callback = new CallbackHandler($callback);
        }
        if (!is_array($params)) {
            $params = array($params);
        }
        $this->callback = $callback;
        $this->callbackParam = $params;
        return $this;
    }
8638
public function setCallback(callable $callback, array $params = [])
    {
        if ($this->hasCallback()) {
            throw new ArchException('Callback already defined');
        }
        $this->callback = $callback;
        $this->callbackParams = $params;
        return $this;
    }
471744
public function addLogger(callable $callback)
    {
        if (!is_callable($callback)) {
            throw LoggerException::forInvalidCallback();
        }

        if ($callback instanceof Closure) {
            $callback = $callback->bindTo($this, get_class($this));
        }

        $this->loggers[] = $callback;

        return $this;
    }
1188185
public function setCallback($callback)
    {
        if (is_array($callback)) {
            require_once 'Zend/Server/Method/Callback.php';
            $callback = new Zend_Server_Method_Callback($callback);
        } elseif (!$callback instanceof Zend_Server_Method_Callback) {
            require_once 'Zend/Server/Exception.php';
            throw new Zend_Server_Exception('Invalid method callback provided');
        }
        $this->_callback = $callback;
        return $this;
    }
1008441
public static function insert($eventName = NULL, $callback = NULL, $priority = NULL) : Event
    {
        Listener::insert($eventName, $callback, $priority);

        return new self;
    }
660278
public function each($callback)
    {
        array_walk($this->array, function($value, $key) use ($callback) {
            $callback($key, $value);
        });

        return $this;
    }
580643
public function setCallback($callback)
    {
        if (!$callback instanceof Closure) {
            throw new Exception\InvalidArgumentException(sprintf(
                'Invalid parameter for callback: must be %s',
                Closure::class
            ));
        }

        return parent::setCallback($callback);
    }
996219
public function callback($function, $params = null)
    {
        $callback = new Callback($function, $params);
        $this->register($callback);

        return $callback;
    }