Passed
Pull Request — develop (#492)
by nikos
11:03 queued 10s
created

StoreDeleteRequest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A ofIdAndVersion() 0 3 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\AbstractDeleteRequest;
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-id
16
 * @method Store mapResponse(ApiResponseInterface $response)
17
 * @method Store mapFromResponse(ApiResponseInterface $response, MapperInterface $mapper = null)
18
 */
19
class StoreDeleteRequest extends AbstractDeleteRequest
20
{
21
    protected $resultClass = Store::class;
22
23
    /**
24
     * @param string $id
25
     * @param int $version
26
     * @param Context $context
27
     */
28 21
    public function __construct($id, $version, Context $context = null)
29
    {
30 21
        parent::__construct(StoresEndpoint::endpoint(), $id, $version, $context);
31 21
    }
32
33
    /**
34
     * @param string $id
35
     * @param int $version
36
     * @param Context $context
37
     * @return static
38
     */
39 21
    public static function ofIdAndVersion($id, $version, Context $context = null)
40
    {
41 21
        return new static($id, $version, $context);
42
    }
43
}
44