Attach a command handler to the chain

@param   CommandHandlerInterface  $handler  The command handler
@return CommandChain
347299
public function addHandler(CommandHandlerInterface $handler)
    {
        $this->__queue->enqueue($handler, $handler->getPriority());
        return $this;
    }
30901
public function setRequestHandler(RequestHandler $handler)
    {
        $handlerName = $handler->getName();
        $this->handlers[$handlerName] = $handler;
        return $this;
    }
730312
public function middleware($path, $handler = null)
    {
        if ($handler === null) {
            $handler = $path;
            $path = '/';
        }

        $path = $this->normalizePath($path);
        $this->middleware_handlers[$path][] = $handler;

        return $this;
    }
887206
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        $tokenValue = $this->getToken();

        $this->validate($request, $tokenValue);

        // Attach Request Attributes
        $request = $request->withAttribute('csrf_token', $tokenValue);

        /* @var Response $response */
        $response = $handler->handle($request);

        return $this->injectTokenToResponse($response, $tokenValue);
    }
1341026
public function addHandler($name, $handler)
    {
        $tmp        = $this->relationHandlers->getValue($this->entity);
        $tmp[$name] = $handler;
        $this->relationHandlers->setValue($this->entity, $tmp);
    }
831516
public function removeHandler($handler)
    {
        if(!is_callable($handler))
            throw new \InvalidArgumentException("Argument 1 of Event->addHandler needs to be a valid callback");

        $i = array_search($handler, $this->_handlers, true);

        if ($i !== false)
            unset($this->_handlers[$i]);

        return $this;
    }
182053
protected function prepareHandler(HandlerInterface $handler, array $config = [])
    {
        if (! isset($config['formatter'])) {
            $handler->setFormatter($this->formatter());
        } elseif ($config['formatter'] !== 'default') {
            $handler->setFormatter($this->app->make($config['formatter'], $config['formatter_with'] ?? []));
        }

        return $handler;
    }
1340771
public function add_handler( HandlerInterface $handler, $name = NULL ) {

		( $name === null ) and $name = spl_object_hash( $handler );
		if ( ! is_string( $name ) || array_key_exists( $name, $this->handlers ) ) {
			return $this;
		}

		$this->handlers[ $name ] = $handler;

		return $this;
	}
893333
public function process(RequestInterface $request, RequestHandlerInterface $handler)
    {
        $url = $request->getSequentialParam(1);

        $this->router->route($url, 'execute');

        return $handler->handle($request);
    }
331204
public static function forCommand(Command $command, CommandHandler $handler, string $message = ''): self
    {
        return new static(
            sprintf(
                'The command [%s] could not be handled by [%s].  %s',
                $command::schema()->getId()->toString(),
                get_class($handler),
                $message
            ),
            Code::INTERNAL
        );
    }
486075
public function setHandlerPriority(CommandHandlerInterface $handler, $priority)
    {
        $this->__queue->setPriority($handler, $priority);
        return $this;
    }
656888
public function create(callable $handler): callable
    {
        foreach ($this->wrappers as $wrapper) {
            $handler = $wrapper->wrap($handler);
        }

        return $handler;
    }
391632
public function setClassForString(Callable $handler): ColumnInterface
    {
        $this->key = self::ACTION_STRING_TR;
        $this->setHandler($handler);

        return $this;
    }
668910
protected static function createMigration(HandlerInterface $handler)
    {
        $migrator = static::$migrator;
        $notifier = new Notifier();

        $migration = $migrator->createMigration(
            strtolower($handler->getName()),
            $handler->getTemplate(),
            $handler->getReplace()
        );

        $migrator->logSuccessfulMigration($migration);
        $notifier->newMigration($migration);
    }
858816
public function instantiate(string $handler) : EventHandler
    {
        if (false === isset($this->handlers[$handler])) {
            throw new InvalidArgumentException(
                sprintf('Handler %s could not be found. Did you register it?', $handler)
            );
        }

        $callable = $this->handlers[$handler];

        return ($callable instanceof \Closure) ? $callable() : new $callable();
    }
784689
public function withHandler($handler): self
    {
        return tap($this, function ($request) use ($handler) {
            return $this->handler = $handler;
        });
    }
908394
public function setNotFoundHandler($handler) : ClosureAutoBind
    {
        if (!$this->isClosure($handler)) {
            throw new InvalidArgumentException(
                'Handler must be closure'
            );
        }

        $this->notFoundHandler = $handler;

        return $this;
    }