Sets chain successor.

@param CharacterHandler $handler
329038
final public function setSuccessor(CharacterHandler $handler)
    {
        $this->successor = $handler;
        $this->successor->setPrevious($this);
    }
266247
public function replaceHandlers(string $exceptionType, Closure $handler): void
	{
		$this->clearHandlers($exceptionType);

		$this->handle($exceptionType, $handler);
	}
835221
public static function remove_messageinbound_handler($handler) {
        global $DB;

        // Delete Inbound Message datakeys.
        $DB->delete_records('messageinbound_datakeys', array('handler' => $handler->id));

        // Delete Inbound Message handlers.
        $DB->delete_records('messageinbound_handlers', array('id' => $handler->id));
    }
393286
public function handle( $handler = '' ) {
		if ( ! empty( $handler ) ) {
			$this->attribute( 'handler', $handler );
		}

		$this->router->addRoute( $this->router->route( $this->getAttributes() ) );
	}
1025785
public function setHandler($handler = null)
    {
        $this->handler = null !== $handler ? (string)$handler: $handler;

        return $this;
    }
1054736
public function removerHandler(callable $handler) {
        foreach ($this->handlers as $i => $oldHandler) {
            if ($handler == $oldHandler['handler']) {
                unset($this->handlers[$i]);
            }
        }
    }
960069
public function handle(string $exceptionType, $handler): void
	{
		array_unshift($this->handlers, ['exceptionType' => $exceptionType, 'handler' => $handler]);
	}
1310754
protected function addCommand(Command $handler): void
	{
		$handler->setBot($this);
		$command = $handler->getName();
		$this->commands[strtoupper($command)] = $handler;
	}
731863
public static function init ($handler) {
		self::$handler = $handler;
		self::$destructor = new \Analog\Handler\Buffer\Destructor ();

		return function ($info) {
			Buffer::$buffer .= vsprintf (\Analog\Analog::$format, $info);
		};
	}
1358975
public function withHandler(RequestHandlerInterface $handler): self
    {
        $pipeline = clone $this;
        $pipeline->handler = $handler;
        $pipeline->position = 0;

        return $pipeline;
    }
673421
private static function getHandler(string $handler = null)
    {
        if (null === $handler) {
            return null;
        }

        if (!\in_array($handler, self::$handlers, true)) {
            throw new DatabaseException(
                sprintf(
                    'Cannot set "%s" as onDelete or onUpdate. Use one of these instead: "%s"',
                    $handler,
                    implode('", "', self::$handlers)
                )
            );
        }

        return $handler;
    }
12733
public function push($handler)
    {
        if (!$handler) {
            return $this;
        }
        if ($this->next) {
            return $this->next->push($handler);
        }
        if (!$handler instanceof MiddlewareInterface) {
            $handler = new Middleware($handler);
        }
        $this->next = $handler;
        return $this->next;
    }
1272599
final protected function next(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface {
        if ($this->_next) {
            return $this->_next->process($request, $handler);
        }
        return $handler->handle($request);
    }
672927
function setExceptionHandler(callable $handler)
    {
        $ExceptionHandler = new TransferHandle;
        $ExceptionHandler->setWhoopsHandle($handler);
        $this->container->set(SysConst::HTTP_EXCEPTION_HANDLER, $ExceptionHandler);
    }
1259712
public function afterHandlerSelected(AbstractHandler $handler)
    {
        parent::afterHandlerSelected($handler);
        if (false === $this->isRequestCrossOrigin() || !($handler instanceof AbstractRequestHandler)) {
            // since the request isn't cross origin we don't need this plugin to
            // do any processing at all
            return;
        }

        $request = $handler->getRequest();
        if (null === $request) {
            // the CORS plugin only supports handlers with standard requests
            return;
        }
        $requests = array($request);
        if ($handler instanceof BatchRequestHandlerInterface) {
            $requests = $handler->getRequests();
        }
        $this->processRequestsForAccessDenial($requests);

        // let the browser know this domain can make cross origin requests
        @header(self::HEADER_ALLOW_ORIGIN.': '.$_SERVER[self::HEADER_CLIENT_ORIGIN]);
        // do not explicitly block requests that pass a cookie
        @header(self::HEADER_ALLOW_CREDENTIALS.': true');

        if ('OPTIONS' === strtoupper($request->getVerb())) {
            $this->addHeadersForOptionsRequests();
        }
    }
1082955
public function setRequestHandler($handler)
    {
        $this->requestHandler = $handler;

        $this->requestHandler->setUri($this->url)
            ->setMethod($this->method);

        $this->requestHandler->getUri()->setPort($this->port);

        return $this;
    }
467087
public function afterHandlerSelected(AbstractHandler $handler)
    {
        try {
            parent::afterHandlerSelected($handler);
        } catch (UnauthorizedException $e) {
            @header(sprintf('WWW-Authenticate: Basic realm="%s"', $this->realm));
            throw $e;
        }
    }