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

Commit d5a7ba1

Browse files
author
Jens Schulze
committed
Merge branch 'release/v1.0.0-RC9'
2 parents 4716014 + b29bf36 commit d5a7ba1

File tree

832 files changed

+2665
-990
lines changed

Some content is hidden

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

832 files changed

+2665
-990
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ composer.lock
1111
myapp.ini
1212
/local/
1313
/tools/node_modules
14+
requests.log

.travis.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
language: php
22
php:
3-
- "5.6"
4-
- "5.5"
5-
- "5.4"
6-
- "nightly"
7-
- "hhvm"
3+
- 5.6
4+
- 5.5
5+
- 5.4
6+
- 7.0
7+
- hhvm
88

99
matrix:
1010
allow_failures:
1111
- php: hhvm
12-
- php: nightly
12+
- php: 7.0
1313

1414
services:
1515
- redis-server
@@ -20,16 +20,17 @@ cache:
2020

2121
before_script:
2222
- composer config -g github-oauth.github.com $GITHUB_OAUTH_TOKEN
23-
- sh -c "if [ $TRAVIS_PHP_VERSION != 'hhvm' ] ; then echo 'extension = redis.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini ; fi"
24-
- sh -c "if [ $TRAVIS_PHP_VERSION != 'hhvm' ] && [ $TRAVIS_PHP_VERSION != 'nightly' ] && [ `php-config --vernum` -ge 50500 ] ; then pecl config-set preferred_state beta; printf "yes\n" | pecl install -f apcu ; else echo 'extension="apc.so"' >> ./tests/apc.ini ; fi"
25-
- sh -c "if [ $TRAVIS_PHP_VERSION != 'hhvm' ] && [ $TRAVIS_PHP_VERSION != 'nightly' ] ; then phpenv config-add ./tests/apc.ini; fi"
23+
- sh -c "if [ $TRAVIS_PHP_VERSION != 'hhvm' ] && [ `php-config --vernum` -lt 70000 ] ; then echo 'extension = redis.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini ; fi"
24+
- sh -c "if [ $TRAVIS_PHP_VERSION != 'hhvm' ] && [ `php-config --vernum` -ge 50400 ] && [ `php-config --vernum` -lt 70000 ]; then printf "yes\n" | pecl install -f apcu-4.0.10 ; fi"
25+
- sh -c "if [ $TRAVIS_PHP_VERSION != 'hhvm' ] && [ `php-config --vernum` -ge 70000 ] ; then printf "yes\n" | pecl install -f apcu ; echo 'extension="apcu.so"' >> ./tests/apc.ini ; fi"
26+
- sh -c "if [ $TRAVIS_PHP_VERSION != 'hhvm' ] ; then phpenv config-add ./tests/apc.ini; fi"
2627
- if [ $TRAVIS_PHP_VERSION == '5.4' ] ; then ./set_guzzle5.sh; fi
2728
- composer install -o
2829

2930
script:
3031
- ant phpcs-ci
3132
- phpunit --testsuite=unit
32-
- if [ $TRAVIS_PHP_VERSION == '5.5' ] ; then phpunit --testsuite=integration; fi
33+
- if [ $TRAVIS_PHP_VERSION == '5.6' ] ; then phpunit --testsuite=integration; fi
3334
- ant behat
3435

3536
after_success:

