diff --git a/composer.json b/composer.json index a836dea..daa8fd0 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ "ext-curl": "*" }, "require-dev": { - "phpunit/phpunit": "4.8.*", + "phpunit/phpunit": "3.7.*", "squizlabs/php_codesniffer": "3.*" }, "support": { diff --git a/lib/RetailCrm/Methods/V3/Customers.php b/lib/RetailCrm/Methods/V3/Customers.php index d44dd72..796f749 100644 --- a/lib/RetailCrm/Methods/V3/Customers.php +++ b/lib/RetailCrm/Methods/V3/Customers.php @@ -56,7 +56,7 @@ trait Customers return $this->client->makeRequest( '/customers', - $this->client::METHOD_GET, + "GET", $parameters ); } @@ -83,7 +83,7 @@ trait Customers return $this->client->makeRequest( '/customers/create', - $this->client::METHOD_POST, + "POST", $this->fillSite($site, ['customer' => json_encode($customer)]) ); } @@ -109,7 +109,7 @@ trait Customers return $this->client->makeRequest( '/customers/fix-external-ids', - $this->client::METHOD_POST, + "POST", ['customers' => json_encode($ids)] ); } @@ -136,7 +136,7 @@ trait Customers return $this->client->makeRequest( '/customers/upload', - $this->client::METHOD_POST, + "POST", $this->fillSite($site, ['customers' => json_encode($customers)]) ); } @@ -160,7 +160,7 @@ trait Customers return $this->client->makeRequest( "/customers/$id", - $this->client::METHOD_GET, + "GET", $this->fillSite($site, ['by' => $by]) ); } @@ -196,7 +196,7 @@ trait Customers return $this->client->makeRequest( sprintf('/customers/%s/edit', $customer[$by]), - $this->client::METHOD_POST, + "POST", $this->fillSite( $site, ['customer' => json_encode($customer), 'by' => $by] diff --git a/lib/RetailCrm/Methods/V3/Orders.php b/lib/RetailCrm/Methods/V3/Orders.php index b7b9147..56bd6bc 100644 --- a/lib/RetailCrm/Methods/V3/Orders.php +++ b/lib/RetailCrm/Methods/V3/Orders.php @@ -57,7 +57,7 @@ trait Orders return $this->client->makeRequest( '/orders', - $this->client::METHOD_GET, + "GET", $parameters ); } @@ -84,7 +84,7 @@ trait Orders return $this->client->makeRequest( '/orders/create', - $this->client::METHOD_POST, + "POST", $this->fillSite($site, ['order' => json_encode($order)]) ); } @@ -110,7 +110,7 @@ trait Orders return $this->client->makeRequest( '/orders/fix-external-ids', - $this->client::METHOD_POST, + "POST", ['orders' => json_encode($ids) ] ); @@ -141,7 +141,7 @@ trait Orders return $this->client->makeRequest( '/orders/statuses', - $this->client::METHOD_GET, + "GET", $parameters ); } @@ -168,7 +168,7 @@ trait Orders return $this->client->makeRequest( '/orders/upload', - $this->client::METHOD_POST, + "POST", $this->fillSite($site, ['orders' => json_encode($orders)]) ); } @@ -192,7 +192,7 @@ trait Orders return $this->client->makeRequest( "/orders/$id", - $this->client::METHOD_GET, + "GET", $this->fillSite($site, ['by' => $by]) ); } @@ -228,7 +228,7 @@ trait Orders return $this->client->makeRequest( sprintf('/orders/%s/edit', $order[$by]), - $this->client::METHOD_POST, + "POST", $this->fillSite( $site, ['order' => json_encode($order), 'by' => $by] @@ -260,7 +260,7 @@ trait Orders return $this->client->makeRequest( '/orders/history', - $this->client::METHOD_GET, + "GET", $parameters ); } diff --git a/lib/RetailCrm/Methods/V3/Packs.php b/lib/RetailCrm/Methods/V3/Packs.php index 620222e..c493ce3 100644 --- a/lib/RetailCrm/Methods/V3/Packs.php +++ b/lib/RetailCrm/Methods/V3/Packs.php @@ -56,7 +56,7 @@ trait Packs return $this->client->makeRequest( '/orders/packs', - $this->client::METHOD_GET, + "GET", $parameters ); } @@ -83,7 +83,7 @@ trait Packs return $this->client->makeRequest( '/orders/packs/create', - $this->client::METHOD_POST, + "POST", $this->fillSite($site, ['pack' => json_encode($pack)]) ); } @@ -117,7 +117,7 @@ trait Packs return $this->client->makeRequest( '/orders/packs/history', - $this->client::METHOD_GET, + "GET", $parameters ); } @@ -141,7 +141,7 @@ trait Packs return $this->client->makeRequest( "/orders/packs/$id", - $this->client::METHOD_GET + "GET" ); } @@ -164,7 +164,7 @@ trait Packs return $this->client->makeRequest( sprintf('/orders/packs/%s/delete', $id), - $this->client::METHOD_POST + "POST" ); } @@ -190,7 +190,7 @@ trait Packs return $this->client->makeRequest( sprintf('/orders/packs/%s/edit', $pack['id']), - $this->client::METHOD_POST, + "POST", $this->fillSite($site, ['pack' => json_encode($pack)]) ); } diff --git a/lib/RetailCrm/Methods/V3/References.php b/lib/RetailCrm/Methods/V3/References.php index d336453..4b9279b 100644 --- a/lib/RetailCrm/Methods/V3/References.php +++ b/lib/RetailCrm/Methods/V3/References.php @@ -40,7 +40,7 @@ trait References { return $this->client->makeRequest( '/reference/countries', - $this->client::METHOD_GET + "GET" ); } @@ -57,7 +57,7 @@ trait References { return $this->client->makeRequest( '/reference/delivery-services', - $this->client::METHOD_GET + "GET" ); } @@ -82,7 +82,7 @@ trait References return $this->client->makeRequest( sprintf('/reference/delivery-services/%s/edit', $data['code']), - $this->client::METHOD_POST, + "POST", ['deliveryService' => json_encode($data)] ); } @@ -100,7 +100,7 @@ trait References { return $this->client->makeRequest( '/reference/delivery-types', - $this->client::METHOD_GET + "GET" ); } @@ -125,7 +125,7 @@ trait References return $this->client->makeRequest( sprintf('/reference/delivery-types/%s/edit', $data['code']), - $this->client::METHOD_POST, + "POST", ['deliveryType' => json_encode($data)] ); } @@ -143,7 +143,7 @@ trait References { return $this->client->makeRequest( '/reference/order-methods', - $this->client::METHOD_GET + "GET" ); } @@ -168,7 +168,7 @@ trait References return $this->client->makeRequest( sprintf('/reference/order-methods/%s/edit', $data['code']), - $this->client::METHOD_POST, + "POST", ['orderMethod' => json_encode($data)] ); } @@ -186,7 +186,7 @@ trait References { return $this->client->makeRequest( '/reference/order-types', - $this->client::METHOD_GET + "GET" ); } @@ -211,7 +211,7 @@ trait References return $this->client->makeRequest( sprintf('/reference/order-types/%s/edit', $data['code']), - $this->client::METHOD_POST, + "POST", ['orderType' => json_encode($data)] ); } @@ -229,7 +229,7 @@ trait References { return $this->client->makeRequest( '/reference/payment-statuses', - $this->client::METHOD_GET + "GET" ); } @@ -254,7 +254,7 @@ trait References return $this->client->makeRequest( sprintf('/reference/payment-statuses/%s/edit', $data['code']), - $this->client::METHOD_POST, + "POST", ['paymentStatus' => json_encode($data)] ); } @@ -272,7 +272,7 @@ trait References { return $this->client->makeRequest( '/reference/payment-types', - $this->client::METHOD_GET + "GET" ); } @@ -297,7 +297,7 @@ trait References return $this->client->makeRequest( sprintf('/reference/payment-types/%s/edit', $data['code']), - $this->client::METHOD_POST, + "POST", ['paymentType' => json_encode($data)] ); } @@ -315,7 +315,7 @@ trait References { return $this->client->makeRequest( '/reference/product-statuses', - $this->client::METHOD_GET + "GET" ); } @@ -340,7 +340,7 @@ trait References return $this->client->makeRequest( sprintf('/reference/product-statuses/%s/edit', $data['code']), - $this->client::METHOD_POST, + "POST", ['productStatus' => json_encode($data)] ); } @@ -358,7 +358,7 @@ trait References { return $this->client->makeRequest( '/reference/sites', - $this->client::METHOD_GET + "GET" ); } @@ -383,7 +383,7 @@ trait References return $this->client->makeRequest( sprintf('/reference/sites/%s/edit', $data['code']), - $this->client::METHOD_POST, + "POST", ['site' => json_encode($data)] ); } @@ -401,7 +401,7 @@ trait References { return $this->client->makeRequest( '/reference/status-groups', - $this->client::METHOD_GET + "GET" ); } @@ -418,7 +418,7 @@ trait References { return $this->client->makeRequest( '/reference/statuses', - $this->client::METHOD_GET + "GET" ); } @@ -443,7 +443,7 @@ trait References return $this->client->makeRequest( sprintf('/reference/statuses/%s/edit', $data['code']), - $this->client::METHOD_POST, + "POST", ['status' => json_encode($data)] ); } @@ -461,7 +461,7 @@ trait References { return $this->client->makeRequest( '/reference/stores', - $this->client::METHOD_GET + "GET" ); } @@ -492,7 +492,7 @@ trait References return $this->client->makeRequest( sprintf('/reference/stores/%s/edit', $data['code']), - $this->client::METHOD_POST, + "POST", ['store' => json_encode($data)] ); } diff --git a/lib/RetailCrm/Methods/V3/Statistic.php b/lib/RetailCrm/Methods/V3/Statistic.php index 66b5eb5..ed49eb2 100644 --- a/lib/RetailCrm/Methods/V3/Statistic.php +++ b/lib/RetailCrm/Methods/V3/Statistic.php @@ -40,7 +40,7 @@ trait Statistic { return $this->client->makeRequest( '/statistic/update', - $this->client::METHOD_GET + "GET" ); } } diff --git a/lib/RetailCrm/Methods/V3/Stores.php b/lib/RetailCrm/Methods/V3/Stores.php index f35ab0b..8b9022b 100644 --- a/lib/RetailCrm/Methods/V3/Stores.php +++ b/lib/RetailCrm/Methods/V3/Stores.php @@ -56,7 +56,7 @@ trait Stores return $this->client->makeRequest( '/store/inventories', - $this->client::METHOD_GET, + "GET", $parameters ); } @@ -83,7 +83,7 @@ trait Stores return $this->client->makeRequest( '/store/inventories/upload', - $this->client::METHOD_POST, + "POST", $this->fillSite($site, ['offers' => json_encode($offers)]) ); } diff --git a/lib/RetailCrm/Methods/V3/Telephony.php b/lib/RetailCrm/Methods/V3/Telephony.php index 77f0de4..8e0bbad 100644 --- a/lib/RetailCrm/Methods/V3/Telephony.php +++ b/lib/RetailCrm/Methods/V3/Telephony.php @@ -46,7 +46,7 @@ trait Telephony return $this->client->makeRequest( "/telephony/setting/$code", - $this->client::METHOD_GET + "GET" ); } @@ -95,7 +95,7 @@ trait Telephony return $this->client->makeRequest( '/telephony/call/event', - $this->client::METHOD_POST, + "POST", ['event' => json_encode($parameters)] ); } @@ -121,7 +121,7 @@ trait Telephony return $this->client->makeRequest( '/telephony/calls/upload', - $this->client::METHOD_POST, + "POST", ['calls' => json_encode($calls)] ); } @@ -149,7 +149,7 @@ trait Telephony return $this->client->makeRequest( '/telephony/manager', - $this->client::METHOD_GET, + "GET", $parameters ); } diff --git a/lib/RetailCrm/Methods/V4/Customers.php b/lib/RetailCrm/Methods/V4/Customers.php index 54087ef..0ccf28d 100644 --- a/lib/RetailCrm/Methods/V4/Customers.php +++ b/lib/RetailCrm/Methods/V4/Customers.php @@ -55,7 +55,7 @@ trait Customers return $this->client->makeRequest( '/customers/history', - $this->client::METHOD_GET, + "GET", $parameters ); } diff --git a/lib/RetailCrm/Methods/V4/Delivery.php b/lib/RetailCrm/Methods/V4/Delivery.php index d1a61a4..6c15a01 100644 --- a/lib/RetailCrm/Methods/V4/Delivery.php +++ b/lib/RetailCrm/Methods/V4/Delivery.php @@ -46,7 +46,7 @@ trait Delivery return $this->client->makeRequest( "/delivery/generic/setting/$code", - $this->client::METHOD_GET + "GET" ); } @@ -71,7 +71,7 @@ trait Delivery return $this->client->makeRequest( sprintf('/delivery/generic/setting/%s/edit', $configuration['code']), - $this->client::METHOD_POST, + "POST", ['configuration' => json_encode($configuration)] ); } @@ -102,7 +102,7 @@ trait Delivery return $this->client->makeRequest( sprintf('/delivery/generic/%s/tracking', $code), - $this->client::METHOD_POST, + "POST", ['statusUpdate' => json_encode($statusUpdate)] ); } diff --git a/lib/RetailCrm/Methods/V4/Marketplace.php b/lib/RetailCrm/Methods/V4/Marketplace.php index 68a6e01..d9fbab9 100644 --- a/lib/RetailCrm/Methods/V4/Marketplace.php +++ b/lib/RetailCrm/Methods/V4/Marketplace.php @@ -49,7 +49,7 @@ trait Marketplace return $this->client->makeRequest( sprintf('/marketplace/external/setting/%s/edit', $configuration['code']), - $this->client::METHOD_POST, + "POST", ['configuration' => json_encode($configuration)] ); } diff --git a/lib/RetailCrm/Methods/V4/Orders.php b/lib/RetailCrm/Methods/V4/Orders.php index 6ee8ff9..dc8bb80 100644 --- a/lib/RetailCrm/Methods/V4/Orders.php +++ b/lib/RetailCrm/Methods/V4/Orders.php @@ -61,7 +61,7 @@ trait Orders return $this->client->makeRequest( '/orders', - $this->client::METHOD_GET, + "GET", $parameters ); } @@ -88,7 +88,7 @@ trait Orders return $this->client->makeRequest( '/orders/create', - $this->client::METHOD_POST, + "POST", $this->fillSite($site, ['order' => json_encode($order)]) ); } @@ -114,7 +114,7 @@ trait Orders return $this->client->makeRequest( '/orders/fix-external-ids', - $this->client::METHOD_POST, + "POST", ['orders' => json_encode($ids) ] ); @@ -145,7 +145,7 @@ trait Orders return $this->client->makeRequest( '/orders/statuses', - $this->client::METHOD_GET, + "GET", $parameters ); } @@ -172,7 +172,7 @@ trait Orders return $this->client->makeRequest( '/orders/upload', - $this->client::METHOD_POST, + "POST", $this->fillSite($site, ['orders' => json_encode($orders)]) ); } @@ -196,7 +196,7 @@ trait Orders return $this->client->makeRequest( "/orders/$id", - $this->client::METHOD_GET, + "GET", $this->fillSite($site, ['by' => $by]) ); } @@ -232,7 +232,7 @@ trait Orders return $this->client->makeRequest( sprintf('/orders/%s/edit', $order[$by]), - $this->client::METHOD_POST, + "POST", $this->fillSite( $site, ['order' => json_encode($order), 'by' => $by] @@ -264,7 +264,7 @@ trait Orders return $this->client->makeRequest( '/orders/history', - $this->client::METHOD_GET, + "GET", $parameters ); } diff --git a/lib/RetailCrm/Methods/V4/References.php b/lib/RetailCrm/Methods/V4/References.php index 24900ce..e40f454 100644 --- a/lib/RetailCrm/Methods/V4/References.php +++ b/lib/RetailCrm/Methods/V4/References.php @@ -43,7 +43,7 @@ trait References { return $this->client->makeRequest( '/reference/price-types', - $this->client::METHOD_GET + "GET" ); } @@ -74,7 +74,7 @@ trait References return $this->client->makeRequest( sprintf('/reference/price-types/%s/edit', $data['code']), - $this->client::METHOD_POST, + "POST", ['priceType' => json_encode($data)] ); } diff --git a/lib/RetailCrm/Methods/V4/Stores.php b/lib/RetailCrm/Methods/V4/Stores.php index cd64c8e..69e8515 100644 --- a/lib/RetailCrm/Methods/V4/Stores.php +++ b/lib/RetailCrm/Methods/V4/Stores.php @@ -51,7 +51,7 @@ trait Stores return $this->client->makeRequest( "/store/setting/$code", - $this->client::METHOD_GET + "GET" ); } @@ -76,7 +76,7 @@ trait Stores return $this->client->makeRequest( sprintf('/store/setting/%s/edit', $configuration['code']), - $this->client::METHOD_POST, + "POST", ['configuration' => json_encode($configuration)] ); } @@ -103,7 +103,7 @@ trait Stores return $this->client->makeRequest( '/store/prices/upload', - $this->client::METHOD_POST, + "POST", $this->fillSite($site, ['prices' => json_encode($prices)]) ); } @@ -137,7 +137,7 @@ trait Stores return $this->client->makeRequest( '/store/products', - $this->client::METHOD_GET, + "GET", $parameters ); } diff --git a/lib/RetailCrm/Methods/V4/Telephony.php b/lib/RetailCrm/Methods/V4/Telephony.php index 2082b5e..c9bac37 100644 --- a/lib/RetailCrm/Methods/V4/Telephony.php +++ b/lib/RetailCrm/Methods/V4/Telephony.php @@ -130,7 +130,7 @@ trait Telephony return $this->client->makeRequest( "/telephony/setting/$code/edit", - $this->client::METHOD_POST, + "POST", ['configuration' => json_encode($parameters)] ); } diff --git a/lib/RetailCrm/Methods/V4/Users.php b/lib/RetailCrm/Methods/V4/Users.php index be45cc3..8f778cf 100644 --- a/lib/RetailCrm/Methods/V4/Users.php +++ b/lib/RetailCrm/Methods/V4/Users.php @@ -57,7 +57,7 @@ trait Users /** @noinspection PhpUndefinedMethodInspection */ return $this->client->makeRequest( '/users', - $this->client::METHOD_GET, + "GET", $parameters ); } @@ -87,7 +87,7 @@ trait Users /** @noinspection PhpUndefinedMethodInspection */ return $this->client->makeRequest( '/user-groups', - $this->client::METHOD_GET, + "GET", $parameters ); } @@ -106,6 +106,6 @@ trait Users public function usersGet($id) { /** @noinspection PhpUndefinedMethodInspection */ - return $this->client->makeRequest("/users/$id", $this->client::METHOD_GET); + return $this->client->makeRequest("/users/$id", "GET"); } } diff --git a/lib/RetailCrm/Methods/V5/CustomFields.php b/lib/RetailCrm/Methods/V5/CustomFields.php index 6e43d62..9e87ba7 100644 --- a/lib/RetailCrm/Methods/V5/CustomFields.php +++ b/lib/RetailCrm/Methods/V5/CustomFields.php @@ -52,7 +52,7 @@ trait CustomFields return $this->client->makeRequest( '/custom-fields', - $this->client::METHOD_GET, + "GET", $parameters ); } @@ -85,7 +85,7 @@ trait CustomFields return $this->client->makeRequest( "/custom-fields/$entity/create", - $this->client::METHOD_POST, + "POST", ['customField' => json_encode($customField)] ); } @@ -114,7 +114,7 @@ trait CustomFields return $this->client->makeRequest( "/custom-fields/$entity/edit/{$customField['code']}", - $this->client::METHOD_POST, + "POST", ['customField' => json_encode($customField)] ); } @@ -143,7 +143,7 @@ trait CustomFields return $this->client->makeRequest( "/custom-fields/$entity/$code", - $this->client::METHOD_GET + "GET" ); } @@ -172,7 +172,7 @@ trait CustomFields return $this->client->makeRequest( '/custom-fields/dictionaries', - $this->client::METHOD_GET, + "GET", $parameters ); } @@ -197,7 +197,7 @@ trait CustomFields return $this->client->makeRequest( "/custom-fields/dictionaries/{$customDictionary['code']}/create", - $this->client::METHOD_POST, + "POST", ['customDictionary' => json_encode($customDictionary)] ); } @@ -222,7 +222,7 @@ trait CustomFields return $this->client->makeRequest( "/custom-fields/dictionaries/{$customDictionary['code']}/edit", - $this->client::METHOD_POST, + "POST", ['customDictionary' => json_encode($customDictionary)] ); } @@ -244,7 +244,7 @@ trait CustomFields return $this->client->makeRequest( "/custom-fields/dictionaries/$code", - $this->client::METHOD_GET + "GET" ); } } diff --git a/lib/RetailCrm/Methods/V5/Customers.php b/lib/RetailCrm/Methods/V5/Customers.php index 4b8e89e..b4a5fa5 100644 --- a/lib/RetailCrm/Methods/V5/Customers.php +++ b/lib/RetailCrm/Methods/V5/Customers.php @@ -50,7 +50,7 @@ trait Customers return $this->client->makeRequest( '/customers/combine', - $this->client::METHOD_POST, + "POST", [ 'customers' => json_encode($customers), 'resultCustomer' => json_encode($resultCustomer) diff --git a/lib/RetailCrm/Methods/V5/Orders.php b/lib/RetailCrm/Methods/V5/Orders.php index efb6a74..3116310 100644 --- a/lib/RetailCrm/Methods/V5/Orders.php +++ b/lib/RetailCrm/Methods/V5/Orders.php @@ -59,7 +59,7 @@ trait Orders return $this->client->makeRequest( '/orders/combine', - $this->client::METHOD_POST, + "POST", [ 'technique' => $technique, 'order' => json_encode($order), @@ -89,7 +89,7 @@ trait Orders return $this->client->makeRequest( '/orders/payments/create', - $this->client::METHOD_POST, + "POST", ['payment' => json_encode($payment)] ); } @@ -121,7 +121,7 @@ trait Orders return $this->client->makeRequest( sprintf('/orders/payments/%s/edit', $payment[$by]), - $this->client::METHOD_POST, + "POST", $this->fillSite( $site, ['payment' => json_encode($payment), 'by' => $by] diff --git a/lib/RetailCrm/Methods/V5/Segments.php b/lib/RetailCrm/Methods/V5/Segments.php index ee3016b..260bdf5 100644 --- a/lib/RetailCrm/Methods/V5/Segments.php +++ b/lib/RetailCrm/Methods/V5/Segments.php @@ -52,7 +52,7 @@ trait Segments return $this->client->makeRequest( '/segments', - $this->client::METHOD_GET, + "GET", $parameters ); } diff --git a/lib/RetailCrm/Methods/V5/Stores.php b/lib/RetailCrm/Methods/V5/Stores.php index ed21575..8100fca 100644 --- a/lib/RetailCrm/Methods/V5/Stores.php +++ b/lib/RetailCrm/Methods/V5/Stores.php @@ -60,7 +60,7 @@ trait Stores return $this->client->makeRequest( '/store/product-groups', - $this->client::METHOD_GET, + "GET", $parameters ); } diff --git a/lib/RetailCrm/Methods/V5/Tasks.php b/lib/RetailCrm/Methods/V5/Tasks.php index 0f35ee4..5892e89 100644 --- a/lib/RetailCrm/Methods/V5/Tasks.php +++ b/lib/RetailCrm/Methods/V5/Tasks.php @@ -52,7 +52,7 @@ trait Tasks return $this->client->makeRequest( '/tasks', - $this->client::METHOD_GET, + "GET", $parameters ); } @@ -76,7 +76,7 @@ trait Tasks return $this->client->makeRequest( "/tasks/create", - $this->client::METHOD_POST, + "POST", $this->fillSite( $site, ['task' => json_encode($task)] @@ -103,7 +103,7 @@ trait Tasks return $this->client->makeRequest( "/tasks/{$task['id']}/edit", - $this->client::METHOD_POST, + "POST", $this->fillSite( $site, ['task' => json_encode($task)] @@ -128,7 +128,7 @@ trait Tasks return $this->client->makeRequest( "/tasks/$id", - $this->client::METHOD_GET + "GET" ); } } diff --git a/lib/RetailCrm/Methods/V5/Users.php b/lib/RetailCrm/Methods/V5/Users.php index 3454c8a..82b1331 100644 --- a/lib/RetailCrm/Methods/V5/Users.php +++ b/lib/RetailCrm/Methods/V5/Users.php @@ -53,7 +53,7 @@ trait Users /** @noinspection PhpUndefinedMethodInspection */ return $this->client->makeRequest( "/users/$id/status", - $this->client::METHOD_POST, + "POST", ['status' => $status] ); }