public static function create(
        int $statusCode,
        string $message,
        string $request,
        string $response
    ): ApiClientException {
        switch ($statusCode) {
            case 400:
                $exception = new BadRequestException($message, $request, $response);
                break;
            case 401:
                $exception = new UnauthorizedException($message, $request, $response);
                break;
            case 403:
                $exception = new ForbiddenException($message, $request, $response);
                break;
            case 404:
                $exception = new NotFoundException($message, $request, $response);
                break;
            default:
                $exception = new ApiClientException($message, $statusCode, $request, $response);
                break;
        }
        return $exception;
    }
public static function create(
        int $statusCode,
        string $message,
        string $request,
        string $response
    ): ApiClientException {
        switch ($statusCode) {
            case 400:
                $exception = new BadRequestException($message, $request, $response);
                break;
            case 401:
                $exception = new UnauthorizedException($message, $request, $response);
                break;
            case 403:
                $exception = new ForbiddenException($message, $request, $response);
                break;
            case 404:
                $exception = new NotFoundException($message, $request, $response);
                break;
            default:
                $exception = new ApiClientException($message, $statusCode, $request, $response);
                break;
        }
        return $exception;
    }
public static function create ( int $ statusCode , string $ message , string $ request , string $ response ) : ApiClientException { switch ( $ statusCode ) { case 400 : $ exception = new BadRequestException ( $ message , $ request , $ response ) ; break ; case 401 : $ exception = new UnauthorizedException ( $ message , $ request , $ response ) ; break ; case 403 : $ exception = new ForbiddenException ( $ message , $ request , $ response ) ; break ; case 404 : $ exception = new NotFoundException ( $ message , $ request , $ response ) ; break ; default : $ exception = new ApiClientException ( $ message , $ statusCode , $ request , $ response ) ; break ; } return $ exception ; }
Creates the exception corresponding to the specified status code.
@param int $statusCode
@param string $message
@param string $request
@param string $response
@return ApiClientException
Creates the exception corresponding to the specified status code .