Test Failed
Push — develop ( 99d0ad...a91eee )
by Jens
47:28 queued 25:36
created

CartDeleteByKeyRequest::ofKeyAndVersion()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 1
b 0
f 1
cc 1
nc 1
nop 3
1
<?php
2
3
namespace Commercetools\Core\Request\Carts;
4
5
use Commercetools\Core\Model\Common\Context;
6
use Commercetools\Core\Request\AbstractDeleteByKeyRequest;
7
use Commercetools\Core\Model\Cart\Cart;
8
use Commercetools\Core\Request\DataErasureTrait;
9
use Commercetools\Core\Request\InStores\InStoreRequestDecorator;
10
use Commercetools\Core\Request\InStores\InStoreTrait;
11
use Commercetools\Core\Response\ApiResponseInterface;
12
use Commercetools\Core\Model\MapperInterface;
13
14
/**
15
 * @package Commercetools\Core\Request\Carts
16
 * @link https://docs.commercetools.com/api/projects/carts#delete-a-cart-by-key
17
 * @method Cart mapResponse(ApiResponseInterface $response)
18
 * @method Cart mapFromResponse(ApiResponseInterface $response, MapperInterface $mapper = null)
19
 * @method CartDeleteByKeyRequest|InStoreRequestDecorator inStore($storeKey)
20
 */
21
class CartDeleteByKeyRequest extends AbstractDeleteByKeyRequest
22
{
23
    use DataErasureTrait;
24
    use InStoreTrait;
25
26
    protected $resultClass = Cart::class;
27
28
    /**
29
     * @param string $key
30
     * @param int $version
31
     * @param Context $context
32
     */
33
    public function __construct($key, $version, Context $context = null)
34
    {
35
        parent::__construct(CartsEndpoint::endpoint(), $key, $version, $context);
36
    }
37
38
    /**
39
     * @param string $key
40
     * @param int $version
41
     * @param Context $context
42
     * @return static
43
     */
44
    public static function ofKeyAndVersion($key, $version, Context $context = null)
45
    {
46
        return new static($key, $version, $context);
47
    }
48
}
49