Completed
Push — develop ( e77623...3cc0f7 )
by Jens
09:01
created

MeCartUpdateRequest::ofIdAndVersion()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 4
loc 4
ccs 0
cts 4
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 3
crap 2
1
<?php
2
/**
3
 * @author @jayS-de <[email protected]>
4
 */
5
6
namespace Commercetools\Core\Request\Me;
7
8
use Commercetools\Core\Model\Cart\Cart;
9
use Commercetools\Core\Model\Common\Context;
10
use Commercetools\Core\Request\AbstractUpdateRequest;
11
use Commercetools\Core\Response\ApiResponseInterface;
12
13
/**
14
 * @package Commercetools\Core\Request\Me
15
 *
16
 * @method Cart mapResponse(ApiResponseInterface $response)
17
 */
18 View Code Duplication
class MeCartUpdateRequest extends AbstractUpdateRequest
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
19
{
20
    protected $resultClass = '\Commercetools\Core\Model\Cart\Cart';
21
22
    /**
23
     * @param string $id
24
     * @param string $version
25
     * @param array $actions
26
     * @param Context $context
27
     */
28
    public function __construct($id, $version, array $actions = [], Context $context = null)
29
    {
30
        parent::__construct(MeCartsEndpoint::endpoint(), $id, $version, $actions, $context);
31
    }
32
33
    /**
34
     * @param string $id
35
     * @param int $version
36
     * @param Context $context
37
     * @return static
38
     */
39
    public static function ofIdAndVersion($id, $version, Context $context = null)
40
    {
41
        return new static($id, $version, [], $context);
42
    }
43
}
44