Completed
Push — master ( 4b89b9...dd9abc )
by Jens
10:35
created

MeCartByIdRequest::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 4
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 2
crap 1
1
<?php
2
/**
3
 * @author @jayS-de <[email protected]>
4
 */
5
6
namespace Commercetools\Core\Request\Me;
7
8
use Commercetools\Core\Model\Common\Context;
9
use Commercetools\Core\Request\AbstractByIdGetRequest;
10
use Commercetools\Core\Model\Cart\Cart;
11
use Commercetools\Core\Response\ApiResponseInterface;
12
13
/**
14
 * @package Commercetools\Core\Request\Me
15
 * @stability
16
 * @method Cart mapResponse(ApiResponseInterface $response)
17
 */
18 View Code Duplication
class MeCartByIdRequest extends AbstractByIdGetRequest
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 Context $context
25
     */
26 2
    public function __construct($id, Context $context = null)
27
    {
28 2
        parent::__construct(MeCartsEndpoint::endpoint(), $id, $context);
29 2
    }
30
31
    /**
32
     * @param string $id
33
     * @param Context $context
34
     * @return static
35
     */
36 2
    public static function ofId($id, Context $context = null)
37
    {
38 2
        return new static($id, $context);
39
    }
40
}
41