/**
  * Enable support for a grant
  * @param  GrantTypeInterface $grantType  A grant class which conforms to Interface/GrantTypeInterface
  * @param  null|string        $identifier An identifier for the grant (autodetected if not passed)
  * @return self
  */
 public function addGrantType(GrantTypeInterface $grantType, $identifier = null)
 {
     if (is_null($identifier)) {
         $identifier = $grantType->getIdentifier();
     }
     // Inject server into grant
     $grantType->setAuthorizationServer($this);
     $this->grantTypes[$identifier] = $grantType;
     if (!is_null($grantType->getResponseType())) {
         $this->responseTypes[] = $grantType->getResponseType();
     }
     return $this;
 }
Exemplo n.º 2
0
 /**
  * Enable support for a grant
  * @param GrantTypeInterface $grantType  A grant class which conforms to Interface/GrantTypeInterface
  * @param null|string        $identifier An identifier for the grant (autodetected if not passed)
  */
 public function addGrantType(GrantTypeInterface $grantType, $identifier = null)
 {
     if (is_null($identifier)) {
         $identifier = $grantType->getIdentifier();
     }
     $this->grantTypes[$identifier] = $grantType;
     if (!is_null($grantType->getResponseType())) {
         $this->responseTypes[] = $grantType->getResponseType();
     }
 }