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

Commit 07c34eb

Browse files
committed
Merge branch 'release/v2.15.0'
2 parents a902110 + cb255d0 commit 07c34eb

22 files changed

+308
-35
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @commercetools/clients-sdk-team

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior
15+
16+
**Expected behavior**
17+
A clear and concise description of what you expected to happen.
18+
19+
**Screenshots/Code snippet**
20+
If applicable, add screenshots or code samples to help explain your problem.
21+
22+
**Stack information (please complete the following information):**
23+
- PHP: [e.g. 7.4]
24+
- SDK: [e.g. v2.2]
25+
26+
27+
**Additional context**
28+
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/custom.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
name: Custom issue template
3+
about: Describe this issue template's purpose here.
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: enhancement
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
tools: composer
2828

2929
- name: "Cache dependencies installed with composer"
30-
uses: actions/cache@v1
30+
uses: actions/cache@v2
3131
with:
3232
path: ~/.composer/cache
3333
key: php7.4-composer-highest-${{ hashFiles('**/composer.json') }}
@@ -109,7 +109,7 @@ jobs:
109109
ini-values: assert.exception=1, zend.assertions=1
110110

111111
- name: "Cache dependencies installed with composer"
112-
uses: actions/cache@v1
112+
uses: actions/cache@v2
113113
with:
114114
path: ~/.composer/cache
115115
key: php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }}
@@ -157,7 +157,7 @@ jobs:
157157
ini-values: assert.exception=1, zend.assertions=1, apc.enabled=1, apc.enable_cli=1
158158

159159
- name: "Cache dependencies installed with composer"
160-
uses: actions/cache@v1
160+
uses: actions/cache@v2
161161
with:
162162
path: ~/.composer/cache
163163
key: php7.4-composer-highest-${{ hashFiles('**/composer.json') }}

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
run: ./install-apigen.sh && php apigen.phar generate --debug --config build/apigen.neon
2525

2626
- name: Install SSH Client 🔑
27-
uses: webfactory/ssh-agent@v0.4.1
27+
uses: webfactory/ssh-agent@v0.5.2
2828
with:
2929
ssh-private-key: ${{ secrets.DEPLOY_KEY }}
3030

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
# [2.15.0](https://github.com/commercetools/commercetools-php-sdk/compare/v2.14.0...v2.15.0) (2021-05-07)
2+
3+
4+
### Features
5+
6+
* **ShoppingList:** support store for shopping lists ([8808ed1](https://github.com/commercetools/commercetools-php-sdk/commit/8808ed1e36ffc0094372395bc9cd523ba2fcda22))
7+
8+
9+
110
# [2.14.0](https://github.com/commercetools/commercetools-php-sdk/compare/v2.13.0...v2.14.0) (2021-03-02)
211

312
### Features

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"require-dev": {
4444
"guzzlehttp/guzzle": "^7.0 || ^6.0",
4545
"phpunit/phpunit": "^8.5",
46-
"symplify/easy-coding-standard-prefixed": "^8.3.48 || ^9.2.1",
46+
"symplify/easy-coding-standard-prefixed": "8.3.48 || 9.2.1",
4747
"doctrine/cache": "^1.6",
4848
"monolog/monolog": "^1.12",
4949
"symfony/yaml": "^4.0 || ^3.4.38",

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "commercetools-php-sdk-changelog",
3-
"version": "2.14.0",
3+
"version": "2.15.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",
@@ -14,6 +14,6 @@
1414
"postinstall": "cp tools/commit-msg.sh .git/hooks/commit-msg && cp tools/pre-commit.sh .git/hooks/pre-commit"
1515
},
1616
"devDependencies": {
17-
"conventional-changelog-cli": "^2.0.31"
17+
"conventional-changelog-cli": "2.1.1"
1818
}
1919
}

renovate.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"extends": [
3+
"config:base",
4+
":pinOnlyDevDependencies",
5+
":enableVulnerabilityAlerts",
6+
"schedule:weekly"
7+
],
8+
"separateMajorMinor": true,
9+
"packageRules": [
10+
{
11+
"packagePatterns": [
12+
"*"
13+
],
14+
"updateTypes": ["minor", "patch"],
15+
"groupName": "all dependencies",
16+
"groupSlug": "all"
17+
}
18+
],
19+
"lockFileMaintenance": {
20+
"enabled": true
21+
},
22+
"labels": [
23+
"Type: Maintenance"
24+
],
25+
"ignoreDeps": []
26+
}

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

