Completed
Push — develop ( e5510f...295319 )
by
unknown
08:01
created

ReviewUpdateRequest::ofKeyAndVersion()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 1
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\Reviews;
7
8
use Commercetools\Core\Model\Common\Context;
9
use Commercetools\Core\Request\AbstractUpdateRequest;
10
use Commercetools\Core\Model\Review\Review;
11
use Commercetools\Core\Response\ApiResponseInterface;
12
13
/**
14
 * @package Commercetools\Core\Request\Reviews
15
 * @apidoc http://dev.sphere.io/http-api-projects-reviews.html#update-review
16
 * @method Review mapResponse(ApiResponseInterface $response)
17
 */
18
class ReviewUpdateRequest extends AbstractUpdateRequest
19
{
20
    protected $resultClass = '\Commercetools\Core\Model\Review\Review';
21
22
    /**
23
     * @param string $id
24
     * @param string $version
25
     * @param array $actions
26
     * @param Context $context
27
     */
28 2
    public function __construct($id, $version, array $actions = [], Context $context = null)
29
    {
30 2
        parent::__construct(ReviewsEndpoint::endpoint(), $id, $version, $actions, $context);
31 2
    }
32
33
    /**
34
     * @param string $id
35
     * @param int $version
36
     * @param Context $context
37
     * @return static
38
     */
39 2
    public static function ofIdAndVersion($id, $version, Context $context = null)
40
    {
41 2
        return new static($id, $version, [], $context);
42
    }
43
44
    /**
45
     * @param string $key
46
     * @param int $version
47
     * @param Context $context
48
     * @return static
49
     */
50
    public static function ofKeyAndVersion($key, $version, Context $context = null)
51
    {
52
        return new static('key=' . $key, $version, [], $context);
53
    }
54
}
55