Completed
Push — develop ( 7d9dc2...57e803 )
by Jens
17:10
created

CustomerGroupUpdateByKeyRequest::ofKeyAndVersion()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 4
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 3
crap 2
1
<?php
2
/**
3
 * @author @jayS-de <[email protected]>
4
 */
5
6
namespace Commercetools\Core\Request\CustomerGroups;
7
8
use Commercetools\Core\Model\Common\Context;
9
use Commercetools\Core\Request\AbstractUpdateByKeyRequest;
10
use Commercetools\Core\Model\CustomerGroup\CustomerGroup;
11
use Commercetools\Core\Response\ApiResponseInterface;
12
use Commercetools\Core\Model\MapperInterface;
13
14
/**
15
 * @package Commercetools\Core\Request\CustomerGroups
16
 * @link https://dev.commercetools.com/http-api-projects-customerGroups.html#update-customergroup
17
 * @method CustomerGroup mapResponse(ApiResponseInterface $response)
18
 * @method CustomerGroup mapFromResponse(ApiResponseInterface $response, MapperInterface $mapper = null)
19
 */
20 View Code Duplication
class CustomerGroupUpdateByKeyRequest extends AbstractUpdateByKeyRequest
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
21
{
22
    protected $resultClass = CustomerGroup::class;
23
24
    /**
25
     * @param string $key
26
     * @param int $version
27
     * @param array $actions
28
     * @param Context $context
29
     */
30
    public function __construct($key, $version, array $actions = [], Context $context = null)
31
    {
32
        parent::__construct(CustomerGroupsEndpoint::endpoint(), $key, $version, $actions, $context);
33
    }
34
35
    /**
36
     * @param string $key
37
     * @param int $version
38
     * @param Context $context
39
     * @return static
40
     */
41
    public static function ofKeyAndVersion($key, $version, Context $context = null)
42
    {
43
        return new static($key, $version, [], $context);
44
    }
45
}
46