Skip to content
This repository was archived by the owner on Oct 24, 2023. It is now read-only.

Commit 6e2a060

Browse files
committed
Merge branch 'release/v2.6.0'
2 parents 0d508af + 6c03f8b commit 6e2a060

File tree

192 files changed

+7048
-899
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

192 files changed

+7048
-899
lines changed

.travis.yml

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
1-
dist: trusty
1+
dist: xenial
22
sudo: false
33
language: php
44
php:
5-
- 7.0.31
6-
- 5.6.37
7-
- 7.1.18
5+
- 7.0
6+
- 5.6
7+
- 7.1
88
- 7.2
9-
- hhvm
109
- nightly
1110
env:
1211
- GUZZLE=5
1312
- GUZZLE=6
1413
matrix:
1514
allow_failures:
16-
- php: hhvm
1715
- php: nightly
1816
services:
1917
- redis-server
@@ -34,14 +32,13 @@ before_script:
3432
- if [ $GUZZLE == '5' ] ; then composer update -o --prefer-dist --prefer-lowest; fi
3533
- if [ $GUZZLE != '5' ] ; then composer install -o --prefer-dist; fi
3634
script:
37-
- if [ $PHP == '7.1.18' ] && [ $GUZZLE == '6' ]; then ant phpcs-ci; fi
38-
- if [ $GUZZLE == '5' ] || [ $PHP == '5.6.37' ] || [ $PHP == 'hhvm' ] ; then vendor/bin/phpunit -c phpunit5.xml.dist --testsuite=unit; fi
39-
- if [ $GUZZLE == '6' ] && [ $PHP != '5.6.37' ] ; then vendor/bin/phpunit --testsuite=unit; fi
40-
- if [ $PHP == '7.0.31' ] && [ $GUZZLE == '6' ] && [ $TRAVIS_PULL_REQUEST == 'false' ]; then vendor/bin/phpunit --testsuite=integration; fi
41-
- ant behat
35+
- if [ $PHP == '7.1' ] && [ $GUZZLE == '6' ]; then vendor/bin/phpcs --standard=PSR2 --extensions=php --ignore=autoload.php,src/Core/Builder src/; fi
36+
- if [ $GUZZLE == '5' ] || [ $PHP == '5.6' ] || [ $PHP == 'hhvm' ] ; then vendor/bin/phpunit -c phpunit5.xml.dist --testsuite=unit; fi
37+
- if [ $GUZZLE == '6' ] && [ $PHP != '5.6' ] ; then vendor/bin/phpunit --testsuite=unit; fi
38+
- if [ $PHP == '7.0' ] && [ $GUZZLE == '6' ] && [ $TRAVIS_PULL_REQUEST == 'false' ]; then vendor/bin/phpunit --testsuite=integration; fi
4239
- bin/ctp-tlscheck.php
4340
before_deploy:
44-
- if [ $(phpenv version-name) = "7.1.18" ] ; then ant apigen; fi
41+
- if [ $PHP == '7.1' ] && [ $GUZZLE == '6' ] ; then ./install-apigen.sh && php apigen.phar generate --debug --config build/apigen.neon; fi
4542
deploy:
4643
- provider: script
4744
skip_cleanup: true

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
<a name="2.6.0"></a>
2+
# [2.6.0](https://github.com/commercetools/commercetools-php-sdk/compare/v2.5.1...v2.6.0) (2019-01-11)
3+
4+
5+
### Bug Fixes
6+
7+
* **OrderEditResult:** fix data mapping ([08af3bd](https://github.com/commercetools/commercetools-php-sdk/commit/08af3bd))
8+
* **OrderEditResult:** fix type property ([c84d649](https://github.com/commercetools/commercetools-php-sdk/commit/c84d649))
9+
* **OrderEditUpdateByKey:** fix inheritance class & add test for dryRun ([7e0a465](https://github.com/commercetools/commercetools-php-sdk/commit/7e0a465))
10+
* **OrderEdit:** fix StagedOrder structure & ActionBuilder ([6fd3c65](https://github.com/commercetools/commercetools-php-sdk/commit/6fd3c65))
11+
* **RequestBuilder:** fix OrderEditApplyRequest ([252f319](https://github.com/commercetools/commercetools-php-sdk/commit/252f319))
12+
* **SetCustomShippingMethodAction:** fix type of shippingRate property ([ce1afa4](https://github.com/commercetools/commercetools-php-sdk/commit/ce1afa4))
13+
* **Subscription:** fix typo in SQS destination ([cbf1dae](https://github.com/commercetools/commercetools-php-sdk/commit/cbf1dae))
14+
* **TLS Check:** update urls for TLS 1.2 check ([f006006](https://github.com/commercetools/commercetools-php-sdk/commit/f006006))
15+
16+
17+
### Features
18+
19+
* **ApiClients:** add support for managing api clients ([93b62de](https://github.com/commercetools/commercetools-php-sdk/commit/93b62de))
20+
* **Order:** add support for CustomLineItemReturnItem ([82ebfdf](https://github.com/commercetools/commercetools-php-sdk/commit/82ebfdf))
21+
* **Payment:** support anonymousId ([4dd0e3e](https://github.com/commercetools/commercetools-php-sdk/commit/4dd0e3e))
22+
123
<a name="2.5.1"></a>
224
## [2.5.1](https://github.com/commercetools/commercetools-php-sdk/compare/v2.5.0...v2.5.1) (2018-10-24)
325

README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,18 @@ Now you can enable at Preferences > Editor > Inspections > PHP the "PHP code sni
217217

218218
### Running integration tests
219219

220-
For running the integration tests you need an empty commercetools project and have to create an API client using the commercetools Admin Center with the scopes manage_project, view_orders and view_products.
220+
For running the integration tests you need an empty commercetools project and have to create an API client using the commercetools Merchant Center with the scopes:
221+
```
222+
manage_project
223+
view_orders
224+
view_products
225+
manage_my_shopping_lists
226+
manage_my_orders
227+
manage_my_payments
228+
manage_my_profile
229+
manage_api_clients
230+
create_anonymous_token
231+
```
221232

222233
#### Local environment
223234

@@ -235,7 +246,7 @@ echo "COMMERCETOOLS_CLIENT_ID=YourClientID" > env.list
235246
echo "COMMERCETOOLS_CLIENT_SECRET=YourClientSecret" >> env.list
236247
echo "COMMERCETOOLS_PROJECT=YourProjectKey" >> env.list
237248

238-
docker run --env-file env.list -v $PWD:/opt/app -w /opt/app --rm=true jaysde/php-test-base tools/docker-phpunit.sh
249+
docker run --env-file env.list -v $PWD:/opt/app -w /opt/app --rm=true jenschude/php-test-base tools/docker-phpunit.sh
239250
```
240251

241252
### <a name="contribute"></a>Contribute

bin/ctp-tlscheck.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class Tls12Checker
1111
'auth.commercetools.co',
1212
'api.commercetools.co',
1313
'api.sphere.io',
14-
'api.commercetools.co',
14+
'auth.sphere.io',
1515
];
1616

1717
public function allowedCiphers()

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"cache/filesystem-adapter": "^1.0",
5555
"cache/void-adapter": "^1.0",
5656
"incenteev/composer-parameter-handler": "^2.1",
57-
"commercetools/commercetools-api-reference": "dev-master#646973bdc9a5da9216fa8ae774ed51110186e3fa"
57+
"commercetools/commercetools-api-reference": "dev-master"
5858
},
5959
"replaces": {
6060
"commercetools/commons": "*"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "commercetools-php-sdk-changelog",
3-
"version": "2.5.1",
3+
"version": "2.6.0",
44
"description": "commercetools PHP SDK changelog generator package description",
55
"homepage": "https://github.com/commercetools/commercetools-php-sdk",
66
"bugs": "https://github.com/commercetools/commercetools-php-sdk/issues",

set_guzzle5.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/bash
22
SRC='"guzzlehttp/guzzle": "^6.0"'
3-
DST='"guzzlehttp/guzzle": "^5.3.3", "react/promise": "^2.2.0"'
3+
DST='"guzzlehttp/guzzle": "^5.3.3", "react/promise": "^2.2.0", "guzzlehttp/ringphp": "^1.1.1"'
44
sed -ibak -e "s|$SRC|$DST|g" composer.json

src/Core/AbstractHttpClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*/
1515
abstract class AbstractHttpClient
1616
{
17-
const VERSION = '2.5.1';
17+
const VERSION = '2.6.0';
1818

1919
/**
2020
* @var AdapterInterface
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<?php
2+
// phpcs:disable Generic.Files.LineLength
3+
namespace Commercetools\Core\Builder\Request;
4+
5+
use Commercetools\Core\Request\ApiClients\ApiClientByIdGetRequest;
6+
use Commercetools\Core\Request\ApiClients\ApiClientCreateRequest;
7+
use Commercetools\Core\Model\ApiClient\ApiClientDraft;
8+
use Commercetools\Core\Request\ApiClients\ApiClientDeleteRequest;
9+
use Commercetools\Core\Model\ApiClient\ApiClient;
10+
use Commercetools\Core\Request\ApiClients\ApiClientQueryRequest;
11+
12+
class ApiClientRequestBuilder
13+
{
14+
15+
/**
16+
*
17+
* @param string $id
18+
* @return ApiClientByIdGetRequest
19+
*/
20+
public function getById($id)
21+
{
22+
$request = ApiClientByIdGetRequest::ofId($id);
23+
return $request;
24+
}
25+
26+
/**
27+
*
28+
* @param ApiClientDraft $apiClientDraft
29+
* @return ApiClientCreateRequest
30+
*/
31+
public function create(ApiClientDraft $apiClientDraft)
32+
{
33+
$request = ApiClientCreateRequest::ofDraft($apiClientDraft);
34+
return $request;
35+
}
36+
37+
/**
38+
*
39+
* @param ApiClient $apiClient
40+
* @return ApiClientDeleteRequest
41+
*/
42+
public function delete(ApiClient $apiClient)
43+
{
44+
$request = ApiClientDeleteRequest::ofId($apiClient->getId());
45+
return $request;
46+
}
47+
48+
/**
49+
*
50+
*
51+
* @return ApiClientQueryRequest
52+
*/
53+
public function query()
54+
{
55+
$request = ApiClientQueryRequest::of();
56+
return $request;
57+
}
58+
59+
/**
60+
* @return ApiClientRequestBuilder
61+
*/
62+
public function of()
63+
{
64+
return new self();
65+
}
66+
}
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
<?php
2+
// phpcs:disable Generic.Files.LineLength
3+
namespace Commercetools\Core\Builder\Request;
4+
5+
use Commercetools\Core\Request\OrderEdits\OrderEditApplyRequest;
6+
use Commercetools\Core\Model\OrderEdit\OrderEdit;
7+
use Commercetools\Core\Request\OrderEdits\OrderEditByIdGetRequest;
8+
use Commercetools\Core\Request\OrderEdits\OrderEditByKeyGetRequest;
9+
use Commercetools\Core\Request\OrderEdits\OrderEditCreateRequest;
10+
use Commercetools\Core\Model\OrderEdit\OrderEditDraft;
11+
use Commercetools\Core\Request\OrderEdits\OrderEditDeleteByKeyRequest;
12+
use Commercetools\Core\Request\OrderEdits\OrderEditDeleteRequest;
13+
use Commercetools\Core\Request\OrderEdits\OrderEditQueryRequest;
14+
use Commercetools\Core\Request\OrderEdits\OrderEditUpdateByKeyRequest;
15+
use Commercetools\Core\Request\OrderEdits\OrderEditUpdateRequest;
16+
17+
class OrderEditRequestBuilder
18+
{
19+
20+
/**
21+
*
22+
* @param OrderEdit $orderEdit
23+
* @param int $resourceVersion
24+
* @return OrderEditApplyRequest
25+
*/
26+
public function apply(OrderEdit $orderEdit, $resourceVersion)
27+
{
28+
$request = OrderEditApplyRequest::ofIdVersionAndResourceVersion($orderEdit->getId(), $orderEdit->getVersion(), $resourceVersion);
29+
return $request;
30+
}
31+
32+
/**
33+
*
34+
* @param string $id
35+
* @return OrderEditByIdGetRequest
36+
*/
37+
public function getById($id)
38+
{
39+
$request = OrderEditByIdGetRequest::ofId($id);
40+
return $request;
41+
}
42+
43+
/**
44+
*
45+
* @param string $key
46+
* @return OrderEditByKeyGetRequest
47+
*/
48+
public function getByKey($key)
49+
{
50+
$request = OrderEditByKeyGetRequest::ofKey($key);
51+
return $request;
52+
}
53+
54+
/**
55+
*
56+
* @param OrderEditDraft $orderEdit
57+
* @return OrderEditCreateRequest
58+
*/
59+
public function create(OrderEditDraft $orderEdit)
60+
{
61+
$request = OrderEditCreateRequest::ofDraft($orderEdit);
62+
return $request;
63+
}
64+
65+
/**
66+
*
67+
* @param OrderEdit $orderEdit
68+
* @return OrderEditDeleteByKeyRequest
69+
*/
70+
public function deleteByKey(OrderEdit $orderEdit)
71+
{
72+
$request = OrderEditDeleteByKeyRequest::ofKeyAndVersion($orderEdit->getKey(), $orderEdit->getVersion());
73+
return $request;
74+
}
75+
76+
/**
77+
*
78+
* @param OrderEdit $orderEdit
79+
* @return OrderEditDeleteRequest
80+
*/
81+
public function delete(OrderEdit $orderEdit)
82+
{
83+
$request = OrderEditDeleteRequest::ofIdAndVersion($orderEdit->getId(), $orderEdit->getVersion());
84+
return $request;
85+
}
86+
87+
/**
88+
*
89+
*
90+
* @return OrderEditQueryRequest
91+
*/
92+
public function query()
93+
{
94+
$request = OrderEditQueryRequest::of();
95+
return $request;
96+
}
97+
98+
/**
99+
*
100+
* @param OrderEdit $orderEdit
101+
* @return OrderEditUpdateByKeyRequest
102+
*/
103+
public function updateByKey(OrderEdit $orderEdit)
104+
{
105+
$request = OrderEditUpdateByKeyRequest::ofKeyAndVersion($orderEdit->getKey(), $orderEdit->getVersion());
106+
return $request;
107+
}
108+
109+
/**
110+
*
111+
* @param OrderEdit $orderEdit
112+
* @return OrderEditUpdateRequest
113+
*/
114+
public function update(OrderEdit $orderEdit)
115+
{
116+
$request = OrderEditUpdateRequest::ofIdAndVersion($orderEdit->getId(), $orderEdit->getVersion());
117+
return $request;
118+
}
119+
120+
/**
121+
* @return OrderEditRequestBuilder
122+
*/
123+
public function of()
124+
{
125+
return new self();
126+
}
127+
}

0 commit comments

Comments
 (0)