Passed
Push — develop ( 5aeb9c...e255e4 )
by Jens
10:37 queued 13s
created

ApiClientByIdGetRequest   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\ApiClients;
6
7
use Commercetools\Core\Model\ApiClient\ApiClient;
8
use Commercetools\Core\Model\Common\Context;
9
use Commercetools\Core\Request\AbstractByIdGetRequest;
10
use Commercetools\Core\Response\ApiResponseInterface;
11
use Commercetools\Core\Model\MapperInterface;
12
13
/**
14
 * @package Commercetools\Core\Request\ApiClients
15
 * @method ApiClient mapResponse(ApiResponseInterface $response)
16
 * @method ApiClient mapFromResponse(ApiResponseInterface $response, MapperInterface $mapper = null)
17
 */
18
class ApiClientByIdGetRequest extends AbstractByIdGetRequest
19
{
20
    protected $resultClass = ApiClient::class;
21
22
    /**
23
     * @param string $id
24
     * @param Context $context
25
     */
26
    public function __construct($id, Context $context = null)
27
    {
28
        parent::__construct(ApiClientsEndpoint::endpoint(), $id, $context);
29
    }
30
31
    /**
32
     * @param string $id
33
     * @param Context $context
34
     * @return static
35
     */
36
    public static function ofId($id, Context $context = null)
37
    {
38
        return new static($id, $context);
39
    }
40
}
41