Passed
Push — develop ( 793156...298c14 )
by Jens
09:21 queued 13s
created

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