1919
/**
2020
* @var AdapterInterface

src/Core/Builder/Update/ShoppingListsActionBuilder.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
use Commercetools\Core\Request\ShoppingLists\Command\ShoppingListSetLineItemCustomFieldAction;
2525
use Commercetools\Core\Request\ShoppingLists\Command\ShoppingListSetLineItemCustomTypeAction;
2626
use Commercetools\Core\Request\ShoppingLists\Command\ShoppingListSetSlugAction;
27+
use Commercetools\Core\Request\ShoppingLists\Command\ShoppingListSetStoreAction;
2728
use Commercetools\Core\Request\ShoppingLists\Command\ShoppingListSetTextLineItemCustomFieldAction;
2829
use Commercetools\Core\Request\ShoppingLists\Command\ShoppingListSetTextLineItemCustomTypeAction;
2930
use Commercetools\Core\Request\ShoppingLists\Command\ShoppingListSetTextLineItemDescriptionAction;
@@ -252,6 +253,17 @@ public function setSlug($action = null)
252253
return $this;
253254
}
254255

256+
/**
257+
* @link https://docs.commercetools.com/http-api-projects-shoppingLists.html#set-store
258+
* @param ShoppingListSetStoreAction|callable $action
259+
* @return $this
260+
*/
261+
public function setStore($action = null)
262+
{
263+
$this->addAction($this->resolveAction(ShoppingListSetStoreAction::class, $action));
264+
return $this;
265+
}
266+
255267
/**
256268
* @link https://docs.commercetools.com/http-api-projects-shoppingLists.html#set-textlineitem-customfield
257269
* @param ShoppingListSetTextLineItemCustomFieldAction|callable $action

src/Core/Model/ShoppingList/MyShoppingListDraft.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Commercetools\Core\Model\Common\Resource;
99
use Commercetools\Core\Model\Common\LocalizedString;
1010
use Commercetools\Core\Model\CustomField\CustomFieldObjectDraft;
11+
use Commercetools\Core\Model\Store\StoreReference;
1112

1213
/**
1314
* @package Commercetools\Core\Model\ShoppingList
@@ -24,6 +25,8 @@
2425
* @method MyShoppingListDraft setCustom(CustomFieldObjectDraft $custom = null)
2526
* @method int getDeleteDaysAfterLastModification()
2627
* @method MyShoppingListDraft setDeleteDaysAfterLastModification(int $deleteDaysAfterLastModification = null)
28+
* @method StoreReference getStore()
29+
* @method MyShoppingListDraft setStore(StoreReference $store = null)
2730
*/
2831
class MyShoppingListDraft extends Resource
2932
{
@@ -36,6 +39,7 @@ public function fieldDefinitions()
3639
'textLineItems' => [static::TYPE => TextLineItemDraftCollection::class],
3740
'custom' => [static::TYPE => CustomFieldObjectDraft::class],
3841
'deleteDaysAfterLastModification' => [static::TYPE => 'int'],
42+
'store' => [static::TYPE => StoreReference::class],
3943
];
4044
}
4145

src/Core/Model/ShoppingList/ShoppingList.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use Commercetools\Core\Model\Common\Resource;
1313
use Commercetools\Core\Model\Customer\CustomerReference;
1414
use Commercetools\Core\Model\CustomField\CustomFieldObject;
15+
use Commercetools\Core\Model\Store\StoreReference;
1516
use DateTime;
1617

