Completed
Push — develop ( 046464...9a0cd6 )
by Jens
13:20
created

ShippingMethodDeleteRequest::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 1
b 0
f 1
cc 1
eloc 2
nc 1
nop 3
crap 1
1
<?php
2
/**
3
 * @author @jayS-de <[email protected]>
4
 */
5
6
namespace Commercetools\Core\Request\ShippingMethods;
7
8
use Commercetools\Core\Model\Common\Context;
9
use Commercetools\Core\Model\ShippingMethod\ShippingMethod;
10
use Commercetools\Core\Request\AbstractDeleteRequest;
11
use Commercetools\Core\Response\ApiResponseInterface;
12
13
/**
14
 * @package Commercetools\Core\Request\ShippingMethods
15
 * @link https://dev.commercetools.com/http-api-projects-shippingMethods.html#delete-shipping-method
16
 * @method ShippingMethod mapResponse(ApiResponseInterface $response)
17
 */
18
class ShippingMethodDeleteRequest extends AbstractDeleteRequest
19
{
20
    protected $resultClass = '\Commercetools\Core\Model\ShippingMethod\ShippingMethod';
21
22
    /**
23
     * @param string $id
24
     * @param int $version
25
     * @param Context $context
26
     */
27 5
    public function __construct($id, $version, Context $context = null)
28
    {
29 5
        parent::__construct(ShippingMethodsEndpoint::endpoint(), $id, $version, $context);
30 5
    }
31
32
    /**
33
     * @param string $id
34
     * @param int $version
35
     * @param Context $context
36
     * @return static
37
     */
38 5
    public static function ofIdAndVersion($id, $version, Context $context = null)
39
    {
40 5
        return new static($id, $version, $context);
41
    }
42
}
43