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

Commit ac7e2f3

Browse files
committed
Merge branch 'release/v2.9.0'
2 parents 78880bb + aa55d71 commit ac7e2f3

File tree

141 files changed

+3956
-903
lines changed

Some content is hidden

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

141 files changed

+3956
-903
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,6 @@ cache/commercetools_io_access_token*
2020
src/cache/
2121
github_deploy_key
2222
node_modules
23+
docroot/cache/
24+
docroot/requests.log
25+
tests/integration/requests.log

.scrutinizer.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,19 @@ before_commands:
1515
build:
1616
environment:
1717
php:
18-
version: '7.1'
18+
version: '7.3'
1919
ini:
2020
apc.enabled: 1
2121
apc.enable_cli: 1
2222
nodes:
2323
my-tests:
2424
tests:
2525
override:
26-
-
27-
command: vendor/bin/behat -f progress
2826
-
2927
command: vendor/bin/phpunit --coverage-clover=coverage0
3028
coverage:
3129
file: 'coverage0'
3230
format: 'php-clover'
33-
- command: php-scrutinizer-run
31+
- command: php-scrutinizer-run --enable-security-analysis
3432
filter:
3533
excluded_paths: [build/*, tests/*, docroot/*, features/*, src/Core/Helper/Annotate/*, src/Core/Helper/State/*, src/Core/Helper/Subscriber/*]

.travis.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,16 @@ dist: xenial
22
sudo: false
33
language: php
44
php:
5-
- 7.0
65
- 5.6
76
- 7.1
8-
- 7.2
97
- 7.3
10-
- nightly
8+
- 7.4snapshot
119
env:
1210
- GUZZLE=5
1311
- GUZZLE=6
1412
matrix:
1513
allow_failures:
16-
- php: nightly
14+
- php: 7.4snapshot
1715
services:
1816
- redis-server
1917
cache:
@@ -32,10 +30,8 @@ before_script:
3230
- if [ $GUZZLE == '5' ] ; then ./set_guzzle5.sh; fi
3331
- if [ $GUZZLE == '5' ] && [ $PHP == '5.6' ] ; then composer update -o --prefer-dist --prefer-lowest; else composer install -o --prefer-dist; fi
3432
script:
35-
- if [ $PHP == '7.2' ] && [ $GUZZLE == '6' ]; then vendor/bin/phpcs --standard=PSR2 --extensions=php --ignore=autoload.php,src/Core/Builder src/; fi
3633
- if [ $PHP == '5.6' ] ; then vendor/bin/phpunit -c phpunit5.xml.dist --testsuite=unit; fi
37-
- if [ $PHP == '7.0' ] ; then vendor/bin/phpunit -c phpunit6.xml.dist --testsuite=unit; fi
38-
- if [ $PHP != '5.6' ] && [ $PHP != '7.0' ] ; then vendor/bin/phpunit --testsuite=unit; fi
34+
- if [ $PHP != '5.6' ] ; then vendor/bin/phpunit --testsuite=unit; fi
3935
- if [ $PHP == '7.3' ] && [ $GUZZLE == '6' ] && [ $TRAVIS_PULL_REQUEST == 'false' ]; then vendor/bin/phpunit --testsuite=integration; fi
4036
- bin/ctp-tlscheck.php
4137
before_deploy:

CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,30 @@
1+
# [2.9.0](https://github.com/commercetools/commercetools-php-sdk/compare/v2.8.0...v2.9.0) (2019-12-02)
2+
3+
4+
### Bug Fixes
5+
6+
* **Cart:** fix serialization of cart draft ([024b8fd](https://github.com/commercetools/commercetools-php-sdk/commit/024b8fd))
7+
* **OAuth:** fix oauth refresh token URL ([0bf801d](https://github.com/commercetools/commercetools-php-sdk/commit/0bf801d))
8+
9+
10+
### Features
11+
12+
* **ApiClient:** add deleteAt to feldDefinition method ([d2b6b35](https://github.com/commercetools/commercetools-php-sdk/commit/d2b6b35))
13+
* **ApiClientDraft:** add deleteDaysAfterCreation in fieldDefinitions ([4ee7f07](https://github.com/commercetools/commercetools-php-sdk/commit/4ee7f07))
14+
* **ClientFactory:** add option to inject middleware to HttpClients ([734fe63](https://github.com/commercetools/commercetools-php-sdk/commit/734fe63))
15+
* **ClientFactory:** create HttpClient with CTP client compatible request signature ([3a55d24](https://github.com/commercetools/commercetools-php-sdk/commit/3a55d24))
16+
* **Customer:** support stores for customer ([5eee954](https://github.com/commercetools/commercetools-php-sdk/commit/5eee954))
17+
* **Draft:** add factory methods in draft classes for ApiClient and Asset and Cart ([bc0f616](https://github.com/commercetools/commercetools-php-sdk/commit/bc0f616))
18+
* **ImportOrder:** support store for order import ([175953c](https://github.com/commercetools/commercetools-php-sdk/commit/175953c)), closes [#499](https://github.com/commercetools/commercetools-php-sdk/issues/499)
19+
* **InStoreRequest:** add request to InStoreRequests to add new shipping method endpoint ([ee7620f](https://github.com/commercetools/commercetools-php-sdk/commit/ee7620f))
20+
* **Me:** support me/shopping-lists endpoint ([fc52e82](https://github.com/commercetools/commercetools-php-sdk/commit/fc52e82))
21+
* **Message:** add messages ProductAddedToCategory and ProductRemovedFromCategory ([673b4cf](https://github.com/commercetools/commercetools-php-sdk/commit/673b4cf))
22+
* **Order:** add refusedGift field ([7532e38](https://github.com/commercetools/commercetools-php-sdk/commit/7532e38))
23+
* **Product:** add discounted field to PriceDraft ([b3c44fe](https://github.com/commercetools/commercetools-php-sdk/commit/b3c44fe))
24+
* **Query:** add support for parametrized queries ([b3bc4ad](https://github.com/commercetools/commercetools-php-sdk/commit/b3bc4ad)), closes [#505](https://github.com/commercetools/commercetools-php-sdk/issues/505)
25+
26+
27+
128
# [2.8.0](https://github.com/commercetools/commercetools-php-sdk/compare/v2.7.0...v2.8.0) (2019-06-06)
229

330

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Please read the [Changelog](CHANGELOG.md) before updating in any case.
6262

6363
### Getting started
6464

65-
To get up and running, create a free test project ([EU located](https://admin.commercetools.com/en/signup) or [US located](https://admin.commercetools.co/en/signup)) on the commercetools platform. To generate your API credentials go to [EU Merchant Center](https://mc.commercetools.com/) or [US Merchant Center](https://mc.commercetools.co/) (Menu "Settings"->"Developer Settings"->"API Clients"->"Create New Api Client").
65+
To get up and running, create a free test project ([EU located](https://mc.commercetools.com/login/new) or [US located](https://mc.commercetools.co/login/new)) on the commercetools platform. To generate your API credentials go to [EU Merchant Center](https://mc.commercetools.com/) or [US Merchant Center](https://mc.commercetools.co/) (Menu "Settings"->"Developer Settings"->"API Clients"->"Create New Api Client").
6666
You need to select the template for the "Admin client".
6767

6868
```php
@@ -131,6 +131,7 @@ require '../vendor/autoload.php';
131131
use Commercetools\Core\Builder\Request\RequestBuilder;
132132
use Commercetools\Core\Client\ClientFactory;
133133
use Commercetools\Core\Config;
134+
use Commercetools\Core\Error\ApiException;
134135
use Commercetools\Core\Model\Common\Context;
135136

136137
$config = [
@@ -146,13 +147,13 @@ $config = Config::fromArray($config)->setContext($context)->setThrowExceptions(t
146147
* execute the request and get the PHP Object
147148
* (the client can and should be re-used)
148149
*/
149-
$search = RequestBuilder::of()->productProjections()->search()
150+
$request = RequestBuilder::of()->productProjections()->search()
150151
->addParam('text.en', 'red');
151152

152153
$client = ClientFactory::of()->createClient($config);
153154

154155
try {
155-
$response = $client->send($request->httpRequest());
156+
$response = $client->execute($request);
156157
} catch (ApiException $exception) {
157158
throw new \Exception("Ooops! Something happened.", 0, $exception);
158159
}

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.8.0",
3+
"version": "2.10.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",

phpcs.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0"?>
2+
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="PHP_CodeSniffer" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
3+
<rule ref="PSR2"/>
4+
<file>src/</file>
5+
<exclude-pattern>src/Core/Builder</exclude-pattern>
6+
<exclude-pattern>autoload.php</exclude-pattern>
7+
</ruleset>

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.8.0';
17+
const VERSION = '2.9.0';
1818

1919
/**
2020
* @var AdapterInterface

src/Core/Builder/Request/MeRequestBuilder.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,14 @@ public function orders()
9595
return new MeOrderRequestBuilder();
9696
}
9797

98+
/**
99+
* @return MeShoppingListRequestBuilder
100+
*/
101+
public function shoppingLists()
102+
{
103+
return new MeShoppingListRequestBuilder();
104+
}
105+
98106
/**
99107
* @param Customer $customer
100108
* @param string $currentPassword
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<?php
2+
/**
3+
*/
4+
5+
namespace Commercetools\Core\Builder\Request;
6+
7+
use Commercetools\Core\Model\ShoppingList\MyShoppingListDraft;
8+
use Commercetools\Core\Model\ShoppingList\ShoppingList;
9+
use Commercetools\Core\Request\Me\MeShoppingListByIdGetRequest;
10+
use Commercetools\Core\Request\Me\MeShoppingListCreateRequest;
11+
use Commercetools\Core\Request\Me\MeShoppingListDeleteRequest;
12+
use Commercetools\Core\Request\Me\MeShoppingListQueryRequest;
13+
use Commercetools\Core\Request\Me\MeShoppingListUpdateRequest;
14+
15+
class MeShoppingListRequestBuilder
16+
{
17+
18+
/**
19+
* @return MeShoppingListQueryRequest
20+
*/
21+
public function query()
22+
{
23+
return MeShoppingListQueryRequest::of();
24+
}
25+
26+
/**
27+
* @param ShoppingList $shoppingList
28+
* @return MeShoppingListUpdateRequest
29+
*/
30+
public function update(ShoppingList $shoppingList)
31+
{
32+
return MeShoppingListUpdateRequest::ofIdAndVersion($shoppingList->getId(), $shoppingList->getVersion());
33+
}
34+
35+
/**
36+
* @param string $shoppingListId
37+
* @return MeShoppingListByIdGetRequest
38+
*/
39+
public function getById($shoppingListId)
40+
{
41+
return MeShoppingListByIdGetRequest::ofId($shoppingListId);
42+
}
43+
44+
/**
45+
* @param MyShoppingListDraft $myShoppingListDraft
46+
* @return MeShoppingListCreateRequest
47+
*/
48+
public function create(MyShoppingListDraft $myShoppingListDraft)
49+
{
50+
return MeShoppingListCreateRequest::ofDraft($myShoppingListDraft);
51+
}
52+
53+
/**
54+
* @param ShoppingList $shoppingList
55+
* @return MeShoppingListDeleteRequest
56+
*/
57+
public function delete(ShoppingList $shoppingList)
58+
{
59+
return MeShoppingListDeleteRequest::ofIdAndVersion($shoppingList->getId(), $shoppingList->getVersion());
60+
}
61+
}

0 commit comments

Comments
 (0)