1718
/**
@@ -49,6 +50,8 @@
4950
* @method ShoppingList setCreatedBy(CreatedBy $createdBy = null)
5051
* @method LastModifiedBy getLastModifiedBy()
5152
* @method ShoppingList setLastModifiedBy(LastModifiedBy $lastModifiedBy = null)
53+
* @method StoreReference getStore()
54+
* @method ShoppingList setStore(StoreReference $store = null)
5255
* @method ShoppingListReference getReference()
5356
*/
5457
class ShoppingList extends Resource
@@ -78,6 +81,7 @@ public function fieldDefinitions()
7881
'anonymousId' => [static::TYPE => 'string'],
7982
'createdBy' => [static::TYPE => CreatedBy::class],
8083
'lastModifiedBy' => [static::TYPE => LastModifiedBy::class],
84+
'store' => [static::TYPE => StoreReference::class],
8185
];
8286
}
8387
}

src/Core/Model/ShoppingList/ShoppingListDraft.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Commercetools\Core\Model\Common\LocalizedString;
1111
use Commercetools\Core\Model\Customer\CustomerReference;
1212
use Commercetools\Core\Model\CustomField\CustomFieldObjectDraft;
13+
use Commercetools\Core\Model\Store\StoreReference;
1314

1415
/**
1516
* @package Commercetools\Core\Model\ShoppingList
@@ -34,6 +35,8 @@
3435
* @method ShoppingListDraft setDeleteDaysAfterLastModification(int $deleteDaysAfterLastModification = null)
3536
* @method string getAnonymousId()
3637
* @method ShoppingListDraft setAnonymousId(string $anonymousId = null)
38+
* @method StoreReference getStore()
39+
* @method ShoppingListDraft setStore(StoreReference $store = null)
3740
*/
3841
class ShoppingListDraft extends Resource
3942
{
@@ -49,7 +52,8 @@ public function fieldDefinitions()
4952
'textLineItems' => [static::TYPE => TextLineItemDraftCollection::class],
5053
'custom' => [static::TYPE => CustomFieldObjectDraft::class],
5154
'deleteDaysAfterLastModification' => [static::TYPE => 'int'],
52-
'anonymousId' => [static::TYPE => 'string']
55+
'anonymousId' => [static::TYPE => 'string'],
56+
'store' => [static::TYPE => StoreReference::class],
5357
];
5458
}
5559

src/Core/Request/InStores/InStoreRequests.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@
3535
use Commercetools\Core\Request\Me\MeOrderByIdRequest;
3636
use Commercetools\Core\Request\Me\MeOrderCreateFromCartRequest;
3737
use Commercetools\Core\Request\Me\MeOrderQueryRequest;
38+
use Commercetools\Core\Request\Me\MeShoppingListByIdGetRequest;
39+
use Commercetools\Core\Request\Me\MeShoppingListByKeyGetRequest;
40+
use Commercetools\Core\Request\Me\MeShoppingListCreateRequest;
41+
use Commercetools\Core\Request\Me\MeShoppingListDeleteByKeyRequest;
42+
use Commercetools\Core\Request\Me\MeShoppingListDeleteRequest;
43+
use Commercetools\Core\Request\Me\MeShoppingListQueryRequest;
44+
use Commercetools\Core\Request\Me\MeShoppingListUpdateByKeyRequest;
45+
use Commercetools\Core\Request\Me\MeShoppingListUpdateRequest;
3846
use Commercetools\Core\Request\Orders\OrderByIdGetRequest;
3947
use Commercetools\Core\Request\Orders\OrderByOrderNumberGetRequest;
4048
use Commercetools\Core\Request\Orders\OrderCreateFromCartRequest;
@@ -44,6 +52,14 @@
4452
use Commercetools\Core\Request\Orders\OrderUpdateByOrderNumberRequest;
4553
use Commercetools\Core\Request\Orders\OrderUpdateRequest;
4654
use Commercetools\Core\Request\ShippingMethods\ShippingMethodByCartIdGetRequest;
55+
use Commercetools\Core\Request\ShoppingLists\ShoppingListByIdGetRequest;
56+
use Commercetools\Core\Request\ShoppingLists\ShoppingListByKeyGetRequest;
57+
use Commercetools\Core\Request\ShoppingLists\ShoppingListCreateRequest;
58+
use Commercetools\Core\Request\ShoppingLists\ShoppingListDeleteByKeyRequest;
59+
use Commercetools\Core\Request\ShoppingLists\ShoppingListDeleteRequest;
60+
use Commercetools\Core\Request\ShoppingLists\ShoppingListQueryRequest;
61+
use Commercetools\Core\Request\ShoppingLists\ShoppingListUpdateByKeyRequest;
62+
use Commercetools\Core\Request\ShoppingLists\ShoppingListUpdateRequest;
4763

