response = clone $response; } final public function getResponse(): ?Http\Response { return $this->response; } } /** * Invalid credentials (e.g. revoked token). */ class UnauthorizedException extends ApiException {} /** * Invalid JSON sent to Github API. */ class BadRequestException extends ApiException {} /** * Invalid structure sent to Github API (e.g. some required fields are missing). */ class UnprocessableEntityException extends ApiException {} /** * Access denied. * @see https://developer.github.com/v3/#authentication */ class ForbiddenException extends ApiException {} /** * Rate limit exceed. * @see https://developer.github.com/v3/#rate-limiting */ class RateLimitExceedException extends ForbiddenException {} /** * Resource not found. * @see https://developer.github.com/v3/#authentication */ class NotFoundException extends ApiException {} /** * Response cannot be classified. */ class UnexpectedResponseException extends ApiException {} /** * Response from Github is somehow wrong (e.g. invalid JSON decoding). */ class InvalidResponseException extends ApiException {} /** * JSON cannot be decoded, or value cannot be encoded to JSON. */ class JsonException extends RuntimeException {} } namespace Milo\Github\Http { use Milo\Github; /** * HTTP response is somehow wrong and cannot be processed. */ class BadResponseException extends Github\RuntimeException {} } namespace Milo\Github\OAuth { use Milo\Github; /** * Something fails during the token obtaining. */ class LoginException extends Github\RuntimeException {} } namespace Milo\Github\Storages { use Milo\Github; /** * Directory is missing and/or cannot be created. */ class MissingDirectoryException extends Github\RuntimeException {} }