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

ApiClientByIdGetRequest::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 2
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