Passed
Push — develop ( 92e1e8...d25e3e )
by Jens
12:17
created

OrderEditCreateRequest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A ofDraft() 0 3 1
1
<?php
2
/**
3
 *
4
 */
5
6
namespace Commercetools\Core\Request\OrderEdits;
7
8
use Commercetools\Core\Model\Common\Context;
9
use Commercetools\Core\Model\OrderEdit\OrderEdit;
10
use Commercetools\Core\Model\OrderEdit\OrderEditDraft;
11
use Commercetools\Core\Request\AbstractCreateRequest;
12
use Commercetools\Core\Response\ApiResponseInterface;
13
use Commercetools\Core\Model\MapperInterface;
14
15
/**
16
 * @package Commercetools\Core\Request\OrderEdits
17
 *
18
 * @method OrderEdit mapResponse(ApiResponseInterface $response)
19
 * @method OrderEdit mapFromResponse(ApiResponseInterface $response, MapperInterface $mapper = null)
20
 */
21
class OrderEditCreateRequest extends AbstractCreateRequest
22
{
23
    protected $resultClass = OrderEdit::class;
24
25
    /**
26
     * OrderEditCreateRequest constructor.
27
     * @param OrderEditDraft $orderEdit
28
     * @param Context|null $context
29
     */
30 58
    public function __construct(OrderEditDraft $orderEdit, Context $context = null)
31
    {
32 58
        parent::__construct(OrderEditsEndpoint::endpoint(), $orderEdit, $context);
33 58
    }
34
35
    /**
36
     * @param OrderEditDraft $orderEdit
37
     * @param Context|null $context
38
     * @return OrderEditCreateRequest
39
     */
40 58
    public static function ofDraft(OrderEditDraft $orderEdit, Context $context = null)
41
    {
42 58
        return new static($orderEdit, $context);
43
    }
44
}
45