Passed
Push — master ( 3f8301...c7321f )
by Jens
42:49 queued 17:59
created

CartDiscountUpdateByKeyRequest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 4
dl 0
loc 24
ccs 0
cts 5
cp 0
rs 10
c 1
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A ofKeyAndVersion() 0 3 1
A __construct() 0 3 1
1
<?php
2
/**
3
 */
4
5
namespace Commercetools\Core\Request\CartDiscounts;
6
7
use Commercetools\Core\Model\CartDiscount\CartDiscount;
8
use Commercetools\Core\Model\Common\Context;
9
use Commercetools\Core\Request\AbstractUpdateByKeyRequest;
10
use Commercetools\Core\Response\ApiResponseInterface;
11
use Commercetools\Core\Model\MapperInterface;
12
13
/**
14
 * @package Commercetools\Core\Request\CartDiscounts
15
 *
16
 * @method CartDiscount mapResponse(ApiResponseInterface $response)
17
 * @method CartDiscount mapFromResponse(ApiResponseInterface $response, MapperInterface $mapper = null)
18
 */
19
class CartDiscountUpdateByKeyRequest extends AbstractUpdateByKeyRequest
20
{
21
    protected $resultClass = CartDiscount::class;
22
23
    /**
24
     * @param string $key
25
     * @param int $version
26
     * @param array $actions
27
     * @param Context $context
28
     */
29
    public function __construct($key, $version, array $actions = [], Context $context = null)
30
    {
31
        parent::__construct(CartDiscountsEndpoint::endpoint(), $key, $version, $actions, $context);
32
    }
33
34
    /**
35
     * @param string $key
36
     * @param int $version
37
     * @param Context $context
38
     * @return static
39
     */
40
    public static function ofKeyAndVersion($key, $version, Context $context = null)
41
    {
42
        return new static($key, $version, [], $context);
43
    }
44
}
45