@param RuleInterface $next

@return RuleInterface
15881
protected static function isString(RuleInterface $next = null): RuleInterface
    {
        return $next === null ? new AsString() : new AndOperator(new AsString(), $next);
    }
462506
public function handle($request, HandlerInterface $next)
    {
        if ($this->isEmpty()) {
            return $request;
        }
        if ($this->shadow == false) {
            $bundle = clone $this;
            $bundle->store->setIteratorMode(SplDoublyLinkedList::IT_MODE_FIFO | SplDoublyLinkedList::IT_MODE_DELETE);
            $this->shadow = true;

            return $next->handle($request, $bundle);
        }
        $handler = $this->frontPop();

        return $handler->handle($request, $this);
    }
805307
public function handle($request, Closure $next)
    {
        if( auth()->check() ) {
            $user = auth()->user();
            $user->updateLastActivity();
        }

        return $next($request);
    }
430922
public static function toOneRelationship(string $type, RuleInterface $next = null): RuleInterface
    {
        $primary = new ToOneRelationshipTypeCheckerRule($type);

        return $next === null ? $primary : new AndOperator($primary, $next);
    }
760350
public function process(ServerRequestInterface $request, RequestHandlerInterface $next) : ResponseInterface
    {
        $response = $next->handle($request);
        $memory = $this->getPeakMemory() . ' kbyte';

        return $response->withHeader(self::HEADER, $memory);
    }
993563
public static function readableAll(string $apiClass, RuleInterface $next = null): RuleInterface
    {
        $primary = new AreReadableViaApiRule($apiClass);

        return $next === null ? $primary : new AndOperator($primary, $next);
    }
1041407
public function execute($command, callable $next)
    {
        $cmd = new SwitchedCommand();
        $cmd->message = new TextTemplate();
        $cmd->message->text = 'SwitchingMiddleware';
        $cmd->input = $command->input;

        $command['switchTo'] = $cmd;

        return $next($command);
    }
775688
protected static function isFloat(RuleInterface $next = null): RuleInterface
    {
        return $next === null ? new AsFloat() : new AndOperator(new AsFloat(), $next);
    }
312293
protected static function isArray(RuleInterface $next = null): RuleInterface
    {
        return $next === null ? new AsArray() : new AndOperator(new AsArray(), $next);
    }
616110
protected static function stringLengthMin(int $min, RuleInterface $next = null): RuleInterface
    {
        return $next === null ?
            new StringLengthMin($min) :
            new AndOperator(static::stringLengthMin($min), $next);
    }
563334
protected static function stringToDateTime(string $format, RuleInterface $next = null): RuleInterface
    {
        return $next === null ? new StringToDateTime($format) : new AndOperator(new StringToDateTime($format), $next);
    }
860974
public function handle(Request $request, callable $next)
    {
        $this->serviceManager->add(Request::class, $request);

        return $next($request);
    }
364218
public function handle( RequestInterface $request, Closure $next ) {
		if ( ! $request->isReadVerb() ) {
			$token = CsrfService::getTokenFromRequest( $request );
			if ( ! CsrfService::isValidToken( $token ) ) {
				throw new InvalidCsrfTokenException();
			}
		}

		CsrfService::generateToken();

		return $next( $request );
	}
842551
protected static function stringToInt(RuleInterface $next = null): RuleInterface
    {
        return $next === null ? new StringToInt() : new AndOperator(new StringToInt(), $next);
    }
1254984
public function handle($request, Closure $next)
    {
        if ($this->auth->check() && $this->auth->viaRemember()) {
            $ip = $request->getClientIp();

            $this->updateFields($this->auth, $ip);
        }

        return $next($request);
    }
789846
public function process(
        RequestInterface $request,
        ResponseInterface $response,
        DelegateInterface $next = null
    ) {
        // before
        $response = $this->before($request, $response);

        // next middleware
        if ($next) {
            $response = $next->next($request, $response);
        }

        // after
        return $this->after($request, $response);
    }
1127493
public function execute($command, callable $next)
    {
        if (!$command->validate()) {
            throw new ValidationException(implode(', ', $command->getFirstErrors()));
        }

        return $next($command);
    }