Set the token type to use.

@param \League\OAuth2\Server\TokenType\TokenTypeInterface $tokenType
554367
public function setTokenType(TokenTypeInterface $tokenType)
    {
        $this->issuer->setTokenType($tokenType);
        $this->checker->setTokenType($tokenType);
    }
46194
public void accept(final TokenType tokenType) {
        if (lexer.getCurrentToken().getType() != tokenType) {
            throw new SQLParsingException(lexer, tokenType);
        }
        lexer.nextToken();
    }
1247778
public function setConsentType($consentType)
    {
        if ($consentType !== self::CONSENT_SIMPLE &&
            $consentType !== self::CONSENT_NONE) {
            throw new InvalidArgumentException('Invalid consent type provided.');
        }

        $this->consentType = $consentType;
    }
854772
protected function setUpTokenValues(TokenInterface $token): int
    {
        list($tokenValue, $tokenType, $tokenExpiresIn, $refreshValue) =
            $this->getIntegration()->generateTokenValues($token);
        $token->setValue($tokenValue)->setType($tokenType)->setRefreshValue($refreshValue);

        return $tokenExpiresIn;
    }
164958
public function put(TokenInterface $token)
    {
        $this->stash->regenerate();
        $this->stash->set('token', $token);

        return $this;
    }
852558
public function setToken($token, $tokenSecret)
    {
        $this->token = $token;
        $this->tokenSecret = $tokenSecret;

        return $this;
    }
490547
protected function setCode(array $tokens, int $line = 0): void
    {
        $this->tokens = $tokens;
        $this->line = $line;
    }
1170892
public function assignValuesToCode(TokenInterface $token, int $expirationInSeconds): void
    {
        try {
            $query = $this->getConnection()->createQueryBuilder();

            $now   = $this->ignoreException(function (): DateTimeImmutable {
                return new DateTimeImmutable();
            });
            $dbNow = $this->createTypedParameter($query, $now);

            $earliestExpired = $this->ignoreException(function () use ($now, $expirationInSeconds) : DateTimeImmutable {
                /** @var DateTimeImmutable $now */
                return $now->sub(new DateInterval("PT{$expirationInSeconds}S"));
            });

            $schema = $this->getDatabaseSchema();
            $query
                ->update($this->getTableNameForWriting())
                ->where($schema->getTokensCodeColumn() . '=' . $this->createTypedParameter($query, $token->getCode()))
                ->andWhere(
                    $schema->getTokensCodeCreatedAtColumn() . '>' .
                    $this->createTypedParameter($query, $earliestExpired)
                )
                ->set($schema->getTokensValueColumn(), $this->createTypedParameter($query, $token->getValue()))
                ->set($schema->getTokensTypeColumn(), $this->createTypedParameter($query, $token->getType()))
                ->set($schema->getTokensValueCreatedAtColumn(), $dbNow);

            if ($token->getRefreshValue() !== null) {
                $query
                    ->set(
                        $schema->getTokensRefreshColumn(),
                        $this->createTypedParameter($query, $token->getRefreshValue())
                    )->set($schema->getTokensRefreshCreatedAtColumn(), $dbNow);
            }

            $numberOfUpdated = $query->execute();
            assert(is_int($numberOfUpdated) === true);
        } /** @noinspection PhpRedundantCatchClauseInspection */ catch (DBALException $exception) {
            $message = 'Assigning token values by code failed.';
            throw new RepositoryException($message, 0, $exception);
        }
    }
579088
public function setType($type)
    {
        if ($type === null) {
            $this->$type = $type;
        } else {
            $iconSetType = new IconSetTypeEnum($type);
            $this->type = $iconSetType->getValue();
        }

        return $this;
    }
981023
public function setToken($token)
    {
        $this->token = $token instanceof Token ? $token : new Token($token);

        return $this;
    }
966847
public function setType(?string $type): void
    {
        if (!in_array($type, static::getTypes(), true)) {
            throw new \InvalidArgumentException('Wrong zone type supplied.');
        }

        $this->type = $type;
    }
928123
public function setTokenValidity($tokenValidity) {
        $tknVal = intval($tokenValidity);

        if (empty($tknVal)) {
            $tknVal = self::BASIC_VALIDITY;
        }

        $this->tokenValidity = intval($tknVal);
    }
1321672
public function set($token, $type)
    {
        if ($type != 'request_token' && $type != 'access_token') {
            $message = "Expected a type of either 'request_token' or 'access_token', got '$type'";
            throw new \Dropbox\Exception($message);
        } elseif ($type == 'request_token') {
            parent::set($token, $type);
        } else {
            $query = 'INSERT INTO ' . $this->table . ' (userID, token) VALUES (?, ?) ON DUPLICATE KEY UPDATE token = ?';
            $stmt = $this->pdo->prepare($query);
            $token = $this->encrypt($token);
            $stmt->execute(array($this->userID, $token, $token));
            $_SESSION[$this->namespace][$this->userID][$type] = $token;
        }
    }
366568
private function validateToken($type)
    {
        $token = $this->lexer->token;

        if ($token['type'] !== $type) {
            throw new \InvalidArgumentException(sprintf(
                'Expected a token type "%d", got "%d".',
                TypeLexer::T_LOWER_THAN,
                $token['type']
            ));
        }

        $this->walk();

        return $token;
    }
157705
public function setType($type)
    {
        if (!is_string($type) && (null !== $type)) {
            require_once 'Zend/Server/Reflection/Exception.php';
            throw new Zend_Server_Reflection_Exception('Invalid parameter type');
        }

        $this->_type = $type;
    }
655839
public function setOAuthToken(AccessToken $token)
    {
        $this->access_token = $token->getToken();
        $this->access_token_expiration = $token->getExpires();
        $this->refresh_token = $token->getRefreshToken();
        $this->role = $token->getValues()['role'];
    }
78908
public function setType($type)
    {
        if ($type instanceof PagSeguroPaymentMethodType) {
            $this->type = $type;
        } else {
            $this->type = new PagSeguroPaymentMethodType($type);
        }
    }