Passed
Push — master ( 18b32f...fa2b73 )
by Jens
08:15
created

ExtensionByIdGetRequest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A ofId() 0 3 1
A __construct() 0 3 1
1
<?php
2
/**
3
 */
4
5
namespace Commercetools\Core\Request\Extensions;
6
7
use Commercetools\Core\Model\Common\Context;
8
use Commercetools\Core\Request\AbstractByIdGetRequest;
9
use Commercetools\Core\Model\Extension\Extension;
10
use Commercetools\Core\Response\ApiResponseInterface;
11
use Commercetools\Core\Model\MapperInterface;
12
13
/**
14
 * @package Commercetools\Core\Request\Extensions
15
 * @link https://docs.commercetools.com/http-api-projects-api-extensions.html#get-an-extension-by-id
16
 * @method Extension mapResponse(ApiResponseInterface $response)
17
 * @method Extension mapFromResponse(ApiResponseInterface $response, MapperInterface $mapper = null)
18
 */
19
class ExtensionByIdGetRequest extends AbstractByIdGetRequest
20
{
21
    protected $resultClass = Extension::class;
22
23
    /**
24
     * @param string $id
25
     * @param Context $context
26
     */
27
    public function __construct($id, Context $context = null)
28
    {
29
        parent::__construct(ExtensionsEndpoint::endpoint(), $id, $context);
30
    }
31
32
    /**
33
     * @param string $id
34
     * @param Context $context
35
     * @return static
36
     */
37
    public static function ofId($id, Context $context = null)
38
    {
39
        return new static($id, $context);
40
    }
41
}
42