Set the route parsing mode

@param int $mode a class MODE_* constant

@return void

@throws \UnexpectedValueException for unknown modes
480464
public static function setDefaultMode(int $mode) : void
    {
        if (in_array($mode, [self::MODE_REGEX, self::MODE_STRING])) {
            self::$mode = $mode;
            return;
        }

        // Unknown mode
        throw new \UnexpectedValueException('Invalid route mode');
    }
899731
public function mode($mode)
    {
        $acceptable_modes = [-1, 0, 1, 2];
        if (!in_array($mode, $acceptable_modes)) {
            throw new JSONLibraryException('bad_mode_set');
        }
        $this->mode = $mode;

        return $this;
    }
758991
private function setRoutes() : void
    {
        $this->routes = $this->routeProvider->getRoutes();
        $this->syRouteCollection = new RouteCollection();
        foreach ($this->routes as $route) {
            $syRoute = new SymfonyRoute(
                $route->getPath(),
                $route->getParamsDefaults(),
                $route->getParamsRequirements(),
                [],
                '',
                [],
                $route->getMethods()
            );
            $this->syRouteCollection->add($route->getName(), $syRoute);
        }
    }
1295162
public function setFormat(string $format)
    {
        $allowed = [
            'html',
            'xml',
            'json',
            'file'
        ];
        
        if (! in_array(strtolower($format), $allowed)) {
            Throw new RouterException(sprintf('Your format "%s" is not an allowed format. Use one of these formats %s', $format, implode(', ', $allowed)));
        }
        
        $this->format = $format;
    }
766314
public function setRequestMode($requestMode)
    {
        if (null !== $requestMode && (self::REQUEST_MODE_ASYNCHRONOUS !== $requestMode && self::REQUEST_MODE_SYNCHRONOUS !== $requestMode)) {
            throw new \InvalidArgumentException("invalid mode [{$requestMode}], expecting one of self::REQUEST_MODE_*");
        }
        $this->requestMode = $requestMode;
    }
1226801
public function reject($value, $mode = 1)
    {
        if (!in_array($mode, $this->fiterMode)) {
            throw new \UnexpectedValueException("Mode must is 1 or 2");
        }

        $this->items = array_filter($this->items, function ($item) use ($value, $mode) {
            return $item !== $value;
        }, $mode);

        return $this;
    }
388149
public function setFormat($format)
    {
        if($format)
        {
            if(!isset(static::$_formats[$format])) {
                throw new \UnexpectedValueException('Unregistered format: "' . $format . '" given.');
            }

            $this->_format = $format;
        }

        return $this;
    }
1350928
public function setFormat($format)
    {
        if($format)
        {
            if(!isset(static::$_formats[$format])) {
                throw new UnexpectedValueException('Unregistered format: "' . $format . '" given.');
            }

            $this->setContentType(static::$_formats[$format][0]);
        }

        return $this;
    }
939735
private function route() : void
    {
        // Parse route
        $parsed = $this->parseRoute();

        // Run error controller when no route matched
        if (!$parsed && isset($this->error_controller)) {
            call_user_func($this->error_controller);
        }
    }
543067
public function setOutputBuffering($mode)
    {
        if (!in_array($mode, [false, 'prepend', 'append'], true)) {
            throw new InvalidArgumentException('Unknown output buffering mode');
        }
        $this->outputBuffering = $mode;
    }
1141342
public static function setNewSymbolicLinkMode(string $mode = '740'): void
    {
        static::init();
        static::$newSymlinkMode = \preg_match('/^[0-7]{3}$/', $mode) ? \intval($mode, 8) : 0740;
    }
292394
public function setIterationMode($mode) {
		switch ($mode) {
			case self::ITERATION_STRAIGHT:
				$this->_map = array_keys($this->_data);
				break;
			
			case self::ITERATION_REVERSE:
				$this->_map = array_reverse(array_keys($this->_data));
				break;
			
			case self::ITERATION_EVEN:
				$this->_map = [];
				
				foreach (array_keys($this->_data) as $key => $value) {
					if ($key % 2 === 0) {
						$this->_map[] = $value;
					}
				}
				break;
				
			case self::ITERATION_ODD:
				$this->_map = [];
				
				foreach (array_keys($this->_data) as $key => $value) {
					if ($key % 2 !== 0) {
						$this->_map[] = $value;
					}
				}
				break;
		}
		
		return $this;
	}
281845
public function setPaymentMode($mode)
    {

        try {
            if ($mode instanceof PagSeguroPaymentMode) {
                $this->paymentMode = $mode;
            } else {
                $this->paymentMode = new PagSeguroPaymentMode($mode);
            }
        } catch (Exception $e) {
            die($e->getMessage());
        }
    }
648457
public function setMode($mode)
    {
        Validate::isString($mode, 'mode');
        Validate::isTrue(Mode::isValid($mode), Resources::INVALID_CHANGE_MODE_MSG);

        $this->_mode = $mode;
    }
1347332
public function setMode($mode)
    {
        $availableModes = $this->availableModes();
        if (!in_array($mode, $availableModes)) {
            throw new InvalidArgumentException(sprintf(
                'Invalid ID mode. Must be one of "%s"',
                implode(', ', $availableModes)
            ));
        }

        $this->mode = $mode;

        return $this;
    }
1122606
public static function setRunMode( $runMode )
    {
        if ( !in_array( $runMode, array( ezcBase::MODE_PRODUCTION, ezcBase::MODE_DEVELOPMENT ) ) )
        {
            throw new ezcBaseValueException( 'runMode', $runMode, 'ezcBase::MODE_PRODUCTION or ezcBase::MODE_DEVELOPMENT' );
        }

        self::$runMode = $runMode;
    }
893798
protected function set_mode(string $mode):void{
		$mode = strtolower($mode);

		if(!in_array($mode, ['totp', 'hotp'], true)){
			throw new AuthenticatorException('Invalid mode: '.$mode);
		}

		$this->mode = $mode;
	}