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

Commit ae5df40

Browse files
author
Jens Schulze
committed
Merge branch 'release/v2.3.0'
2 parents c89ced3 + 2df6ebc commit ae5df40

File tree

1,243 files changed

+8576
-4053
lines changed

Some content is hidden

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

1,243 files changed

+8576
-4053
lines changed

.scrutinizer.yml

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,35 @@
11
tools:
2-
php_sim: true
3-
php_pdepend: true
4-
php_analyzer: true
5-
php_code_sniffer: true
6-
php_changetracking: true
7-
php_mess_detector: true
8-
sensiolabs_security_checker: true
9-
php_cs_fixer:
10-
config: { level: psr2 }
2+
php_sim: true
3+
php_pdepend: true
4+
php_analyzer: true
5+
php_code_sniffer: true
6+
php_changetracking: true
7+
php_mess_detector: true
8+
sensiolabs_security_checker: true
9+
php_cs_fixer:
10+
config: { level: psr2 }
1111
before_commands:
12-
- composer config -g github-oauth.github.com $GITHUB_OAUTH_TOKEN
13-
- composer global require hirak/prestissimo
14-
- composer install --prefer-dist -o
12+
- composer config -g github-oauth.github.com $GITHUB_OAUTH_TOKEN
13+
- composer global require hirak/prestissimo
14+
- composer install --prefer-dist -o
1515
build:
16-
environment:
17-
php: '7.0'
18-
dependencies:
19-
before:
20-
#Only 5.4 uses APC
21-
- if [[ "`phpenv version-name`" =~ "^5.4" ]] && [ "`phpenv version-name`" != "hhvm" ]; then echo -e "apc.enabled=1\napc.enable_cli=1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi
22-
#+5.5 uses APCU
23-
- if [[ ! "`phpenv version-name`" =~ "^5.4" ]] && [ "`phpenv version-name`" != "hhvm" ]; then printf "\n"| echo -e "apc.enabled=1\napc.enable_cli=1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi
24-
tests:
16+
environment:
17+
php:
18+
version: '7.1'
19+
ini:
20+
apc.enabled: 1
21+
apc.enable_cli: 1
22+
nodes:
23+
my-tests:
24+
tests:
2525
override:
26-
-
27-
command: vendor/bin/behat -f progress
28-
-
29-
command: vendor/bin/phpunit -d zend.enable_gc=0 --coverage-clover=coverage0
30-
coverage:
31-
file: 'coverage0'
32-
format: 'php-clover'
26+
-
27+
command: vendor/bin/behat -f progress
28+
-
29+
command: vendor/bin/phpunit --coverage-clover=coverage0
30+
coverage:
31+
file: 'coverage0'
32+
format: 'php-clover'
33+
- command: php-scrutinizer-run
3334
filter:
34-
excluded_paths: [build/*, tests/*, docroot/*, features/*]
35+
excluded_paths: [build/*, tests/*, docroot/*, features/*, src/Core/Helper/Annotate/*, src/Core/Helper/State/*, src/Core/Helper/Subscriber/*]

.travis.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@ cache:
2020
directories:
2121
- vendor
2222
before_install:
23+
- openssl aes-256-cbc -K $encrypted_17acaeff100f_key -iv $encrypted_17acaeff100f_iv -in github_deploy_key.enc -out github_deploy_key -d
24+
- chmod 600 github_deploy_key
25+
- eval $(ssh-agent -s)
26+
- ssh-add github_deploy_key
2327
- PHP=$TRAVIS_PHP_VERSION
2428
- if [ $PHP != 'hhvm' ] ; then echo "extension = redis.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini ; fi
25-
- if [ $PHP != 'hhvm' ] && [ `php-config --vernum` -lt 70000 ]; then printf "yes\n" | pecl install -f apcu-4.0.10 ; fi
26-
- if [ $PHP != 'hhvm' ] && [ `php-config --vernum` -ge 70000 ] ; then printf "yes\n" | pecl install -f apcu ; fi
27-
- if [ $PHP != 'hhvm' ] ; then phpenv config-add ./tests/apc.ini; fi
2829
before_script:
2930
- composer config -g github-oauth.github.com $GITHUB_OAUTH_TOKEN
3031
- if [ $GUZZLE == '5' ] ; then ./set_guzzle5.sh; fi
@@ -35,7 +36,7 @@ script:
3536
- ant phpcs-ci
3637
- if [ $GUZZLE == '5' ] || [ $PHP == '5.6' ] || [ $PHP == 'hhvm' ] ; then vendor/bin/phpunit -c phpunit5.xml.dist --testsuite=unit; fi
3738
- if [ $GUZZLE == '6' ] && [ $PHP != '5.6' ] ; then vendor/bin/phpunit --testsuite=unit; fi
38-
- if [ $PHP == '7.0' ] && [ $GUZZLE == '6' ] ; then vendor/bin/phpunit --testsuite=integration; fi
39+
- if [ $PHP == '7.0' ] && [ $GUZZLE == '6' ] && [ $TRAVIS_PULL_REQUEST == 'false' ]; then vendor/bin/phpunit --testsuite=integration; fi
3940
- ant behat
4041
after_success:
4142
- if [ $PHP == '7.1' ] && [ $GUZZLE == '6' ] ; then ./push-docs-to-gh-pages.sh; fi

CHANGELOG.md

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,45 @@
1+
<a name="2.3.0"></a>
2+
# [2.3.0](https://github.com/commercetools/commercetools-php-sdk/compare/v2.2.1...v2.3.0) (2018-03-13)
3+
4+
5+
### Bug Fixes
6+
7+
* **Context:** fix setting of uninitialized properties in context object ([adbb71f](https://github.com/commercetools/commercetools-php-sdk/commit/adbb71f)), closes [#379](https://github.com/commercetools/commercetools-php-sdk/issues/379)
8+
* **Query:** fix undesired sort of query parameter sort ([f22bd65](https://github.com/commercetools/commercetools-php-sdk/commit/f22bd65)), closes [#386](https://github.com/commercetools/commercetools-php-sdk/issues/386)
9+
10+
11+
### Features
12+
13+
* **CartDiscount:** support cart discount stacking mode ([64f18b8](https://github.com/commercetools/commercetools-php-sdk/commit/64f18b8)), closes [#354](https://github.com/commercetools/commercetools-php-sdk/issues/354)
14+
* **CartDiscount:** support multi buy discounts ([5207c2b](https://github.com/commercetools/commercetools-php-sdk/commit/5207c2b)), closes [#353](https://github.com/commercetools/commercetools-php-sdk/issues/353)
15+
* **Context:** add interface for CurrencyFormatter ([b35abff](https://github.com/commercetools/commercetools-php-sdk/commit/b35abff))
16+
* **CustomObject:** add CustomObjectByIdGetRequest ([2194d3e](https://github.com/commercetools/commercetools-php-sdk/commit/2194d3e))
17+
* **DiscountCode:** support custom fields for discount codes ([80aa86f](https://github.com/commercetools/commercetools-php-sdk/commit/80aa86f)), closes [#352](https://github.com/commercetools/commercetools-php-sdk/issues/352)
18+
* **DiscountCode:** support validFrom and validUntil for discount codes ([523929a](https://github.com/commercetools/commercetools-php-sdk/commit/523929a)), closes [#367](https://github.com/commercetools/commercetools-php-sdk/issues/367)
19+
* **DiscountCode:** support groups for discount codes ([53a8f05](https://github.com/commercetools/commercetools-php-sdk/commit/53a8f05)), closes [#362](https://github.com/commercetools/commercetools-php-sdk/issues/362)
20+
* **Order:** support delivery update actions ([d033399](https://github.com/commercetools/commercetools-php-sdk/commit/d033399)), closes [#369](https://github.com/commercetools/commercetools-php-sdk/issues/369)
21+
* **Order:** support get/update/delete order by orderNumber ([dc1a101](https://github.com/commercetools/commercetools-php-sdk/commit/dc1a101)), closes [#356](https://github.com/commercetools/commercetools-php-sdk/issues/356)
22+
* **Order:** support parcel delivery items ([6f35c31](https://github.com/commercetools/commercetools-php-sdk/commit/6f35c31)), closes [#357](https://github.com/commercetools/commercetools-php-sdk/issues/357)
23+
* **Cart:** support tax calculation mode ([2ef543b](https://github.com/commercetools/commercetools-php-sdk/commit/2ef543b)), closes [#376](https://github.com/commercetools/commercetools-php-sdk/issues/376)
24+
* **Payment:** support get/update/delete payment by key ([da32ce6](https://github.com/commercetools/commercetools-php-sdk/commit/da32ce6)), closes [#349](https://github.com/commercetools/commercetools-php-sdk/issues/349)
25+
* **State:** add constant for state role return ([b713135](https://github.com/commercetools/commercetools-php-sdk/commit/b713135)), closes [#363](https://github.com/commercetools/commercetools-php-sdk/issues/363)
26+
* **Order:** support address for order deliveries ([8ef8dea](https://github.com/commercetools/commercetools-php-sdk/commit/8ef8dea)), closes [#366](https://github.com/commercetools/commercetools-php-sdk/issues/366)
27+
* **Client:** support client instantiation with preconfigured bearer token ([d93a455](https://github.com/commercetools/commercetools-php-sdk/commit/d93a455)), closes [#359](https://github.com/commercetools/commercetools-php-sdk/issues/359)
28+
* **CartDiscount:** support custom field for cart discounts ([a8325c1](https://github.com/commercetools/commercetools-php-sdk/commit/a8325c1)), closes [#373](https://github.com/commercetools/commercetools-php-sdk/issues/373)
29+
* **CustomerGroup:** support custom field for customer groups ([23d1737](https://github.com/commercetools/commercetools-php-sdk/commit/23d1737)), closes [#360](https://github.com/commercetools/commercetools-php-sdk/issues/360)
30+
* **Assets:** support key for assets ([a3c9ea0](https://github.com/commercetools/commercetools-php-sdk/commit/a3c9ea0)), closes [#371](https://github.com/commercetools/commercetools-php-sdk/issues/371)
31+
* **Cart:** support origin for carts and orders ([37db8de](https://github.com/commercetools/commercetools-php-sdk/commit/37db8de)), closes [#361](https://github.com/commercetools/commercetools-php-sdk/issues/361)
32+
* **Product:** support revertStagedVariantChanges ([18d0be2](https://github.com/commercetools/commercetools-php-sdk/commit/18d0be2)), closes [#372](https://github.com/commercetools/commercetools-php-sdk/issues/372)
33+
* **ProductDiscount:** support validFrom and validUntil for product discounts ([c75e53c](https://github.com/commercetools/commercetools-php-sdk/commit/c75e53c)), closes [#368](https://github.com/commercetools/commercetools-php-sdk/issues/368)
34+
* **ProductType:** support changeAttributeConstraint update action ([52932d8](https://github.com/commercetools/commercetools-php-sdk/commit/52932d8)), closes [#370](https://github.com/commercetools/commercetools-php-sdk/issues/370)
35+
* **ShippingMethod:** support setPredicate on shipping methods ([ec2fce5](https://github.com/commercetools/commercetools-php-sdk/commit/ec2fce5)), closes [#375](https://github.com/commercetools/commercetools-php-sdk/issues/375)
36+
* **Product:** support staged flag for product meta update actions ([b60aab0](https://github.com/commercetools/commercetools-php-sdk/commit/b60aab0)), closes [#358](https://github.com/commercetools/commercetools-php-sdk/issues/358)
37+
* **ShippingMethod:** support shipping rate tiers ([#384](https://github.com/commercetools/commercetools-php-sdk/issues/384)) ([7611315](https://github.com/commercetools/commercetools-php-sdk/commit/7611315)), closes [#355](https://github.com/commercetools/commercetools-php-sdk/issues/355)
38+
* **ShoppingList:** support add line item by SKU ([7172e1c](https://github.com/commercetools/commercetools-php-sdk/commit/7172e1c)), closes [#374](https://github.com/commercetools/commercetools-php-sdk/issues/374)
39+
* **Customer:** support updateProductData of cart on customer login ([555ccb3](https://github.com/commercetools/commercetools-php-sdk/commit/555ccb3)), closes [#377](https://github.com/commercetools/commercetools-php-sdk/issues/377)
40+
41+
42+
143
<a name="2.2.1"></a>
244
## [2.2.1](https://github.com/commercetools/commercetools-php-sdk/compare/v2.2.0...v2.2.1) (2017-10-06)
345

@@ -137,7 +179,7 @@
137179
### DEPRECATION NOTE
138180

139181
The class ```Commercetools\Commons\Helper\PriceFinder``` has been deprecated. Please use the
140-
[price selection](http://dev.commercetools.com/http-api-projects-products.html#price-selection) functionality of
182+
[price selection](http://docs.commercetools.com/http-api-projects-products.html#price-selection) functionality of
141183
the platform. E.g. ```ProductProjectionSearchRequest::of()->currency('EUR')->country('DE')```
142184

143185

CONTRIBUTING.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Feel free to open an issue for bigger effort changes and ask if you can help or get help with your idea. For typos and documentation improvements just make a pull request.
2+
3+
Then:
4+
5+
1. fork the repository on GitHub
6+
1. code and add tests that cover the created code. Your code should be warning-free.
7+
1. stick to PSR-2 and and don't reformat existing code.
8+
1. make a pull request. @jenschude will review it and pull or come back to you.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2015 commercetools GmbH and contributors
3+
Copyright (c) 2017 commercetools GmbH and contributors
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

PULL_REQUEST_TEMPLATE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
1. code and add tests that cover the created code. Your code should be warning-free.
2+
* [ ] tests existing
3+
1. stick to PSR-2 and and don't reformat existing code.
4+
* [ ] code style check succesful

README.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,30 @@ foreach ($products as $product) {
105105

106106
In real world, you will not put your API credentials directly into code but use a config file or your framework's config or dependency injection system for that.
107107

108+
#### Using the phar distribution
109+
110+
Since version 1.6 the SDK is also released as a PHAR. You can find them in the [releases section](https://github.com/commercetools/commercetools-php-sdk/releases) at Github.
111+
112+
Usage example:
113+
```php
114+
<?php
115+
116+
require __DIR__ . '/commercetools-php-sdk.phar';
117+
118+
$config = \Commercetools\Core\Config::fromArray([
119+
'client_id' => 'myClientId',
120+
'client_secret' => 'myClientSecret',
121+
'project' => 'myProjectId'
122+
]);
123+
$client = \Commercetools\Core\Client::ofConfig($config);
124+
$request = \Commercetools\Core\Request\Project\ProjectGetRequest::of();
125+
126+
$response = $client->execute($request);
127+
128+
$project = $request->mapFromResponse($response);
129+
var_dump($project->toArray());
130+
```
131+
108132
## Improve & Contribute to the SDK project
109133

110134
### Mac OS X preparations:
@@ -209,7 +233,7 @@ Then:
209233
1. fork the repository on GitHub
210234
2. code and add tests that cover the created code. Your code should be warning-free.
211235
3. stick to PSR-2 and and don't reformat existing code.
212-
4. make a pull request. @jayS-de will review it and pull or come back to you.
236+
4. make a pull request. @jenschude will review it and pull or come back to you.
213237

214238

215239

build.xml

Lines changed: 1 addition & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<!-- <property name="toolsdir" value="${basedir}/vendor/bin/"/> -->
1212

1313
<target name="build"
14-
depends="prepare,lint,phploc-ci,pdepend,phpmd-ci,phpcs-ci,phpcpd-ci,unit-test,apigen"
14+
depends="prepare,lint,phpcs-ci,unit-test,apigen"
1515
description=""/>
1616

1717
<target name="build-parallel"
@@ -20,13 +20,7 @@
2020

2121
<target name="tools-parallel" description="Run tools in parallel">
2222
<parallel threadCount="2">
23-
<sequential>
24-
<antcall target="pdepend"/>
25-
<antcall target="phpmd-ci"/>
26-
</sequential>
27-
<antcall target="phpcpd-ci"/>
2823
<antcall target="phpcs-ci"/>
29-
<antcall target="phploc-ci"/>
3024
</parallel>
3125
</target>
3226

@@ -36,7 +30,6 @@
3630
<delete dir="${basedir}/build/docs"/>
3731
<delete dir="${basedir}/build/coverage"/>
3832
<delete dir="${basedir}/build/logs"/>
39-
<delete dir="${basedir}/build/pdepend"/>
4033
<property name="clean.done" value="true"/>
4134
</target>
4235

@@ -47,7 +40,6 @@
4740
<mkdir dir="${basedir}/build/docs"/>
4841
<mkdir dir="${basedir}/build/coverage"/>
4942
<mkdir dir="${basedir}/build/logs"/>
50-
<mkdir dir="${basedir}/build/pdepend"/>
5143
<property name="prepare.done" value="true"/>
5244
</target>
5345

@@ -67,63 +59,6 @@
6759
</apply>
6860
</target>
6961

70-
<target name="phploc"
71-
description="Measure project size using PHPLOC and print human readable output. Intended for usage on the command line.">
72-
<exec executable="${toolsdir}phploc${execPostfix}">
73-
<arg value="--count-tests" />
74-
<arg path="${basedir}/src" />
75-
<arg path="${basedir}/tests" />
76-
</exec>
77-
</target>
78-
79-
<target name="phploc-ci"
80-
depends="prepare"
81-
description="Measure project size using PHPLOC and log result in CSV and XML format. Intended for usage within a continuous integration environment.">
82-
<exec executable="${toolsdir}phploc${execPostfix}">
83-
<arg value="--count-tests" />
84-
<arg value="--log-csv" />
85-
<arg path="${basedir}/build/logs/phploc.csv" />
86-
<arg value="--log-xml" />
87-
<arg path="${basedir}/build/logs/phploc.xml" />
88-
<arg path="${basedir}/src" />
89-
<arg path="${basedir}/tests" />
90-
</exec>
91-
</target>
92-
93-
<target name="pdepend"
94-
depends="prepare"
95-
description="Calculate software metrics using PHP_Depend and log result in XML format. Intended for usage within a continuous integration environment.">
96-
<exec executable="${toolsdir}pdepend${execPostfix}">
97-
<arg value="--jdepend-xml=${basedir}/build/logs/jdepend.xml" />
98-
<arg value="--jdepend-chart=${basedir}/build/pdepend/dependencies.svg" />
99-
<arg value="--overview-pyramid=${basedir}/build/pdepend/overview-pyramid.svg" />
100-
<arg path="${basedir}/src" />
101-
</exec>
102-
</target>
103-
104-
<target name="phpmd"
105-
description="Perform project mess detection using PHPMD and print human readable output. Intended for usage on the command line before committing.">
106-
<exec executable="${toolsdir}phpmd${execPostfix}">
107-
<arg path="${basedir}/src" />
108-
<arg value="text" />
109-
<arg value="codesize,controversial,design,naming,unusedcode"/>
110-
<arg path="${basedir}/build/phpmd.xml" />
111-
</exec>
112-
</target>
113-
114-
<target name="phpmd-ci"
115-
depends="prepare"
116-
description="Perform project mess detection using PHPMD and log result in XML format. Intended for usage within a continuous integration environment.">
117-
<exec executable="${toolsdir}phpmd${execPostfix}">
118-
<arg path="${basedir}/src" />
119-
<arg value="xml" />
120-
<arg value="codesize,controversial,design,naming,unusedcode"/>
121-
<arg path="${basedir}/build/phpmd.xml" />
122-
<arg value="--reportfile" />
123-
<arg path="${basedir}/build/logs/pmd.xml" />
124-
</exec>
125-
</target>
126-
12762
<target name="phpcs"
12863
description="Find coding standard violations using PHP_CodeSniffer and print human readable output. Intended for usage on the command line before committing.">
12964
<exec executable="${toolsdir}phpcs${execPostfix}" failonerror="true">
@@ -146,23 +81,6 @@
14681
</exec>
14782
</target>
14883

149-
<target name="phpcpd"
150-
description="Find duplicate code using PHPCPD and print human readable output. Intended for usage on the command line before committing.">
151-
<exec executable="${toolsdir}phpcpd${execPostfix}">
152-
<arg path="${basedir}/src" />
153-
</exec>
154-
</target>
155-
156-
<target name="phpcpd-ci"
157-
depends="prepare"
158-
description="Find duplicate code using PHPCPD and log result in XML format. Intended for usage within a continuous integration environment.">
159-
<exec executable="${toolsdir}phpcpd${execPostfix}">
160-
<arg value="--log-pmd" />
161-
<arg path="${basedir}/build/logs/pmd-cpd.xml" />
162-
<arg path="${basedir}/src" />
163-
</exec>
164-
</target>
165-
16684
<target name="behat"
16785
depends="prepare"
16886
description="Run behat tests"

build/theme/class.latte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
{if $class->internal}<b>PHP Extension:</b> <a href="{$class->extension|manualUrl}" title="Go to PHP documentation">{$class->extension->name|firstUpper}</a><br>{/if}
7979
{if $class->inNamespace()}<b>Namespace:</b> {$class->namespaceName|namespaceLinks|noescape}<br>{/if}
8080

81-
{var $sphereDoc = '//dev.commercetools.com/'}
81+
{var $sphereDoc = '//docs.commercetools.com/'}
8282
{foreach $template->annotationSort($template->annotationFilter($class->annotations)) as $annotation => $values}
8383
{foreach $values as $value}
8484
{if $annotation == "link"}

0 commit comments

Comments
 (0)