Completed
Push — master ( 18bfc7...82e0b5 )
by Jens
18:00 queued 05:19
created

SubscriptionByIdGetRequest::__construct()   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 0
Metric Value
dl 4
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 2
crap 2
1
<?php
2
/**
3
 * @author @jayS-de <[email protected]>
4
 */
5
6
namespace Commercetools\Core\Request\Subscriptions;
7
8
use Commercetools\Core\Model\Common\Context;
9
use Commercetools\Core\Request\AbstractByIdGetRequest;
10
use Commercetools\Core\Model\Subscription\Subscription;
11
use Commercetools\Core\Response\ApiResponseInterface;
12
use Commercetools\Core\Model\MapperInterface;
13
14
/**
15
 * @package Commercetools\Core\Request\Subscriptions
16
 * @link https://dev.commercetools.com/http-api-projects-subscriptions.html#get-a-subscription-by-id
17
 * @method Subscription mapResponse(ApiResponseInterface $response)
18
 * @method Subscription mapFromResponse(ApiResponseInterface $response, MapperInterface $mapper = null)
19
 */
20 View Code Duplication
class SubscriptionByIdGetRequest 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...
21
{
22
    protected $resultClass = '\Commercetools\Core\Model\Subscription\Subscription';
23
24
    /**
25
     * @param string $id
26
     * @param Context $context
27
     */
28
    public function __construct($id, Context $context = null)
29
    {
30
        parent::__construct(SubscriptionsEndpoint::endpoint(), $id, $context);
31
    }
32
33
    /**
34
     * @param string $id
35
     * @param Context $context
36
     * @return static
37
     */
38
    public static function ofId($id, Context $context = null)
39
    {
40
        return new static($id, $context);
41
    }
42
}
43