Completed
Push — develop ( 82f3e0...710c89 )
by Jens
17:41 queued 09:30
created

ReviewUpdateByKeyRequest::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
dl 4
loc 4
rs 10
c 1
b 0
f 1
cc 1
eloc 2
nc 1
nop 4
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\AbstractUpdateByKeyRequest;
10
use Commercetools\Core\Request\AbstractUpdateRequest;
11
use Commercetools\Core\Model\Review\Review;
12
use Commercetools\Core\Response\ApiResponseInterface;
13
14
/**
15
 * @package Commercetools\Core\Request\Reviews
16
 * @link https://dev.commercetools.com/http-api-projects-reviews.html#update-review
17
 * @method Review mapResponse(ApiResponseInterface $response)
18
 */
19 View Code Duplication
class ReviewUpdateByKeyRequest 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...
20
{
21
    protected $resultClass = '\Commercetools\Core\Model\Review\Review';
22
23
    /**
24
     * @param string $key
25
     * @param string $version
26
     * @param array $actions
27
     * @param Context $context
28
     */
29
    public function __construct($key, $version, array $actions = [], Context $context = null)
30
    {
31
        parent::__construct(ReviewsEndpoint::endpoint(), $key, $version, $actions, $context);
32
    }
33
34
    /**
35
     * @param string $key
36
     * @param int $version
37
     * @param Context $context
38
     * @return static
39
     */
40
    public static function ofKeyAndVersion($key, $version, Context $context = null)
41
    {
42
        return new static($key, $version, [], $context);
43
    }
44
}
45