Passed
Branch api-clients (421244)
by Jens
14:35
created

ApiClientByIdGetRequest::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
eloc 1
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 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 1
    public function __construct($id, Context $context = null)
27
    {
28 1
        parent::__construct(ApiClientsEndpoint::endpoint(), $id, $context);
29 1
    }
30
31
    /**
32
     * @param string $id
33
     * @param Context $context
34
     * @return static
35
     */
36 1
    public static function ofId($id, Context $context = null)
37
    {
38 1
        return new static($id, $context);
39
    }
40
}
41