Passed
Push — develop ( ce160c...798982 )
by Barbara
18:04 queued 14s
created

MeShoppingListByKeyGetRequest::__construct()   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 1
Bugs 0 Features 1
Metric Value
eloc 1
c 1
b 0
f 1
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 2
crap 1
1
<?php
2
3
namespace Commercetools\Core\Request\Me;
4
5
use Commercetools\Core\Model\Common\Context;
6
use Commercetools\Core\Model\ShoppingList\ShoppingList;
7
use Commercetools\Core\Request\AbstractByKeyGetRequest;
8
use Commercetools\Core\Response\ApiResponseInterface;
9
use Commercetools\Core\Model\MapperInterface;
10
11
/**
12
 * @package Commercetools\Core\Request\Me
13
 * @link https://docs.commercetools.com/http-api-projects-me-shoppingLists#get-shoppinglist-by-key
14
 * @method ShoppingList mapResponse(ApiResponseInterface $response)
15
 * @method ShoppingList mapFromResponse(ApiResponseInterface $response, MapperInterface $mapper = null)
16
 */
17
class MeShoppingListByKeyGetRequest extends AbstractByKeyGetRequest
18
{
19
    protected $resultClass = ShoppingList::class;
20
21
    /**
22
     * @param string $key
23
     * @param Context $context
24
     */
25 1
    public function __construct($key, Context $context = null)
26
    {
27 1
        parent::__construct(MeShoppingListsEndpoint::endpoint(), $key, $context);
28 1
    }
29
30
    /**
31
     * @param string $key
32
     * @param Context $context
33
     * @return static
34
     */
35 1
    public static function ofKey($key, Context $context = null)
36
    {
37 1
        return new static($key, $context);
38
    }
39
}
40