Passed
Branch request_builder (fdca7a)
by Jens
08:39
created

SubscriptionDeleteByKeyRequest::ofKeyAndVersion()   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 0
Metric Value
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 3
crap 1
1
<?php
2
/**
3
 * @author @jenschude <[email protected]>
4
 */
5
6
namespace Commercetools\Core\Request\Subscriptions;
7
8
use Commercetools\Core\Model\Common\Context;
9
use Commercetools\Core\Model\Subscription\Subscription;
10
use Commercetools\Core\Request\AbstractDeleteByKeyRequest;
11
use Commercetools\Core\Request\AbstractDeleteRequest;
12
use Commercetools\Core\Response\ApiResponseInterface;
13
use Commercetools\Core\Model\MapperInterface;
14
15
/**
16
 * @package Commercetools\Core\Request\Subscriptions
17
 * @link https://docs.commercetools.com/http-api-projects-subscriptions.html#delete-subscription-by-key
18
 * @method Subscription mapResponse(ApiResponseInterface $response)
19
 * @method Subscription mapFromResponse(ApiResponseInterface $response, MapperInterface $mapper = null)
20
 */
21
class SubscriptionDeleteByKeyRequest extends AbstractDeleteByKeyRequest
22
{
23
    protected $resultClass = Subscription::class;
24
25
    /**
26
     * @param string $key
27
     * @param int $version
28
     * @param Context $context
29
     */
30 3
    public function __construct($key, $version, Context $context = null)
31
    {
32 3
        parent::__construct(SubscriptionsEndpoint::endpoint(), $key, $version, $context);
33 3
    }
34
35
    /**
36
     * @param string $key
37
     * @param int $version
38
     * @param Context $context
39
     * @return static
40
     */
41 3
    public static function ofKeyAndVersion($key, $version, Context $context = null)
42
    {
43 3
        return new static($key, $version, $context);
44
    }
45
}
46