src/AuthorizationServer.php
public function enableGrantType(GrantTypeInterface $grantType, DateInterval $accessTokenTTL = null)
    {
        if ($accessTokenTTL instanceof DateInterval === false) {
            $accessTokenTTL = new DateInterval('PT1H');
        }

        $grantType->setAccessTokenRepository($this->accessTokenRepository);
        $grantType->setClientRepository($this->clientRepository);
        $grantType->setScopeRepository($this->scopeRepository);
        $grantType->setDefaultScope($this->defaultScope);
        $grantType->setPrivateKey($this->privateKey);
        $grantType->setEmitter($this->getEmitter());
        $grantType->setEncryptionKey($this->encryptionKey);

        $this->enabledGrantTypes[$grantType->getIdentifier()] = $grantType;
        $this->grantTypeAccessTokenTTL[$grantType->getIdentifier()] = $accessTokenTTL;
    }
public function enableGrantType(GrantTypeInterface $grantType, DateInterval $accessTokenTTL = null)
    {
        if ($accessTokenTTL instanceof DateInterval === false) {
            $accessTokenTTL = new DateInterval('PT1H');
        }

        $grantType->setAccessTokenRepository($this->accessTokenRepository);
        $grantType->setClientRepository($this->clientRepository);
        $grantType->setScopeRepository($this->scopeRepository);
        $grantType->setDefaultScope($this->defaultScope);
        $grantType->setPrivateKey($this->privateKey);
        $grantType->setEmitter($this->getEmitter());
        $grantType->setEncryptionKey($this->encryptionKey);

        $this->enabledGrantTypes[$grantType->getIdentifier()] = $grantType;
        $this->grantTypeAccessTokenTTL[$grantType->getIdentifier()] = $accessTokenTTL;
    }
public function enableGrantType ( GrantTypeInterface $ grantType , DateInterval $ accessTokenTTL = null ) { if ( $ accessTokenTTL instanceof DateInterval === false ) { $ accessTokenTTL = new DateInterval ( 'PT1H' ) ; } $ grantType -> setAccessTokenRepository ( $ this -> accessTokenRepository ) ; $ grantType -> setClientRepository ( $ this -> clientRepository ) ; $ grantType -> setScopeRepository ( $ this -> scopeRepository ) ; $ grantType -> setDefaultScope ( $ this -> defaultScope ) ; $ grantType -> setPrivateKey ( $ this -> privateKey ) ; $ grantType -> setEmitter ( $ this -> getEmitter ( ) ) ; $ grantType -> setEncryptionKey ( $ this -> encryptionKey ) ; $ this -> enabledGrantTypes [ $ grantType -> getIdentifier ( ) ] = $ grantType ; $ this -> grantTypeAccessTokenTTL [ $ grantType -> getIdentifier ( ) ] = $ accessTokenTTL ; }
Enable a grant type on the server.

@param GrantTypeInterface $grantType
@param null|DateInterval  $accessTokenTTL
Enable a grant type on the server .