set this route as a fail route for the current group.

@return $this
@throws InvalidArgumentException
190470
public function setAsFailRoute($bool = true)
    {
        if(!$bool)
            return $this;

        $name = $this->name;

        if(!$name)
            throw new InvalidArgumentException('This route has to be named first.');

        $this->group->setFailRoute($name);

        return $this;
    }
626746
public function configure()
    {
        switch (count($options = func_get_args())) {
            case 0:
                break;

            case 1:
                $this->configureInstance($options[0]);
                break;

            case 2:
                $this->configureInstanceAssoc(
                    static::authorize($options[0], $options[1])
                );
                break;

            default:
                throw new \InvalidArgumentException('invalid argument count');
                break;
        }

        return $this;
    }
592354
public function error()
    {
        if (!$this->output) { return $this; }

        foreach (func_get_args() as $line) {

            if (is_array($line)) {
                call_user_func_array([ $this->output, 'write' ], $line);
                continue;
            }

            $this->output->getErrorOutput()->write($line);
        };

        return $this;
    }
1252425
public function actionCreate()
    {
        Yii::$app->getResponse()->format = 'json';
        $routes = Yii::$app->getRequest()->post('route', '');
        $routes = preg_split('/\s*,\s*/', trim($routes), -1, PREG_SPLIT_NO_EMPTY);
        $this->saveNew($routes);
        Helper::invalidate();
        return $this->getRoutes();
    }
1006288
protected function fail()
    {
        $this->success = false;

        if ($this->shouldRedirect) {
            die(Response::redirect(Url::last()));
        } else {
            $this->shouldFallThrough = true;
        }
    }
873828
public function required()
    {
        if (!array_key_exists($this->key, $this->command->arguments)) {
            throw new \Hail\Image\Exception\InvalidArgumentException(
                sprintf('Missing argument %d for %s', $this->key + 1, $this->getCommandName())
            );
        }

        return $this;
    }
533746
public function setName($name)
    {
        if ($this->lock) {
            throw new Exception('Route cannot be modified');
        }

        if (empty($name)) {
            return $name;
        }

        //Add group name if any
        $groupName = implode('', Router::$groupsProps['name']);
        $this->name = $groupName . $name;

        //Register
        Router::getInstance()->registerNamedRoute($this);

        return $this;
    }
582888
public function addFailedRecipient($failedRecipient, Exception $e = null)
    {
        $failedRecipients = (array) $failedRecipient;

        if (count($failedRecipients) > 1 && $e) {
            throw new InvalidArgumentException('If you pass an exception you can only pass one failed reciepient');
        }

        foreach ($failedRecipients as $recipient) {
            $this->failedRecipients[] = $recipient;
        }

        if ($e) {
            $this->errors[count($this->failedRecipients) - 1] = $e;
        }

        return $this;
    }
1051682
public function collectNow()
    {
        $this->getLogger()->info('Sending Collect Now action to display Group ID ' . $this->displayGroupId);
        $this->doPost('/displaygroup/' . $this->displayGroupId . '/action/collectNow');

        return $this;
    }
1028994
public function crossDomainRule()
    {
        if ($this instanceof RuleGroup) {
            $method = '*';
        } else {
            $method = $this->method;
        }

        $this->router->setCrossDomainRule($this, $method);

        return $this;
    }
1100209
function onFailure(/*callable*/$callable)
    {
        if ($callable === null) {
            $this->failure = $callable;
            return $this;
        }

        if (!is_callable($callable))
            throw new \Exception(sprintf(
                'The argument given is not callable; given: (%s).'
                , \Poirot\Std\flatten($callable)
            ));

        
        $this->failure = $callable;
        return $this;
    }
849576
protected function setPath($path)
    {
        $this->uriString = null;

        $path = (string) $path;

        if (strpos($path, '?') !== false) {
            throw new InvalidArgumentException(
                'Invalid path provided; must not contain a query string.'
            );
        }

        if (strpos($path, '#') !== false) {
            throw new InvalidArgumentException(
                'Invalid path provided; must not contain a URI fragment.'
            );
        }

        $this->path = static::encode($path);

        return $this;
    }
1304922
public function group()
  {
    $this->stmt['group'] = array_unique(array_merge($this->stmt['group'], $this->buildArrayOfArgs(func_get_args())));
    return $this;
  }
836542
public function build(): FailRequestRequest
	{
		$instance = new FailRequestRequest();
		if ($this->requestId === null) {
			throw new BuilderException('Property [requestId] is required.');
		}
		$instance->requestId = $this->requestId;
		if ($this->errorReason === null) {
			throw new BuilderException('Property [errorReason] is required.');
		}
		$instance->errorReason = $this->errorReason;
		return $instance;
	}
797401
public function routeDispatch()
    {
        $this->applyHook('sys.before.router');
        //分组
        $this->route->applyGroup();
        $this->route->next();
        $this->applyHook('sys.after.router');
        return $this;
    }
48602
public function map($methods, $pattern, $callable)
	{
		$methods = (array) $methods;
		if (!is_string($pattern)) {
			throw new InvalidArgumentException('Route pattern must be a string');
		}
		
		// Prepend parent group pattern(s)
		if ($this->routeGroups) {
			$pattern = $this->processGroups() . $pattern;
		}
		
		// According to RFC methods are defined in uppercase (See RFC 7231)
		$methods = array_map("strtoupper", $methods);
		
		// Add route
		$route = $this->createRoute($methods, $pattern, $callable);
		$this->routes[$route->getIdentifier()] = $route;
		$this->routeCounter++;
		
		return $route;
	}
283656
public function failureAction(Request $request)
    {
        $orderId = $this->getOrderId($request);

        $failureRoute = $this
            ->redirectionRoutes
            ->getRedirectionRoute('failure');

        $redirectUrl = $this
            ->urlGenerator
            ->generate(
                $failureRoute->getRoute(),
                $failureRoute->getRouteAttributes(
                    $orderId
                )
            );

        return new RedirectResponse($redirectUrl);
    }