Completed
Push — develop ( 58cdba...7f1e46 )
by Jens
08:46
created

ReviewDeleteByKeyRequest::ofKeyAndVersion()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 4
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 3
crap 1
1
<?php
2
/**
3
 * @author @jayS-de <[email protected]>
4
 */
5
6
namespace Commercetools\Core\Request\Reviews;
7
8
use Commercetools\Core\Model\Common\Context;
9
use Commercetools\Core\Request\AbstractDeleteByKeyRequest;
10
use Commercetools\Core\Model\Type\Type;
11
use Commercetools\Core\Response\ApiResponseInterface;
12
13
/**
14
 * @package Commercetools\Core\Request\Types
15
 * @link http://dev.commercetools.com/http-api-projects-reviews.html#delete-review-by-key
16
 * @method Type mapResponse(ApiResponseInterface $response)
17
 */
18 View Code Duplication
class ReviewDeleteByKeyRequest extends AbstractDeleteByKeyRequest
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...
19
{
20
    protected $resultClass = '\Commercetools\Core\Model\Review\Review';
21
22
    /**
23
     * @param string $id
24
     * @param int $version
25
     * @param Context $context
26
     */
27 2
    public function __construct($id, $version, Context $context = null)
28
    {
29 2
        parent::__construct(ReviewsEndpoint::endpoint(), $id, $version, $context);
30 2
    }
31
32
    /**
33
     * @param string $key
34
     * @param int $version
35
     * @param Context $context
36
     * @return static
37
     */
38 2
    public static function ofKeyAndVersion($key, $version, Context $context = null)
39
    {
40 2
        return new static($key, $version, $context);
41
    }
42
}
43