/** * @return Token * * @throws Github\LogicException when token has not been obtained yet */ public function getToken() { $token = $this->storage->get('auth.token'); if ($token === NULL) { throw new Github\LogicException('Token has not been obtained yet.'); } return $token; }
/** * @return Token * * @throws Github\LogicException when token has not been obtained yet */ public function getToken() { $token = $this->storage->get('auth.token'); if ($token === NULL) { throw new Github\LogicException('Token has not been obtained yet.'); } elseif ($token instanceof Token) { /** @deprecated */ $token = $token->toArray(); $this->storage->set('auth.token', $token); } return Token::createFromArray($token); }