From cafc04bdf9cca73db620fb1c8a35c8ba649cb9c8 Mon Sep 17 00:00:00 2001 From: Nikolas Hermann Date: Fri, 12 Dec 2014 19:32:09 +0100 Subject: [PATCH] refactured RequestType to MarketplaceWebService_RequestType fpr PSR-0 compatibility --- src/MarketplaceWebService/Client.php | 14 +++++++------- src/MarketplaceWebService/RequestType.php | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/MarketplaceWebService/Client.php b/src/MarketplaceWebService/Client.php index f9dfba2..3c5749a 100644 --- a/src/MarketplaceWebService/Client.php +++ b/src/MarketplaceWebService/Client.php @@ -880,7 +880,7 @@ private function performRequest($action, array $converted, $dataHandle = null, $ $code = (int) curl_getinfo($this->curlClient, CURLINFO_HTTP_CODE); // Only attempt to verify the Content-MD5 value if the request was successful. - if (RequestType::getRequestType($action) === RequestType::POST_DOWNLOAD) { + if (MarketplaceWebService_RequestType::getRequestType($action) === MarketplaceWebService_RequestType::POST_DOWNLOAD) { if ($code != 200) { rewind($this->errorResponseBody); $httpResponse = stream_get_contents($this->errorResponseBody); @@ -956,7 +956,7 @@ private function parseHttpHeader($header) { /** * cURL callback to write the response HTTP body into a stream. This is only intended to be used - * with RequestType::POST_DOWNLOAD request types, since the responses can potentially become + * with MarketplaceWebService_RequestType::POST_DOWNLOAD request types, since the responses can potentially become * large. * * @param $ch - The curl handle. @@ -1031,9 +1031,9 @@ private function configureCurlOptions($action, array $converted, $streamHandle = $serviceUrl .= '/'; } - $requestType = RequestType::getRequestType($action); + $requestType = MarketplaceWebService_RequestType::getRequestType($action); - if ($requestType == RequestType::POST_UPLOAD) { + if ($requestType == MarketplaceWebService_RequestType::POST_UPLOAD) { if (is_null($streamHandle) || !is_resource($streamHandle)) { throw new MarketplaceWebService_Exception( @@ -1058,11 +1058,11 @@ private function configureCurlOptions($action, array $converted, $streamHandle = $curlOptions[CURLOPT_CUSTOMREQUEST] = self::REQUEST_TYPE; - } else if (!($requestType === RequestType::UNKNOWN)) { + } else if (!($requestType === MarketplaceWebService_RequestType::UNKNOWN)) { $curlOptions[CURLOPT_URL] = $this->config['ServiceURL']; $curlOptions[CURLOPT_POSTFIELDS] = $this->getParametersAsString($converted[CONVERTED_PARAMETERS_KEY]); - if ($requestType == RequestType::POST_DOWNLOAD) { + if ($requestType == MarketplaceWebService_RequestType::POST_DOWNLOAD) { $this->responseBodyContents = $streamHandle; $curlOptions[CURLOPT_WRITEFUNCTION] = array ($this, 'responseCallback'); } @@ -1074,7 +1074,7 @@ private function configureCurlOptions($action, array $converted, $streamHandle = } /** - * For RequestType::POST_DOWNLOAD actions, construct a response containing the Amazon Request ID + * For MarketplaceWebService_RequestType::POST_DOWNLOAD actions, construct a response containing the Amazon Request ID * and Content MD5 header value. * * @param $responseType diff --git a/src/MarketplaceWebService/RequestType.php b/src/MarketplaceWebService/RequestType.php index 3806741..511b8de 100644 --- a/src/MarketplaceWebService/RequestType.php +++ b/src/MarketplaceWebService/RequestType.php @@ -6,7 +6,7 @@ * matching the request type. * 3. 'Regular' POST requests. This represents the multitude of MWS requests. */ -final class RequestType { +final class MarketplaceWebService_RequestType { const POST_UPLOAD = 'POST_UPLOAD'; const POST_DOWNLOAD = 'POST_DOWNLOAD'; const POST_DEFAULT = 'POST_DEFAULT';