Passed
Push — develop ( f53d0b...3a55e6 )
by Jens
09:08
created

SubscriptionByIdGetRequest::ofId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 2
crap 1
1
<?php
2
/**
3
 * @author @jenschude <[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://docs.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
class SubscriptionByIdGetRequest extends AbstractByIdGetRequest
21
{
22
    protected $resultClass = Subscription::class;
23
24
    /**
25
     * @param string $id
26
     * @param Context $context
27
     */
28 3
    public function __construct($id, Context $context = null)
29
    {
30 3
        parent::__construct(SubscriptionsEndpoint::endpoint(), $id, $context);
31 3
    }
32
33
    /**
34
     * @param string $id
35
     * @param Context $context
36
     * @return static
37
     */
38 3
    public static function ofId($id, Context $context = null)
39
    {
40 3
        return new static($id, $context);
41
    }
42
}
43