Completed
Push — develop ( b357fe...347ecb )
by Jens
11:13
created

ProjectUpdateRequest::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 4
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
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\Project;
7
8
use Commercetools\Core\Client\JsonEndpoint;
9
use Commercetools\Core\Model\Common\Context;
10
use Commercetools\Core\Model\Project\Project;
11
use Commercetools\Core\Model\Review\Review;
12
use Commercetools\Core\Request\AbstractUpdateRequest;
13
use Commercetools\Core\Response\ApiResponseInterface;
14
use Commercetools\Core\Model\MapperInterface;
15
16
/**
17
 * @package Commercetools\Core\Request\Project
18
 * @link https://dev.commercetools.com/http-api-projects-project.html#update-project
19
 * @method Project mapResponse(ApiResponseInterface $response)
20
 * @method Project mapFromResponse(ApiResponseInterface $response, MapperInterface $mapper = null)
21
 */
22 View Code Duplication
class ProjectUpdateRequest extends AbstractUpdateRequest
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...
23
{
24
    protected $resultClass = Project::class;
25
26
    /**
27
     * @param string $version
28
     * @param array $actions
29
     * @param Context $context
30
     */
31 6
    public function __construct($version, array $actions = [], Context $context = null)
32
    {
33 6
        parent::__construct(new JsonEndpoint(''), null, $version, $actions, $context);
34 6
    }
35
36
    /**
37
     * @param int $version
38
     * @param Context $context
39
     * @return static
40
     */
41 6
    public static function ofVersion($version, Context $context = null)
42
    {
43 6
        return new static($version, [], $context);
44
    }
45
46
    /**
47
     * @return string
48
     * @internal
49
     */
50 6
    protected function getPath()
51
    {
52 6
        return (string)$this->getEndpoint() . $this->getParamString();
53
    }
54
}
55