diff --git a/composer.json b/composer.json index 9d91f734..e2cc5254 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,6 @@ "guzzlehttp/guzzle": "^6.5.8|^7.4.5", "guzzlehttp/promises": "^1.5.3|^2.0", "guzzlehttp/psr7": "^1.9.1|^2.5", - "teapot/status-code": "^1|^2", "ext-json": "*", "monolog/monolog": "^1|^2|^3", "psr/log" : "^1|^2|^3" diff --git a/src/Api/BaseApiClient.php b/src/Api/BaseApiClient.php index 6e83f2eb..22bffdcf 100644 --- a/src/Api/BaseApiClient.php +++ b/src/Api/BaseApiClient.php @@ -33,8 +33,6 @@ use InvalidArgumentException; use JsonSerializable; use Psr\Http\Message\ResponseInterface; -use Teapot\StatusCode\Http as HttpStatusCode; -use Teapot\StatusCode\Vendor\Twitter as TwitterStatusCode; /** * Class BaseApiClient @@ -60,7 +58,7 @@ class BaseApiClient HttpStatusCode::FORBIDDEN => NotAllowed::class, HttpStatusCode::NOT_FOUND => NotFound::class, HttpStatusCode::CONFLICT => AlreadyExists::class, - TwitterStatusCode::ENHANCE_YOUR_CALM => RateLimited::class, // RFC6585::TOO_MANY_REQUESTS + HttpStatusCode::ENHANCE_YOUR_CALM => RateLimited::class, // RFC6585::TOO_MANY_REQUESTS HttpStatusCode::INTERNAL_SERVER_ERROR => GeneralError::class, ]; diff --git a/src/Api/Utils/HttpStatusCode.php b/src/Api/Utils/HttpStatusCode.php new file mode 100644 index 00000000..ba37ad84 --- /dev/null +++ b/src/Api/Utils/HttpStatusCode.php @@ -0,0 +1,104 @@ +