Passed
Push — develop ( 1795ba...79eaf3 )
by Jens
25:35 queued 03:06
created

MeOrderQueryRequest::__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 1
crap 2
1
<?php
2
/**
3
 * @author @jenschude <[email protected]>
4
 */
5
6
namespace Commercetools\Core\Request\Me;
7
8
use Commercetools\Core\Model\Common\Context;
9
use Commercetools\Core\Model\Order\OrderCollection;
10
use Commercetools\Core\Request\AbstractQueryRequest;
11
use Commercetools\Core\Request\InStores\InStoreRequestDecorator;
12
use Commercetools\Core\Request\InStores\InStoreTrait;
13
use Commercetools\Core\Response\ApiResponseInterface;
14
use Commercetools\Core\Model\MapperInterface;
15
16
/**
17
 * @package Commercetools\Core\Request\Me
18
 * @link https://docs.commercetools.com/http-api-projects-me-orders.html#query-orders
19
 * @method OrderCollection mapResponse(ApiResponseInterface $response)
20
 * @method OrderCollection mapFromResponse(ApiResponseInterface $response, MapperInterface $mapper = null)
21
 * @method MeOrderQueryRequest|InStoreRequestDecorator inStore($storeKey)
22
 */
23
class MeOrderQueryRequest extends AbstractQueryRequest
24
{
25
    use InStoreTrait;
26
27
    protected $resultClass = OrderCollection::class;
28
29
    /**
30
     * @param Context $context
31
     */
32
    public function __construct(Context $context = null)
33
    {
34
        parent::__construct(MeOrdersEndpoint::endpoint(), $context);
35
    }
36
37
    /**
38
     * @param Context $context
39
     * @return static
40
     */
41
    public static function of(Context $context = null)
42
    {
43
        return new static($context);
44
    }
45
}
46