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

MeShoppingListByKeyGetRequest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A ofKey() 0 3 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