Passed
Push — develop ( 3a55d2...1bb7ea )
by Jens
11:37
created

MeDeleteRequest::__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 0
Metric Value
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 2
crap 1
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\Request\AbstractDeleteRequest;
10
use Commercetools\Core\Model\Customer\Customer;
11
use Commercetools\Core\Response\ApiResponseInterface;
12
use Commercetools\Core\Model\MapperInterface;
13
14
/**
15
 * @package Commercetools\Core\Request\Me
16
 * @link https://docs.commercetools.com/http-api-projects-me-profile.html#delete-customer
17
 * @method Customer mapResponse(ApiResponseInterface $response)
18
 * @method Customer mapFromResponse(ApiResponseInterface $response, MapperInterface $mapper = null)
19
 */
20
class MeDeleteRequest extends AbstractDeleteRequest
21
{
22
    protected $resultClass = Customer::class;
23
24
    /**
25
     * @param int $version
26
     * @param Context $context
27
     */
28 1
    public function __construct($version, Context $context = null)
29
    {
30 1
        parent::__construct(MeEndpoint::endpoint(), null, $version, $context);
31 1
    }
32
33
    /**
34
     * @param int $version
35
     * @param Context $context
36
     * @return static
37
     */
38 1
    public static function ofVersion($version, Context $context = null)
39
    {
40 1
        return new static($version, $context);
41
    }
42
43
    /**
44
     * @return string
45
     * @internal
46
     */
47 1
    protected function getPath()
48
    {
49 1
        return (string)$this->getEndpoint() . $this->getParamString();
50
    }
51
}
52