CHANGELOG.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,74 @@
1+
<a name="1.0.0-RC9"></a>
2+
# [1.0.0-RC9](https://github.com/sphereio/commercetools-php-sdk/compare/v1.0.0-RC8...v1.0.0-RC9) (2016-01-11)
3+
4+
5+
### Bug Fixes
6+
7+
* **Collection:** fix serialization of collection with primitive types ([0e1251f](https://github.com/sphereio/commercetools-php-sdk/commit/0e1251f))
8+
* **CustomField:** fix custom field object draft to reflect API changes ([90156aa](https://github.com/sphereio/commercetools-php-sdk/commit/90156aa))
9+
* **CustomFields:** fix custom type update actions to match changed API ([26efdcf](https://github.com/sphereio/commercetools-php-sdk/commit/26efdcf))
10+
* **CustomObject:** remove type for custom object value ([b37c604](https://github.com/sphereio/commercetools-php-sdk/commit/b37c604)), closes [#163](https://github.com/sphereio/commercetools-php-sdk/issues/163)
11+
* **Product:** fix type of priceId ([23c2de5](https://github.com/sphereio/commercetools-php-sdk/commit/23c2de5))
12+
* **ProductProjection:** fix context of getAllVariants helper method ([28526db](https://github.com/sphereio/commercetools-php-sdk/commit/28526db))
13+
14+
### Features
15+
16+
* **Cart:** add fields to cart draft ([8b2ab3b](https://github.com/sphereio/commercetools-php-sdk/commit/8b2ab3b))
17+
* **Category:** add CategoryCreated and CategorySlugChanged messages ([014dde2](https://github.com/sphereio/commercetools-php-sdk/commit/014dde2))
18+
* **CategoryCollection:** add getById to CategoryCollection ([1a79cbc](https://github.com/sphereio/commercetools-php-sdk/commit/1a79cbc))
19+
* **Channel:** add custom field to channel ([5e9601d](https://github.com/sphereio/commercetools-php-sdk/commit/5e9601d))
20+
* **Client:** add config option for accept encoding (e.g. enabling gzip compression) ([c57f2ee](https://github.com/sphereio/commercetools-php-sdk/commit/c57f2ee))
21+
* **Client:** add gzip as default acceptEncoding ([2ddd99d](https://github.com/sphereio/commercetools-php-sdk/commit/2ddd99d))
22+
* **CurrencyFormatter:** change currencyFormatter to use fraction digits from intl extension ([e8d058b](https://github.com/sphereio/commercetools-php-sdk/commit/e8d058b))
23+
* **Customer:** add CustomerCreated message ([12c9bff](https://github.com/sphereio/commercetools-php-sdk/commit/12c9bff))
24+
* **Customer:** add getter for default shipping and billing address ([7b776f9](https://github.com/sphereio/commercetools-php-sdk/commit/7b776f9)), closes [#162](https://github.com/sphereio/commercetools-php-sdk/issues/162)
25+
* **CustomFields:** update custom field draft to API changes ([dfae984](https://github.com/sphereio/commercetools-php-sdk/commit/dfae984))
26+
* **CustomObject:** add delete by id request ([9eb8ba7](https://github.com/sphereio/commercetools-php-sdk/commit/9eb8ba7))
27+
* **Inventory:** add SetSupplyChannel action ([d453e5e](https://github.com/sphereio/commercetools-php-sdk/commit/d453e5e))
28+
* **Payment:** add change transaction state, timestamp and interactionId actions ([3eee823](https://github.com/sphereio/commercetools-php-sdk/commit/3eee823))
29+
* **Payment:** add PaymentTransactionChanged message ([7c3e6d8](https://github.com/sphereio/commercetools-php-sdk/commit/7c3e6d8))
30+
* **Payment:** add state and id to payment transaction ([b7ee577](https://github.com/sphereio/commercetools-php-sdk/commit/b7ee577))
31+
* **Product:** add price field to variant for price selection ([ea8169e](https://github.com/sphereio/commercetools-php-sdk/commit/ea8169e))
32+
* **Product:** add ProductCreated and ProductSlugChanged messages ([dbb8a28](https://github.com/sphereio/commercetools-php-sdk/commit/dbb8a28))
33+
* **Product:** support resource identifier for product type at product creation ([d7e1980](https://github.com/sphereio/commercetools-php-sdk/commit/d7e1980))
34+
* **ProductSearch:** add matching variant to ProductVariant object ([2e336df](https://github.com/sphereio/commercetools-php-sdk/commit/2e336df))
35+
* **ProductSearch:** add price select methods for search ([ad8b4cd](https://github.com/sphereio/commercetools-php-sdk/commit/ad8b4cd))
36+
* **ProductSearch:** add price select methods to ProductProjectionSearchRequest ([51f889d](https://github.com/sphereio/commercetools-php-sdk/commit/51f889d))
37+
* **ProductSearch:** add price select parameters ([f1717b8](https://github.com/sphereio/commercetools-php-sdk/commit/f1717b8))
38+
* **ProductType:** add get, update and delete by key requests ([0ad3973](https://github.com/sphereio/commercetools-php-sdk/commit/0ad3973))
39+
* **ProductType:** add getByName and getById to ProductTypeCollection ([2b2e005](https://github.com/sphereio/commercetools-php-sdk/commit/2b2e005))
40+
* **Request:** add min and max for query limit ([66947e6](https://github.com/sphereio/commercetools-php-sdk/commit/66947e6))
41+
42+
43+
### BREAKING CHANGES
44+
45+
* CustomObject: CustomObjectCreateRequest expects CustomObjectDraft object
46+
47+
Before:
48+
```
49+
$request = CustomObjectCreateRequest::ofObject(CustomObject::of()->setContainer('test')->setKey('test-key')->setValue(json_encode($value)));
50+
```
51+
52+
After:
53+
```
54+
$request = CustomObjectCreateRequest::ofObject(CustomObjectDraft::ofContainerKeyAndValue('test', 'test-key', $value));
55+
```
56+
* CustomFields: the type reference had been changed at the API
57+
58+
Before:
59+
```
60+
$customFieldObjectDraft->setTypeId('type-12345');
61+
$customFieldObjectDraft->setTypeKey('type-key');
62+
```
63+
64+
After:
65+
```
66+
$customFieldObjectDraft->setType(TypeReference::ofId('type-12345'));
67+
$customFieldObjectDraft->setType(TypeReference::ofKey('type-key'));
68+
```
69+
70+
71+
172
<a name="1.0.0-RC8"></a>
273
# [1.0.0-RC8](https://github.com/sphereio/commercetools-php-sdk/compare/v1.0.0-RC7...v1.0.0-RC8) (2015-10-30)
374

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# <img src="build/theme/resources/CT_cube_200px.png" width="40" align="center"></img> commercetools PHP SDK
22

3-
> STATUS: Release Candidate 8. We ask you to really use this API thoroughly now, especially the API design and object structure. Thank you very much!
3+
> STATUS: Release Candidate 9. We ask you to really use this API thoroughly now, especially the API design and object structure. Thank you very much!
44
>
55
> See the [Milestone Plan](https://github.com/sphereio/commercetools-php-sdk/milestones?direction=desc&sort=completeness&state=open) for details of what's planned in detail. We love feedback and [Issue reports](https://github.com/sphereio/commercetools-php-sdk/issues?q=is%3Aopen+is%3Aissue+sort%3Acreated-asc)!
66
> Up-to-Date planning status can be found on this [Waffle Board](https://waffle.io/sphereio/commercetools-php-sdk)
@@ -189,7 +189,7 @@ Then:
189189
1. fork the repository on GitHub
190190
2. code and add tests that cover the created code. Your code should be warning-free.
191191
3. stick to PSR-2 and and don't reformat existing code.
192-
4. make a pull request. @ct-jensschulze will review it and pull or come back to you.
192+
4. make a pull request. @jayS-de will review it and pull or come back to you.
193193

194194

195195

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,9 @@
4141
"pdepend/pdepend": "@stable",
4242
"phploc/phploc": "^2.0",
4343
"mayflower/php-codebrowser": "^1.0",
44-
"doctrine/cache": "^1.4",
44+
"doctrine/cache": "^1.5",
4545
"monolog/monolog": "^1.12",
4646
"behat/behat": "^3.0",
47-
"phpspec/prophecy-phpunit": "^1.0",
4847
"phpunit/phpcov": "*",
4948
"fabpot/php-cs-fixer": "@stable"
5049
}

docroot/annotations.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* @author @ct-jensschulze <jens.schulze@commercetools.de>
3+
* @author @jayS-de <jens.schulze@commercetools.de>
44
*/
55

66
namespace Commercetools\Core;

docroot/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* @author @ct-jensschulze <jens.schulze@commercetools.de>
3+
* @author @jayS-de <jens.schulze@commercetools.de>
44
* @created: 04.02.15, 13:31
55
*/
66
namespace Commercetools\Core;

features/bootstrap/ApiContext.php

Lines changed: 46 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* @author @ct-jensschulze <jens.schulze@commercetools.de>
3+
* @author @jayS-de <jens.schulze@commercetools.de>
44
*/
55

66
namespace Commercetools\Core;
@@ -55,11 +55,7 @@ protected function getContext($context)
5555
public function iHaveAContextDraftWithValuesJson($context, PyStringNode $json)
5656
{
5757
$context = $this->getContext($context);
58-
if ($context == 'CustomObject') {
59-
$class = '\Commercetools\Core\Model\\CustomObject\\CustomObject';
60-
} else {
61-
$class = '\Commercetools\Core\Model\\' . $context . '\\' . $context . 'Draft';
62-
}
58+
$class = '\Commercetools\Core\Model\\' . $context . '\\' . $context . 'Draft';
6359

6460
$rawData = json_decode((string)$json, true);
6561
$object = call_user_func_array($class.'::fromArray', [$rawData]);
@@ -183,6 +179,19 @@ public function iWantToFetchAContext($context)
183179
* @Given i want to fetch a :context by key
184180
*/
185181
public function iWantToFetchAContextByKey($context)
182+
{
183+
$context = $this->getContext($context);
184+
$module = $this->getModuleName($context);
185+
$request = '\Commercetools\Core\Request\\' . $module . '\\' . $context . 'ByKeyGetRequest';
186+
$requestContext = $context . 'Request';
187+
$key = $this->objects[$requestContext]['id'];
188+
$this->request = call_user_func_array($request. '::ofKey', [$key]);
189+
}
190+
191+
/**
192+
* @Given i want to fetch a :context by container and key
193+
*/
194+
public function iWantToFetchAContextByContainerAndKey($context)
186195
{
187196
$context = $this->getContext($context);
188197
$module = $this->getModuleName($context);
@@ -267,10 +276,40 @@ public function iWantToUpdateAContext($context)
267276
$this->request = call_user_func_array($request. '::ofIdAndVersion', [$id, $version]);
268277
}
269278

279+
/**
280+
* @Given i want to update a :context by key
281+
*/
282+
public function iWantToUpdateAContextByKey($context)
283+
{
284+
$context = $this->getContext($context);
285+
$module = $this->getModuleName($context);
286+
$request = '\Commercetools\Core\Request\\' . $module . '\\' . $context . 'UpdateByKeyRequest';
287+
288+
$requestContext = $context . 'Request';
289+
$id = $this->objects[$requestContext]['id'];
290+
$version = $this->objects[$requestContext]['version'];
291+
$this->request = call_user_func_array($request. '::ofKeyAndVersion', [$id, $version]);
292+
}
293+
294+
270295
/**
271296
* @Given i want to delete a :context by key
272297
*/
273-
public function iWantToDeleteAByKey($context)
298+
public function iWantToDeleteAContextByKey($context)
299+
{
300+
$context = $this->getContext($context);
301+
$module = $this->getModuleName($context);
302+
$request = '\Commercetools\Core\Request\\' . ucfirst($module) . '\\' . ucfirst($context) . 'DeleteByKeyRequest';
303+
$requestContext = $context . 'Request';
304+
$id = $this->objects[$requestContext]['id'];
305+
$version = $this->objects[$requestContext]['version'];
306+
$this->request = call_user_func_array($request. '::ofKeyAndVersion', [$id, $version]);
307+
}
308+
309+
/**
310+
* @Given i want to delete a :context by container and key
311+
*/
312+
public function iWantToDeleteAContextByContainerAndKey($context)
274313
{
275314
$context = $this->getContext($context);
276315
$module = $this->getModuleName($context);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Feature: I want to delete a custom object
22
Scenario: Delete custom object
33
Given a "customObject" is identified by "container" and key "key"
4-
And i want to delete a "customObject" by key
4+
And i want to delete a "customObject" by container and key
55
Then the path should be "custom-objects/container/key"
66
And the method should be "DELETE"

features/request/CustomObject/CustomObjectQuery.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Feature: I want to query customObjects
22
Scenario: Fetch a customObject by id
33
Given a "customObject" is identified by "container" and key "key"
4-
Given i want to fetch a "customObject" by key
4+
Given i want to fetch a "customObject" by container and key
55
Then the path should be "custom-objects/container/key"
66
And the method should be "GET"
77

features/request/ProductType/ProductTypeDelete.feature

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,9 @@ Feature: I want to delete a product type
44
And i want to delete a "productType"
55
Then the path should be "product-types/id?version=1"
66
And the method should be "DELETE"
7+
8+
Scenario: Delete product type by key
9+
Given a "productType" is identified by "mytype" and version 1
10+
And i want to delete a "productType" by key
11+
Then the path should be "product-types/key=mytype?version=1"
12+
And the method should be "DELETE"

features/request/ProductType/ProductTypeQuery.feature

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ Feature: I want to query productTypes
55
Then the path should be "product-types/id"
66
And the method should be "GET"
77

8+
Scenario: Fetch a productType by id
9+
Given a "productType" is identified by "mytype"
10+
Given i want to fetch a "productType" by key
11+
Then the path should be "product-types/key=mytype"
12+
And the method should be "GET"
13+
814
Scenario: Query customers with filter applied
915
Given i want to query "productTypes"
1016
And filter them with criteria 'name="Peter"'

features/request/ProductType/ProductTypeUpdate.feature

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,20 @@ Feature: I want to update a product type
1313
}
1414
"""
1515

16+
Scenario: Empty update by key
17+
Given a "productType" is identified by "mytype" and version 1
18+
And i want to update a "productType" by key
19+
Then the path should be "product-types/key=mytype"
20+
And the method should be "POST"
21+
And the request should be
22+
"""
23+
{
24+
"version": 1,
25+
"actions": [
26+
]
27+
}
28+
"""
29+
1630
Scenario: change name
1731
Given a "productType" is identified by "id" and version 1
1832
And i want to update a "productType"

push-docs-to-gh-pages.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
# to be called as "after_success: - ./push-docs-to-gh-pages.sh" in .travis.yml
1010

11-
if [ $(phpenv version-name) = "5.5" ] ; then ant apigen; fi
11+
if [ $(phpenv version-name) = "5.6" ] ; then ant apigen; fi
1212

1313
if [ "$TRAVIS_REPO_SLUG" == "sphereio/commercetools-php-sdk" ] && [ $(phpenv version-name) = "5.5" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && ( [ "$TRAVIS_BRANCH" == "master" ] || [ "$TRAVIS_BRANCH" == `git describe --tags --always HEAD` ] ); then
1414
echo -e "Publishing documentation to gh-pages branch ...\n"

src/AbstractHttpClient.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* @author @ct-jensschulze <jens.schulze@commercetools.de>
3+
* @author @jayS-de <jens.schulze@commercetools.de>
44
* @created: 22.01.15, 13:51
55
*/
66

@@ -14,7 +14,7 @@
1414
*/
1515
abstract class AbstractHttpClient
1616
{
17-
const VERSION = '1.0.0-RC8';
17+
const VERSION = '1.0.0-RC9';
1818

1919
/**
2020
* @var AdapterInterface
@@ -76,10 +76,14 @@ public function getConfig()
7676
public function getHttpClient($options = [])
7777
{
7878
if (is_null($this->httpClient)) {
79+
$headers = ['User-Agent' => $this->getUserAgent()];
80+
if (!is_null($this->getConfig()->getAcceptEncoding())) {
81+
$headers['Accept-Encoding'] = $this->getConfig()->getAcceptEncoding();
82+
}
7983
$options = array_merge(
8084
[
8185
'base_uri' => $this->getBaseUrl(),
82-
'headers' => ['User-Agent' => $this->getUserAgent()]
86+
'headers' => $headers
8387
],
8488
$options
8589
);

src/Cache/AbstractCacheAdapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* @author @ct-jensschulze <jens.schulze@commercetools.de>
3+
* @author @jayS-de <jens.schulze@commercetools.de>
44
* @created 19.01.15, 17:10
55
*/
66

src/Cache/ApcCacheAdapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* @author @ct-jensschulze <jens.schulze@commercetools.de>
3+
* @author @jayS-de <jens.schulze@commercetools.de>
44
* @created 20.01.15, 13:42
55
*/
66

0 commit comments

Comments
 (0)