4864
class InStoreRequests
4965
{
@@ -87,6 +103,22 @@ class InStoreRequests
87103
CustomerUpdateRequest::class => 1,
88104
CustomerUpdateByKeyRequest::class => 1,
89105
ShippingMethodByCartIdGetRequest::class => 1,
106+
ShoppingListByKeyGetRequest::class => 1,
107+
ShoppingListByIdGetRequest::class => 1,
108+
ShoppingListQueryRequest::class => 1,
109+
ShoppingListCreateRequest::class => 1,
110+
ShoppingListUpdateRequest::class => 1,
111+
ShoppingListUpdateByKeyRequest::class => 1,
112+
ShoppingListDeleteRequest::class => 1,
113+
ShoppingListDeleteByKeyRequest::class => 1,
114+
MeShoppingListByKeyGetRequest::class => 1,
115+
MeShoppingListByIdGetRequest::class => 1,
116+
MeShoppingListQueryRequest::class => 1,
117+
MeShoppingListCreateRequest::class => 1,
118+
MeShoppingListUpdateRequest::class => 1,
119+
MeShoppingListUpdateByKeyRequest::class => 1,
120+
MeShoppingListDeleteRequest::class => 1,
121+
MeShoppingListDeleteByKeyRequest::class => 1,
90122
];
91123

92124
public function can($request)
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?php
2+
/**
3+
* @author @jenschude <jens.schulze@commercetools.de>
4+
*/
5+
6+
namespace Commercetools\Core\Request\ShoppingLists\Command;
7+
8+
use Commercetools\Core\Model\Common\Context;
9+
use Commercetools\Core\Model\Store\StoreReference;
10+
use Commercetools\Core\Request\AbstractAction;
11+
12+
/**
13+
* @package Commercetools\Core\Request\ShoppingLists\Command
14+
* @link https://docs.commercetools.com/http-api-projects-shoppingLists.html#set-store
15+
* @method string getAction()
16+
* @method ShoppingListSetStoreAction setAction(string $action = null)
17+
* @method StoreReference getStore()
18+
* @method ShoppingListSetStoreAction setStore(StoreReference $store = null)
19+
*/
20+
class ShoppingListSetStoreAction extends AbstractAction
21+
{
22+
public function fieldDefinitions()
23+
{
24+
return [
25+
'action' => [static::TYPE => 'string'],
26+
'store' => [static::TYPE => StoreReference::class],
27+
];
28+
}
29+
30+
/**
31+
* @param array $data
32+
* @param Context|callable $context
33+
*/
34+
public function __construct(array $data = [], $context = null)
35+
{
36+
parent::__construct($data, $context);
37+
$this->setAction('setStore');
38+
}
39+
40+
/**
41+
* @param StoreReference $store
42+
* @param Context|callable $context
43+
* @return ShoppingListSetStoreAction
44+
*/
45+
public static function ofStore(StoreReference $store, $context = null)
46+
{
47+
return static::of($context)->setStore($store);
48+
}
49+
}

0 commit comments

Comments
 (0)