Passed
Push — develop ( ce160c...798982 )
by Barbara
18:04 queued 14s
created

MeShoppingListUpdateByKeyRequest::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 1
c 1
b 0
f 1
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 4
crap 1
1
<?php
2
3
namespace Commercetools\Core\Request\Me;
4
5
use Commercetools\Core\Model\Common\Context;
6
use Commercetools\Core\Request\AbstractUpdateByKeyRequest;
7
use Commercetools\Core\Request\AbstractUpdateRequest;
8
use Commercetools\Core\Model\ShoppingList\ShoppingList;
9
use Commercetools\Core\Response\ApiResponseInterface;
10
use Commercetools\Core\Model\MapperInterface;
11
12
/**
13
 * @package Commercetools\Core\Request\Me
14
 * @link https://docs.commercetools.com/http-api-projects-me-shoppingLists#update-shoppinglist-by-key
15
 * @method ShoppingList mapResponse(ApiResponseInterface $response)
16
 * @method ShoppingList mapFromResponse(ApiResponseInterface $response, MapperInterface $mapper = null)
17
 */
18
class MeShoppingListUpdateByKeyRequest extends AbstractUpdateByKeyRequest
19
{
20
    protected $resultClass = ShoppingList::class;
21
22
    /**
23
     * @param string $key
24
     * @param int $version
25
     * @param array $actions
26
     * @param Context $context
27
     */
28 1
    public function __construct($key, $version, array $actions = [], Context $context = null)
29
    {
30 1
        parent::__construct(MeShoppingListsEndpoint::endpoint(), $key, $version, $actions, $context);
31 1
    }
32
33
    /**
34
     * @param string $key
35
     * @param int $version
36
     * @param Context $context
37
     * @return static
38
     */
39 1
    public static function ofKeyAndVersion($key, $version, Context $context = null)
40
    {
41 1
        return new static($key, $version, [], $context);
42
    }
43
}
44