diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..2b1f592 --- /dev/null +++ b/composer.json @@ -0,0 +1,20 @@ +{ + "name": "seka19/tracking-sdk-php", + "authors": [ + { + "name": "www.trackingmore.com", + "email": "info@trackingmore.org" + } + ], + "description": "Tracking PHP SDK", + "license": "MIT", + "require": { + "php": ">=7.1", + "ext-json": "*" + }, + "autoload": { + "classmap": [ + "lib/" + ] + } +} diff --git a/lib/Api.class.php b/lib/Api.class.php index 4e4f1e0..c4dbb8d 100644 --- a/lib/Api.class.php +++ b/lib/Api.class.php @@ -128,7 +128,7 @@ public static function checkParamsRequirements($params) /** * Check if the data meets the requirements. * - * @return json response. + * @return string response. */ public static function checkSendApi($data) { @@ -162,7 +162,7 @@ public static function getRequestHeader() /** * send api request. * - * @return array $response. + * @return string $response. */ public static function sendApiRequest($params = [], $method = "GET") { @@ -175,7 +175,7 @@ public static function sendApiRequest($params = [], $method = "GET") /** * error params request. * - * @return json response. + * @return string response. */ public static function errorResponse($code, $message = "", $data = []) { diff --git a/lib/RequestApi.class.php b/lib/RequestApi.class.php index 077cb8f..583e876 100644 --- a/lib/RequestApi.class.php +++ b/lib/RequestApi.class.php @@ -23,7 +23,7 @@ class RequestApi /** * send api request. * - * @return json $response. + * @return string $response. */ public static function send($method = "GET") { @@ -72,7 +72,7 @@ public static function send($method = "GET") $response = curl_exec($curl); curl_close($curl); unset($curl); - return $response; + return (string)$response; } } \ No newline at end of file